Remove deprecated flag --non-masquerade-cidr in kubelet

Signed-off-by: Ciprian Hacman <ciprian@hakman.dev>
This commit is contained in:
Ciprian Hacman 2021-12-17 07:43:22 +02:00
parent fb26256803
commit 21809043b5
5 changed files with 3 additions and 13 deletions

View File

@ -781,9 +781,6 @@ function construct-linux-kubelet-flags {
flags+=" --resolv-conf=/run/systemd/resolve/resolv.conf" flags+=" --resolv-conf=/run/systemd/resolve/resolv.conf"
fi fi
fi fi
if [[ -n "${NON_MASQUERADE_CIDR:-}" ]]; then
flags+=" --non-masquerade-cidr=${NON_MASQUERADE_CIDR}"
fi
flags+=" --volume-plugin-dir=${VOLUME_PLUGIN_DIR}" flags+=" --volume-plugin-dir=${VOLUME_PLUGIN_DIR}"
local node_labels local node_labels
node_labels="$(build-linux-node-labels "${node_type}")" node_labels="$(build-linux-node-labels "${node_type}")"

View File

@ -143,8 +143,6 @@ type KubeletFlags struct {
// schedulable. Won't have any effect if register-node is false. // schedulable. Won't have any effect if register-node is false.
// DEPRECATED: use registerWithTaints instead // DEPRECATED: use registerWithTaints instead
RegisterSchedulable bool 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 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. // This can be useful for debugging volume related issues.
KeepTerminatedPodVolumes bool KeepTerminatedPodVolumes bool
@ -163,7 +161,6 @@ func NewKubeletFlags() *KubeletFlags {
MaxContainerCount: -1, MaxContainerCount: -1,
MaxPerPodContainerCount: 1, MaxPerPodContainerCount: 1,
MinimumGCAge: metav1.Duration{Duration: 0}, MinimumGCAge: metav1.Duration{Duration: 0},
NonMasqueradeCIDR: "10.0.0.0/8",
RegisterSchedulable: true, RegisterSchedulable: true,
NodeLabels: make(map[string]string), NodeLabels: make(map[string]string),
} }
@ -337,8 +334,6 @@ func (f *KubeletFlags) AddFlags(mainfs *pflag.FlagSet) {
fs.MarkDeprecated("master-service-namespace", "This flag will be removed in a future version.") 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.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.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.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.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.") fs.StringVar(&f.ExperimentalMounterPath, "experimental-mounter-path", f.ExperimentalMounterPath, "[Experimental] Path of mounter binary. Leave empty to use the default mount.")

View File

@ -773,8 +773,7 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend
s.ContainerRuntime, s.ContainerRuntime,
s.RuntimeCgroups, s.RuntimeCgroups,
s.RemoteRuntimeEndpoint, s.RemoteRuntimeEndpoint,
s.RemoteImageEndpoint, s.RemoteImageEndpoint)
s.NonMasqueradeCIDR)
if err != nil { if err != nil {
return err return err
} }

View File

@ -289,8 +289,7 @@ func PreInitRuntimeService(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
containerRuntime string, containerRuntime string,
runtimeCgroups string, runtimeCgroups string,
remoteRuntimeEndpoint string, remoteRuntimeEndpoint string,
remoteImageEndpoint string, remoteImageEndpoint string) error {
nonMasqueradeCIDR string) error {
if remoteRuntimeEndpoint != "" { if remoteRuntimeEndpoint != "" {
// remoteImageEndpoint is same as remoteRuntimeEndpoint if not explicitly specified // remoteImageEndpoint is same as remoteRuntimeEndpoint if not explicitly specified
if remoteImageEndpoint == "" { if remoteImageEndpoint == "" {

View File

@ -2356,7 +2356,7 @@ func TestSyncTerminatingPodKillPod(t *testing.T) {
} }
func TestPreInitRuntimeService(t *testing.T) { func TestPreInitRuntimeService(t *testing.T) {
err := PreInitRuntimeService(nil, nil, nil, "", "", "", "", "") err := PreInitRuntimeService(nil, nil, nil, "", "", "", "")
if err == nil { if err == nil {
t.Fatal("PreInitRuntimeService should fail when not configured with a container runtime") t.Fatal("PreInitRuntimeService should fail when not configured with a container runtime")
} }