Skip to content

Commit

Permalink
Merge pull request kubernetes#107096 from hakman/remove_non-masquerad…
Browse files Browse the repository at this point in the history
…e-cidr

Remove deprecated flag --non-masquerade-cidr in kubelet
  • Loading branch information
k8s-ci-robot authored Feb 8, 2022
2 parents 24e5d1f + 2180904 commit 8d01b02
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 13 deletions.
3 changes: 0 additions & 3 deletions cluster/gce/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -781,9 +781,6 @@ function construct-linux-kubelet-flags {
flags+=" --resolv-conf=/run/systemd/resolve/resolv.conf"
fi
fi
if [[ -n "${NON_MASQUERADE_CIDR:-}" ]]; then
flags+=" --non-masquerade-cidr=${NON_MASQUERADE_CIDR}"
fi
flags+=" --volume-plugin-dir=${VOLUME_PLUGIN_DIR}"
local node_labels
node_labels="$(build-linux-node-labels "${node_type}")"
Expand Down
5 changes: 0 additions & 5 deletions cmd/kubelet/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ type KubeletFlags struct {
// schedulable. Won't have any effect if register-node is false.
// DEPRECATED: use registerWithTaints instead
RegisterSchedulable bool
// nonMasqueradeCIDR configures masquerading: traffic to IPs outside this range will use IP masquerade.
NonMasqueradeCIDR string
// This flag, if set, instructs the kubelet to keep volumes from terminated pods mounted to the node.
// This can be useful for debugging volume related issues.
KeepTerminatedPodVolumes bool
Expand All @@ -156,7 +154,6 @@ func NewKubeletFlags() *KubeletFlags {
MaxContainerCount: -1,
MaxPerPodContainerCount: 1,
MinimumGCAge: metav1.Duration{Duration: 0},
NonMasqueradeCIDR: "10.0.0.0/8",
RegisterSchedulable: true,
NodeLabels: make(map[string]string),
}
Expand Down Expand Up @@ -322,8 +319,6 @@ func (f *KubeletFlags) AddFlags(mainfs *pflag.FlagSet) {
fs.MarkDeprecated("master-service-namespace", "This flag will be removed in a future version.")
fs.BoolVar(&f.RegisterSchedulable, "register-schedulable", f.RegisterSchedulable, "Register the node as schedulable. Won't have any effect if register-node is false.")
fs.MarkDeprecated("register-schedulable", "will be removed in a future version")
fs.StringVar(&f.NonMasqueradeCIDR, "non-masquerade-cidr", f.NonMasqueradeCIDR, "Traffic to IPs outside this range will use IP masquerade. Set to '0.0.0.0/0' to never masquerade.")
fs.MarkDeprecated("non-masquerade-cidr", "will be removed in a future version")
fs.BoolVar(&f.KeepTerminatedPodVolumes, "keep-terminated-pod-volumes", f.KeepTerminatedPodVolumes, "Keep terminated pod volumes mounted to the node after the pod terminates. Can be useful for debugging volume related issues.")
fs.MarkDeprecated("keep-terminated-pod-volumes", "will be removed in a future version")
fs.StringVar(&f.ExperimentalMounterPath, "experimental-mounter-path", f.ExperimentalMounterPath, "[Experimental] Path of mounter binary. Leave empty to use the default mount.")
Expand Down
3 changes: 1 addition & 2 deletions cmd/kubelet/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -750,8 +750,7 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend
s.ContainerRuntime,
s.RuntimeCgroups,
s.RemoteRuntimeEndpoint,
s.RemoteImageEndpoint,
s.NonMasqueradeCIDR)
s.RemoteImageEndpoint)
if err != nil {
return err
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/kubelet/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,7 @@ func PreInitRuntimeService(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
containerRuntime string,
runtimeCgroups string,
remoteRuntimeEndpoint string,
remoteImageEndpoint string,
nonMasqueradeCIDR string) error {
remoteImageEndpoint string) error {
if remoteRuntimeEndpoint != "" {
// remoteImageEndpoint is same as remoteRuntimeEndpoint if not explicitly specified
if remoteImageEndpoint == "" {
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/kubelet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2356,7 +2356,7 @@ func TestSyncTerminatingPodKillPod(t *testing.T) {
}

func TestPreInitRuntimeService(t *testing.T) {
err := PreInitRuntimeService(nil, nil, nil, "", "", "", "", "")
err := PreInitRuntimeService(nil, nil, nil, "", "", "", "")
if err == nil {
t.Fatal("PreInitRuntimeService should fail when not configured with a container runtime")
}
Expand Down

0 comments on commit 8d01b02

Please sign in to comment.