From ff4e7752c00e638deb4176122e4ab9e6f68f78bc Mon Sep 17 00:00:00 2001 From: Sadlil Date: Sun, 6 Dec 2020 16:30:51 +0000 Subject: [PATCH 1/2] Fix pod networking for multi node kindnet cni cluster --- go.mod | 2 ++ .../bootstrapper/bsutil/ktmpl/v1alpha3.go | 1 + pkg/minikube/bootstrapper/bsutil/kubeadm.go | 2 +- .../bsutil/testdata/v1.12/dns.yaml | 1 + .../bsutil/testdata/v1.13/dns.yaml | 1 + .../testdata/v1.14/containerd-api-port.yaml | 1 + .../v1.14/containerd-pod-network-cidr.yaml | 1 + .../bsutil/testdata/v1.14/containerd.yaml | 1 + .../testdata/v1.14/crio-options-gates.yaml | 1 + .../bsutil/testdata/v1.14/crio.yaml | 1 + .../bsutil/testdata/v1.14/default.yaml | 1 + .../bsutil/testdata/v1.14/dns.yaml | 1 + .../testdata/v1.14/image-repository.yaml | 1 + .../bsutil/testdata/v1.14/options.yaml | 1 + .../testdata/v1.15/containerd-api-port.yaml | 1 + .../v1.15/containerd-pod-network-cidr.yaml | 1 + .../bsutil/testdata/v1.15/containerd.yaml | 1 + .../testdata/v1.15/crio-options-gates.yaml | 1 + .../bsutil/testdata/v1.15/crio.yaml | 1 + .../bsutil/testdata/v1.15/default.yaml | 1 + .../bsutil/testdata/v1.15/dns.yaml | 1 + .../testdata/v1.15/image-repository.yaml | 1 + .../bsutil/testdata/v1.15/options.yaml | 1 + .../testdata/v1.16/containerd-api-port.yaml | 1 + .../v1.16/containerd-pod-network-cidr.yaml | 1 + .../bsutil/testdata/v1.16/containerd.yaml | 1 + .../testdata/v1.16/crio-options-gates.yaml | 1 + .../bsutil/testdata/v1.16/crio.yaml | 1 + .../bsutil/testdata/v1.16/default.yaml | 1 + .../bsutil/testdata/v1.16/dns.yaml | 1 + .../testdata/v1.16/image-repository.yaml | 1 + .../bsutil/testdata/v1.16/options.yaml | 1 + .../testdata/v1.17/containerd-api-port.yaml | 1 + .../v1.17/containerd-pod-network-cidr.yaml | 1 + .../bsutil/testdata/v1.17/containerd.yaml | 1 + .../testdata/v1.17/crio-options-gates.yaml | 1 + .../bsutil/testdata/v1.17/crio.yaml | 1 + .../bsutil/testdata/v1.17/default.yaml | 1 + .../bsutil/testdata/v1.17/dns.yaml | 1 + .../testdata/v1.17/image-repository.yaml | 1 + .../bsutil/testdata/v1.17/options.yaml | 1 + .../testdata/v1.18/containerd-api-port.yaml | 1 + .../v1.18/containerd-pod-network-cidr.yaml | 1 + .../bsutil/testdata/v1.18/containerd.yaml | 1 + .../testdata/v1.18/crio-options-gates.yaml | 1 + .../bsutil/testdata/v1.18/crio.yaml | 1 + .../bsutil/testdata/v1.18/default.yaml | 1 + .../bsutil/testdata/v1.18/dns.yaml | 1 + .../testdata/v1.18/image-repository.yaml | 1 + .../bsutil/testdata/v1.18/options.yaml | 1 + .../testdata/v1.19/containerd-api-port.yaml | 1 + .../v1.19/containerd-pod-network-cidr.yaml | 1 + .../bsutil/testdata/v1.19/containerd.yaml | 1 + .../testdata/v1.19/crio-options-gates.yaml | 1 + .../bsutil/testdata/v1.19/crio.yaml | 1 + .../bsutil/testdata/v1.19/default.yaml | 1 + .../bsutil/testdata/v1.19/dns.yaml | 1 + .../testdata/v1.19/image-repository.yaml | 1 + .../bsutil/testdata/v1.19/options.yaml | 1 + .../testdata/v1.20/containerd-api-port.yaml | 1 + .../v1.20/containerd-pod-network-cidr.yaml | 1 + .../bsutil/testdata/v1.20/containerd.yaml | 1 + .../testdata/v1.20/crio-options-gates.yaml | 1 + .../bsutil/testdata/v1.20/crio.yaml | 1 + .../bsutil/testdata/v1.20/default.yaml | 1 + .../bsutil/testdata/v1.20/dns.yaml | 1 + .../testdata/v1.20/image-repository.yaml | 1 + .../bsutil/testdata/v1.20/options.yaml | 1 + pkg/minikube/bootstrapper/bsutil/versions.go | 9 ++++++- pkg/minikube/cni/cni.go | 24 +++++++++++++------ pkg/minikube/cni/disabled.go | 3 ++- 71 files changed, 96 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index a3d449a00a09..6df5ebf832ba 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.15 require ( cloud.google.com/go/storage v1.10.0 + contrib.go.opencensus.io/exporter/stackdriver v0.12.1 github.com/Azure/azure-sdk-for-go v42.3.0+incompatible github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.13.0 github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 // indirect @@ -75,6 +76,7 @@ require ( github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f github.com/zchee/go-vmnet v0.0.0-20161021174912-97ebf9174097 + go.opencensus.io v0.22.4 go.opentelemetry.io/otel v0.13.0 go.opentelemetry.io/otel/sdk v0.13.0 golang.org/x/build v0.0.0-20190927031335-2835ba2e683f diff --git a/pkg/minikube/bootstrapper/bsutil/ktmpl/v1alpha3.go b/pkg/minikube/bootstrapper/bsutil/ktmpl/v1alpha3.go index 642213eb7377..20e839b49b2f 100644 --- a/pkg/minikube/bootstrapper/bsutil/ktmpl/v1alpha3.go +++ b/pkg/minikube/bootstrapper/bsutil/ktmpl/v1alpha3.go @@ -57,6 +57,7 @@ etcd: local: dataDir: {{.EtcdDataDir}} controllerManagerExtraArgs: + allocate-node-cidrs: "true" leader-elect: "false" schedulerExtraArgs: leader-elect: "false" diff --git a/pkg/minikube/bootstrapper/bsutil/kubeadm.go b/pkg/minikube/bootstrapper/bsutil/kubeadm.go index 48e4968e6da8..04ce5dd7669f 100644 --- a/pkg/minikube/bootstrapper/bsutil/kubeadm.go +++ b/pkg/minikube/bootstrapper/bsutil/kubeadm.go @@ -116,7 +116,7 @@ func GenerateKubeadmYAML(cc config.ClusterConfig, n config.Node, r cruntime.Mana EtcdDataDir: EtcdDataDir(), EtcdExtraArgs: etcdExtraArgs(k8s.ExtraOptions), ClusterName: cc.Name, - //kubeadm uses NodeName as the --hostname-override parameter, so this needs to be the name of the machine + // kubeadm uses NodeName as the --hostname-override parameter, so this needs to be the name of the machine NodeName: KubeNodeName(cc, n), CRISocket: r.SocketPath(), ImageRepository: k8s.ImageRepository, diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.12/dns.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.12/dns.yaml index 8f5cbfe4e4b7..1d1912b3f2f9 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.12/dns.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.12/dns.yaml @@ -29,6 +29,7 @@ etcd: local: dataDir: /var/lib/minikube/etcd controllerManagerExtraArgs: + allocate-node-cidrs: "true" leader-elect: "false" schedulerExtraArgs: leader-elect: "false" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.13/dns.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.13/dns.yaml index ec2a152e6cd2..db6105a7c2a2 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.13/dns.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.13/dns.yaml @@ -29,6 +29,7 @@ etcd: local: dataDir: /var/lib/minikube/etcd controllerManagerExtraArgs: + allocate-node-cidrs: "true" leader-elect: "false" schedulerExtraArgs: leader-elect: "false" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/containerd-api-port.yaml index 7e367f976397..1abfd6515826 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/containerd-api-port.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/containerd-pod-network-cidr.yaml index 49e49992ec01..34e1038b4506 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/containerd-pod-network-cidr.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/containerd.yaml index 4d2e6ef796e6..612cb02daa23 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/containerd.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/crio-options-gates.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/crio-options-gates.yaml index b300459369bb..df0fbe692fd8 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/crio-options-gates.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/crio-options-gates.yaml @@ -27,6 +27,7 @@ apiServer: feature-gates: "a=b" controllerManager: extraArgs: + allocate-node-cidrs: "true" feature-gates: "a=b" kube-api-burst: "32" leader-elect: "false" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/crio.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/crio.yaml index a447921c996f..b99e83e83181 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/crio.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/crio.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/default.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/default.yaml index 9a2be297b63f..c2f3a0e56d73 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/default.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/default.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/dns.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/dns.yaml index 5c24065898d6..2b64ee7684df 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/dns.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/dns.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/image-repository.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/image-repository.yaml index 8e18b41e91fb..95b095a935a9 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/image-repository.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/image-repository.yaml @@ -26,6 +26,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/options.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/options.yaml index ae0e3b33bb89..c4d5b22471a9 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/options.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.14/options.yaml @@ -26,6 +26,7 @@ apiServer: fail-no-swap: "true" controllerManager: extraArgs: + allocate-node-cidrs: "true" kube-api-burst: "32" leader-elect: "false" scheduler: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/containerd-api-port.yaml index f847dc27cae5..78100eb8351a 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/containerd-api-port.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/containerd-pod-network-cidr.yaml index acc7c1cc3eb7..085740c8c51f 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/containerd-pod-network-cidr.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/containerd.yaml index 0fe66c2290d0..f16eb6a63cbe 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/containerd.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/crio-options-gates.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/crio-options-gates.yaml index 886ecc55fdef..81192f67f0c9 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/crio-options-gates.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/crio-options-gates.yaml @@ -27,6 +27,7 @@ apiServer: feature-gates: "a=b" controllerManager: extraArgs: + allocate-node-cidrs: "true" feature-gates: "a=b" kube-api-burst: "32" leader-elect: "false" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/crio.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/crio.yaml index f797584ae6fb..3b5974913032 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/crio.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/crio.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/default.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/default.yaml index a1ff88dfe0bf..de53b425a0b9 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/default.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/default.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/dns.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/dns.yaml index 91132a6da276..c4d977e02633 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/dns.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/dns.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/image-repository.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/image-repository.yaml index 753e0f5808d4..585510795b02 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/image-repository.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/image-repository.yaml @@ -26,6 +26,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/options.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/options.yaml index ac34fb54c934..28bb9776a13e 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/options.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.15/options.yaml @@ -26,6 +26,7 @@ apiServer: fail-no-swap: "true" controllerManager: extraArgs: + allocate-node-cidrs: "true" kube-api-burst: "32" leader-elect: "false" scheduler: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/containerd-api-port.yaml index 43c3a516761c..8f65f206897f 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/containerd-api-port.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/containerd-pod-network-cidr.yaml index 541fe28d7d9b..17560e57592c 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/containerd-pod-network-cidr.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/containerd.yaml index c1220ac31cb1..8fae2108e059 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/containerd.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/crio-options-gates.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/crio-options-gates.yaml index 1dcc285066f1..8021a6243a07 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/crio-options-gates.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/crio-options-gates.yaml @@ -27,6 +27,7 @@ apiServer: feature-gates: "a=b" controllerManager: extraArgs: + allocate-node-cidrs: "true" feature-gates: "a=b" kube-api-burst: "32" leader-elect: "false" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/crio.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/crio.yaml index bcbe3e1adbc7..b21aaba02105 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/crio.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/crio.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/default.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/default.yaml index d3bddc93fff9..bdc168dbe9aa 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/default.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/default.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/dns.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/dns.yaml index 2167eec3808f..789fbbb27912 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/dns.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/dns.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/image-repository.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/image-repository.yaml index a5fabb759140..657430b1d850 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/image-repository.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/image-repository.yaml @@ -26,6 +26,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/options.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/options.yaml index fb7d61c5bd97..1a49378f6652 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/options.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.16/options.yaml @@ -26,6 +26,7 @@ apiServer: fail-no-swap: "true" controllerManager: extraArgs: + allocate-node-cidrs: "true" kube-api-burst: "32" leader-elect: "false" scheduler: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/containerd-api-port.yaml index 88319aefdf51..9e45ddef68a8 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/containerd-api-port.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/containerd-pod-network-cidr.yaml index 055a20bd1562..cd0490858ba5 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/containerd-pod-network-cidr.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/containerd.yaml index bfb66f2e43d2..68ec81885fdb 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/containerd.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/crio-options-gates.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/crio-options-gates.yaml index 4451a1c2c16d..5e0eb3422b2e 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/crio-options-gates.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/crio-options-gates.yaml @@ -27,6 +27,7 @@ apiServer: feature-gates: "a=b" controllerManager: extraArgs: + allocate-node-cidrs: "true" feature-gates: "a=b" kube-api-burst: "32" leader-elect: "false" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/crio.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/crio.yaml index fa9d43a70b50..697d3ac588a6 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/crio.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/crio.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/default.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/default.yaml index bd43de87042d..9327d71b9a90 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/default.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/default.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/dns.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/dns.yaml index 0447ecc4ee6c..d81012c76e98 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/dns.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/dns.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/image-repository.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/image-repository.yaml index 47a5f98af5ee..73d655547efd 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/image-repository.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/image-repository.yaml @@ -26,6 +26,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/options.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/options.yaml index 210d15bf3538..f5dfe03cb4bf 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/options.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.17/options.yaml @@ -26,6 +26,7 @@ apiServer: fail-no-swap: "true" controllerManager: extraArgs: + allocate-node-cidrs: "true" kube-api-burst: "32" leader-elect: "false" scheduler: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/containerd-api-port.yaml index 499011c33678..71460af02441 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/containerd-api-port.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/containerd-pod-network-cidr.yaml index 979a943896b9..88230c0e06a8 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/containerd-pod-network-cidr.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/containerd.yaml index c13bc4d0300c..5e9d4cfe9ad8 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/containerd.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/crio-options-gates.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/crio-options-gates.yaml index 78f6655b66b0..18a33d5bd037 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/crio-options-gates.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/crio-options-gates.yaml @@ -27,6 +27,7 @@ apiServer: feature-gates: "a=b" controllerManager: extraArgs: + allocate-node-cidrs: "true" feature-gates: "a=b" kube-api-burst: "32" leader-elect: "false" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/crio.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/crio.yaml index 33a8a877572f..d905fb6d1c27 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/crio.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/crio.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/default.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/default.yaml index edb273794937..a16d25276178 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/default.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/default.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/dns.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/dns.yaml index 0ed2f3dcc32d..a4f6629ff1e1 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/dns.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/dns.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/image-repository.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/image-repository.yaml index 3d73fb78bcdd..822f1a7b22f2 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/image-repository.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/image-repository.yaml @@ -26,6 +26,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/options.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/options.yaml index c0ef89ccaa7a..badcff79fbbe 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/options.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.18/options.yaml @@ -26,6 +26,7 @@ apiServer: fail-no-swap: "true" controllerManager: extraArgs: + allocate-node-cidrs: "true" kube-api-burst: "32" leader-elect: "false" scheduler: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-api-port.yaml index 617e821e6b82..e27af142b324 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-api-port.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-pod-network-cidr.yaml index d91d3e926ec3..83fbdefc176e 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-pod-network-cidr.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd.yaml index 6c12857ab2f0..59f9336b01af 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/crio-options-gates.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/crio-options-gates.yaml index 1dcff3d334d3..5eb757356321 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/crio-options-gates.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/crio-options-gates.yaml @@ -27,6 +27,7 @@ apiServer: feature-gates: "a=b" controllerManager: extraArgs: + allocate-node-cidrs: "true" feature-gates: "a=b" kube-api-burst: "32" leader-elect: "false" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/crio.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/crio.yaml index 751041646eff..39f424a92c8d 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/crio.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/crio.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/default.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/default.yaml index da68c6fbcd8a..949759b9e306 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/default.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/default.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/dns.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/dns.yaml index cadb2556e0f6..260b478b0acf 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/dns.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/dns.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/image-repository.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/image-repository.yaml index be593e2fd07b..2c403efe7b19 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/image-repository.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/image-repository.yaml @@ -26,6 +26,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/options.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/options.yaml index f9bad9233f3e..df5ba2ca14ae 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/options.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/options.yaml @@ -26,6 +26,7 @@ apiServer: fail-no-swap: "true" controllerManager: extraArgs: + allocate-node-cidrs: "true" kube-api-burst: "32" leader-elect: "false" scheduler: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-api-port.yaml index 0af52d1b7298..c3ec3ae28fcf 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-api-port.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-pod-network-cidr.yaml index 47b2ba3d9901..6dc8dc31da9c 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-pod-network-cidr.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd.yaml index 149b8de871f0..4e47575e1db1 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/crio-options-gates.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/crio-options-gates.yaml index 4f585518354a..bb8a0d8f5f57 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/crio-options-gates.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/crio-options-gates.yaml @@ -27,6 +27,7 @@ apiServer: feature-gates: "a=b" controllerManager: extraArgs: + allocate-node-cidrs: "true" feature-gates: "a=b" kube-api-burst: "32" leader-elect: "false" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/crio.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/crio.yaml index 398d16f3c1b3..a42e91136dc7 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/crio.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/crio.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/default.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/default.yaml index e2b302670282..91b45a763714 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/default.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/default.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/dns.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/dns.yaml index fd3676d6d3c6..fc6a78be76a7 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/dns.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/dns.yaml @@ -25,6 +25,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/image-repository.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/image-repository.yaml index b78609482388..079eb13fd2d7 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/image-repository.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/image-repository.yaml @@ -26,6 +26,7 @@ apiServer: enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" controllerManager: extraArgs: + allocate-node-cidrs: "true" leader-elect: "false" scheduler: extraArgs: diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/options.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/options.yaml index 901a09058d78..236e222cc45f 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/options.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/options.yaml @@ -26,6 +26,7 @@ apiServer: fail-no-swap: "true" controllerManager: extraArgs: + allocate-node-cidrs: "true" kube-api-burst: "32" leader-elect: "false" scheduler: diff --git a/pkg/minikube/bootstrapper/bsutil/versions.go b/pkg/minikube/bootstrapper/bsutil/versions.go index 6222380c8d3d..5362fb533985 100644 --- a/pkg/minikube/bootstrapper/bsutil/versions.go +++ b/pkg/minikube/bootstrapper/bsutil/versions.go @@ -39,7 +39,6 @@ func versionIsBetween(version, gte, lte semver.Version) bool { } var versionSpecificOpts = []config.VersionedExtraOption{ - config.NewUnversionedOption(Kubelet, "bootstrap-kubeconfig", "/etc/kubernetes/bootstrap-kubelet.conf"), config.NewUnversionedOption(Kubelet, "config", "/var/lib/kubelet/config.yaml"), config.NewUnversionedOption(Kubelet, "kubeconfig", "/etc/kubernetes/kubelet.conf"), @@ -97,6 +96,14 @@ var versionSpecificOpts = []config.VersionedExtraOption{ }, LessThanOrEqual: semver.MustParse("1.11.1000"), }, + { + Option: config.ExtraOption{ + Component: ControllerManager, + Key: "allocate-node-cidrs", + Value: "true", + }, + GreaterThanOrEqual: semver.MustParse("1.14.0"), + }, { Option: config.ExtraOption{ Component: ControllerManager, diff --git a/pkg/minikube/cni/cni.go b/pkg/minikube/cni/cni.go index bf7ad27cbd91..5c65b1f93932 100644 --- a/pkg/minikube/cni/cni.go +++ b/pkg/minikube/cni/cni.go @@ -109,13 +109,23 @@ func chooseDefault(cc config.ClusterConfig) Manager { return Bridge{cc: cc} } - if len(cc.Nodes) > 1 { - klog.Infof("%d nodes found, recommending kindnet", len(cc.Nodes)) - return KindNet{cc: cc} - } - - klog.Infof("CNI unnecessary in this configuration, recommending no CNI") - return Disabled{} + // Recommending KindNet for single and multi node clusters as well. This comes at a very small + // cost of having one extra KindNet pod running in all control plane node, but provides the + // following benefits: + // - With Disabled CNI, Single node cluster doesn't respect the podCIDR even users ask for it + // via --extra-config=kubeadm.pod-network-cidr=10.244.0.0/16. This results in pods having ips + // like 172.17.0.2. + // + // - Enables KindNet CNI in master in multi node cluster, This solves the network problem + // inside pod for multi node clusters. See https://github.com/kubernetes/minikube/issues/9838. + // + // - Reduces the complexities for reconfiguring the control plane node, in a scenario + // where minikube cluster is created as a single node cluster and more node was added later. + // + // If a --cni flag is explicitly specified we do not do a node length check, this behaviour should + // also be persevered for chooseDefault. + klog.Infof("Recommending kindnet as default CNI", len(cc.Nodes)) + return KindNet{cc: cc} } // manifestPath returns the path to the CNI manifest diff --git a/pkg/minikube/cni/disabled.go b/pkg/minikube/cni/disabled.go index b7dccf60c5d4..0832798fce37 100644 --- a/pkg/minikube/cni/disabled.go +++ b/pkg/minikube/cni/disabled.go @@ -47,5 +47,6 @@ func (c Disabled) Apply(r Runner) error { // CIDR returns the default CIDR used by this CNI func (c Disabled) CIDR() string { - return "" + // Even without any CNI we want our nodes to have spec.PodCIDR set. + return DefaultPodCIDR } From fc10bca4aec2bf7b53357ad93729643db519fd64 Mon Sep 17 00:00:00 2001 From: Sadlil Date: Thu, 10 Dec 2020 18:40:20 +0000 Subject: [PATCH 2/2] Enable KindNet CNI only if multi node is specified --- cmd/minikube/cmd/node_add.go | 5 ++++ cmd/minikube/cmd/start.go | 4 +++ cmd/minikube/cmd/start_flags.go | 1 + pkg/minikube/cni/cni.go | 46 +++++++++++++++++++++------------ pkg/minikube/config/types.go | 1 + 5 files changed, 40 insertions(+), 17 deletions(-) diff --git a/cmd/minikube/cmd/node_add.go b/cmd/minikube/cmd/node_add.go index 5121fb1affe2..08ec538d526a 100644 --- a/cmd/minikube/cmd/node_add.go +++ b/cmd/minikube/cmd/node_add.go @@ -19,6 +19,7 @@ package cmd import ( "github.com/spf13/cobra" "github.com/spf13/viper" + "k8s.io/minikube/pkg/minikube/cni" "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/driver" "k8s.io/minikube/pkg/minikube/exit" @@ -64,6 +65,10 @@ var nodeAddCmd = &cobra.Command{ if viper.GetString(memory) == "" { cc.Memory = 2200 } + + if !cc.MultiNodeRequested || cni.IsDisabled(*cc) { + warnAboutMultiNodeCNI() + } } if err := node.Add(cc, n, false); err != nil { diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index aad4cdc4e4d0..48f9c33fdf3a 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -403,6 +403,10 @@ func warnAboutMultiNode() { out.Step(style.Documentation, "To track progress on multi-node clusters, see https://github.com/kubernetes/minikube/issues/7538.") } +func warnAboutMultiNodeCNI() { + out.WarningT("Cluster was created without any CNI, adding node to it might cause broken network.") +} + func updateDriver(driverName string) { v, err := version.GetSemverVersion() if err != nil { diff --git a/cmd/minikube/cmd/start_flags.go b/cmd/minikube/cmd/start_flags.go index 11d0a4dbb051..3f2d01f80db5 100644 --- a/cmd/minikube/cmd/start_flags.go +++ b/cmd/minikube/cmd/start_flags.go @@ -347,6 +347,7 @@ func generateClusterConfig(cmd *cobra.Command, existing *config.ClusterConfig, k CNI: chosenCNI, NodePort: viper.GetInt(apiServerPort), }, + MultiNodeRequested: viper.GetInt(nodes) > 1, } cc.VerifyComponents = interpretWaitFlag(*cmd) if viper.GetBool(createMount) && driver.IsKIC(drvName) { diff --git a/pkg/minikube/cni/cni.go b/pkg/minikube/cni/cni.go index 5c65b1f93932..c0d2a44b2520 100644 --- a/pkg/minikube/cni/cni.go +++ b/pkg/minikube/cni/cni.go @@ -93,6 +93,21 @@ func New(cc config.ClusterConfig) (Manager, error) { } } +func IsDisabled(cc config.ClusterConfig) bool { + if cc.KubernetesConfig.NetworkPlugin != "" && cc.KubernetesConfig.NetworkPlugin != "cni" { + return true + } + + if cc.KubernetesConfig.CNI == "false" { + return true + } + + if chooseDefault(cc).String() == "Disabled" { + return true + } + return false +} + func chooseDefault(cc config.ClusterConfig) Manager { // For backwards compatibility with older profiles using --enable-default-cni if cc.KubernetesConfig.EnableDefaultCNI { @@ -109,23 +124,20 @@ func chooseDefault(cc config.ClusterConfig) Manager { return Bridge{cc: cc} } - // Recommending KindNet for single and multi node clusters as well. This comes at a very small - // cost of having one extra KindNet pod running in all control plane node, but provides the - // following benefits: - // - With Disabled CNI, Single node cluster doesn't respect the podCIDR even users ask for it - // via --extra-config=kubeadm.pod-network-cidr=10.244.0.0/16. This results in pods having ips - // like 172.17.0.2. - // - // - Enables KindNet CNI in master in multi node cluster, This solves the network problem - // inside pod for multi node clusters. See https://github.com/kubernetes/minikube/issues/9838. - // - // - Reduces the complexities for reconfiguring the control plane node, in a scenario - // where minikube cluster is created as a single node cluster and more node was added later. - // - // If a --cni flag is explicitly specified we do not do a node length check, this behaviour should - // also be persevered for chooseDefault. - klog.Infof("Recommending kindnet as default CNI", len(cc.Nodes)) - return KindNet{cc: cc} + if driver.BareMetal(cc.Driver) { + klog.Infof("Driver %s used, CNI unnecessary in this configuration, recommending no CNI", cc.Driver) + return Disabled{cc: cc} + } + + if len(cc.Nodes) > 1 || cc.MultiNodeRequested { + // Enables KindNet CNI in master in multi node cluster, This solves the network problem + // inside pod for multi node clusters. See https://github.com/kubernetes/minikube/issues/9838. + klog.Infof("%d nodes found, recommending kindnet", len(cc.Nodes)) + return KindNet{cc: cc} + } + + klog.Infof("CNI unnecessary in this configuration, recommending no CNI") + return Disabled{cc: cc} } // manifestPath returns the path to the CNI manifest diff --git a/pkg/minikube/config/types.go b/pkg/minikube/config/types.go index d95e9f7c85f4..8dea98496762 100644 --- a/pkg/minikube/config/types.go +++ b/pkg/minikube/config/types.go @@ -73,6 +73,7 @@ type ClusterConfig struct { StartHostTimeout time.Duration ScheduledStop *ScheduledStopConfig ExposedPorts []string // Only used by the docker and podman driver + MultiNodeRequested bool } // KubernetesConfig contains the parameters used to configure the VM Kubernetes.