diff --git a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go index 204d04262647..28ec7eb7590c 100644 --- a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go +++ b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go @@ -264,15 +264,6 @@ func (k *Bootstrapper) StartCluster(k8s config.KubernetesConfig) error { return errors.Wrapf(err, "cmd failed: %s\n%s\n", cmd, out) } - if version.LT(semver.MustParse("1.10.0-alpha.0")) { - // TODO(r2d4): get rid of global here - master = k8s.NodeName - - if err := retry.Expo(unmarkMaster, time.Millisecond*500, time.Second*113); err != nil { - return errors.Wrap(err, "timed out waiting to unmark master") - } - } - glog.Infof("Configuring cluster permissions ...") if err := retry.Expo(elevateKubeSystemPrivileges, time.Millisecond*500, 60*time.Second); err != nil { @@ -695,10 +686,7 @@ func generateConfig(k8s config.KubernetesConfig, r cruntime.Manager) ([]byte, er opts.ServiceCIDR = k8s.ServiceCIDR } - if version.GTE(semver.MustParse("1.10.0-alpha.0")) { - opts.NoTaintMaster = true - } - + opts.NoTaintMaster = true b := bytes.Buffer{} configTmpl := configTmplV1Alpha1 if version.GTE(semver.MustParse("1.12.0")) { diff --git a/pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go b/pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go index 0c5152489e45..661ce0a1d2a0 100644 --- a/pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go +++ b/pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go @@ -48,7 +48,7 @@ Wants=docker.socket [Service] ExecStart= -ExecStart=/var/lib/minikube/binaries/v1.10.13/kubelet --allow-privileged=true --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cadvisor-port=0 --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-dns=10.96.0.10 --cluster-domain=cluster.local --container-runtime=docker --fail-swap-on=false --hostname-override=minikube --kubeconfig=/etc/kubernetes/kubelet.conf --pod-manifest-path=/etc/kubernetes/manifests +ExecStart=/var/lib/minikube/binaries/v1.11.10/kubelet --allow-privileged=true --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cadvisor-port=0 --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-dns=10.96.0.10 --cluster-domain=cluster.local --container-runtime=docker --fail-swap-on=false --hostname-override=minikube --kubeconfig=/etc/kubernetes/kubelet.conf --pod-manifest-path=/etc/kubernetes/manifests [Install] `, @@ -186,7 +186,7 @@ func getExtraOptsPodCidr() []config.ExtraOption { func recentReleases() ([]string, error) { // test the 6 most recent releases - versions := []string{"v1.16", "v1.15", "v1.14", "v1.13", "v1.12", "v1.11", "v1.10"} + versions := []string{"v1.16", "v1.15", "v1.14", "v1.13", "v1.12", "v1.11"} foundNewest := false foundDefault := false diff --git a/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/containerd-api-port.yaml b/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/containerd-api-port.yaml deleted file mode 100644 index 877e831b4ba5..000000000000 --- a/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/containerd-api-port.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: kubeadm.k8s.io/v1alpha1 -kind: MasterConfiguration -noTaintMaster: true -api: - advertiseAddress: 1.1.1.1 - bindPort: 12345 - controlPlaneEndpoint: localhost -kubernetesVersion: v1.10.0 -certificatesDir: /var/lib/minikube/certs -networking: - serviceSubnet: 10.96.0.0/12 -etcd: - dataDir: /var/lib/minikube/etcd -nodeName: mk -criSocket: /run/containerd/containerd.sock -apiServerExtraArgs: - admission-control: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" diff --git a/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/containerd-pod-network-cidr.yaml deleted file mode 100644 index 2741f3dfbe9d..000000000000 --- a/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/containerd-pod-network-cidr.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: kubeadm.k8s.io/v1alpha1 -kind: MasterConfiguration -noTaintMaster: true -api: - advertiseAddress: 1.1.1.1 - bindPort: 8443 - controlPlaneEndpoint: localhost -kubernetesVersion: v1.10.0 -certificatesDir: /var/lib/minikube/certs -networking: - serviceSubnet: 10.96.0.0/12 -etcd: - dataDir: /var/lib/minikube/etcd -nodeName: mk -criSocket: /run/containerd/containerd.sock -apiServerExtraArgs: - admission-control: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" diff --git a/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/containerd.yaml b/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/containerd.yaml deleted file mode 100644 index 2741f3dfbe9d..000000000000 --- a/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/containerd.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: kubeadm.k8s.io/v1alpha1 -kind: MasterConfiguration -noTaintMaster: true -api: - advertiseAddress: 1.1.1.1 - bindPort: 8443 - controlPlaneEndpoint: localhost -kubernetesVersion: v1.10.0 -certificatesDir: /var/lib/minikube/certs -networking: - serviceSubnet: 10.96.0.0/12 -etcd: - dataDir: /var/lib/minikube/etcd -nodeName: mk -criSocket: /run/containerd/containerd.sock -apiServerExtraArgs: - admission-control: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" diff --git a/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/crio-options-gates.yaml b/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/crio-options-gates.yaml deleted file mode 100644 index f4f766a14687..000000000000 --- a/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/crio-options-gates.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: kubeadm.k8s.io/v1alpha1 -kind: MasterConfiguration -noTaintMaster: true -api: - advertiseAddress: 1.1.1.1 - bindPort: 8443 - controlPlaneEndpoint: localhost -kubernetesVersion: v1.10.0 -certificatesDir: /var/lib/minikube/certs -networking: - serviceSubnet: 10.96.0.0/12 -etcd: - dataDir: /var/lib/minikube/etcd -nodeName: mk -criSocket: /var/run/crio/crio.sock -apiServerExtraArgs: - admission-control: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" - fail-no-swap: "true" - feature-gates: "a=b" -controllerManagerExtraArgs: - feature-gates: "a=b" - kube-api-burst: "32" -schedulerExtraArgs: - feature-gates: "a=b" - scheduler-name: "mini-scheduler" diff --git a/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/crio.yaml b/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/crio.yaml deleted file mode 100644 index 4f689e42cdee..000000000000 --- a/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/crio.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: kubeadm.k8s.io/v1alpha1 -kind: MasterConfiguration -noTaintMaster: true -api: - advertiseAddress: 1.1.1.1 - bindPort: 8443 - controlPlaneEndpoint: localhost -kubernetesVersion: v1.10.0 -certificatesDir: /var/lib/minikube/certs -networking: - serviceSubnet: 10.96.0.0/12 -etcd: - dataDir: /var/lib/minikube/etcd -nodeName: mk -criSocket: /var/run/crio/crio.sock -apiServerExtraArgs: - admission-control: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" diff --git a/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/default.yaml b/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/default.yaml deleted file mode 100644 index 1db5fb07111f..000000000000 --- a/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/default.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: kubeadm.k8s.io/v1alpha1 -kind: MasterConfiguration -noTaintMaster: true -api: - advertiseAddress: 1.1.1.1 - bindPort: 8443 - controlPlaneEndpoint: localhost -kubernetesVersion: v1.10.0 -certificatesDir: /var/lib/minikube/certs -networking: - serviceSubnet: 10.96.0.0/12 -etcd: - dataDir: /var/lib/minikube/etcd -nodeName: mk -apiServerExtraArgs: - admission-control: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" diff --git a/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/image-repository.yaml b/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/image-repository.yaml deleted file mode 100644 index 077385fcd628..000000000000 --- a/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/image-repository.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: kubeadm.k8s.io/v1alpha1 -kind: MasterConfiguration -noTaintMaster: true -api: - advertiseAddress: 1.1.1.1 - bindPort: 8443 - controlPlaneEndpoint: localhost -kubernetesVersion: v1.10.0 -certificatesDir: /var/lib/minikube/certs -networking: - serviceSubnet: 10.96.0.0/12 -etcd: - dataDir: /var/lib/minikube/etcd -nodeName: mk -imageRepository: test/repo -apiServerExtraArgs: - admission-control: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" diff --git a/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/options.yaml b/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/options.yaml deleted file mode 100644 index d52687fa9452..000000000000 --- a/pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/options.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: kubeadm.k8s.io/v1alpha1 -kind: MasterConfiguration -noTaintMaster: true -api: - advertiseAddress: 1.1.1.1 - bindPort: 8443 - controlPlaneEndpoint: localhost -kubernetesVersion: v1.10.0 -certificatesDir: /var/lib/minikube/certs -networking: - serviceSubnet: 10.96.0.0/12 -etcd: - dataDir: /var/lib/minikube/etcd -nodeName: mk -apiServerExtraArgs: - admission-control: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" - fail-no-swap: "true" -controllerManagerExtraArgs: - kube-api-burst: "32" -schedulerExtraArgs: - scheduler-name: "mini-scheduler" diff --git a/pkg/minikube/bootstrapper/kubeadm/util.go b/pkg/minikube/bootstrapper/kubeadm/util.go index b6c56ad39d2d..95c13d977dcd 100644 --- a/pkg/minikube/bootstrapper/kubeadm/util.go +++ b/pkg/minikube/bootstrapper/kubeadm/util.go @@ -17,76 +17,22 @@ limitations under the License. package kubeadm import ( - "encoding/json" "net" "time" "github.com/golang/glog" "github.com/pkg/errors" - core "k8s.io/api/core/v1" rbac "k8s.io/api/rbac/v1beta1" - apierr "k8s.io/apimachinery/pkg/api/errors" meta "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/strategicpatch" "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/service" "k8s.io/minikube/pkg/util/retry" ) const ( - masterTaint = "node-role.kubernetes.io/master" - rbacName = "minikube-rbac" + rbacName = "minikube-rbac" ) -var master = "" - -func unmarkMaster() error { - k8s := service.K8s - client, err := k8s.GetCoreClient() - if err != nil { - return errors.Wrap(err, "getting core client") - } - n, err := client.Nodes().Get(master, meta.GetOptions{}) - if err != nil { - return errors.Wrapf(err, "getting node %s", master) - } - - oldData, err := json.Marshal(n) - if err != nil { - return errors.Wrap(err, "json marshalling data before patch") - } - - newTaints := []core.Taint{} - for _, taint := range n.Spec.Taints { - if taint.Key == masterTaint { - continue - } - - newTaints = append(newTaints, taint) - } - n.Spec.Taints = newTaints - - newData, err := json.Marshal(n) - if err != nil { - return errors.Wrapf(err, "json marshalling data after patch") - } - - patchBytes, err := strategicpatch.CreateTwoWayMergePatch(oldData, newData, core.Node{}) - if err != nil { - return errors.Wrap(err, "creating strategic patch") - } - - if _, err := client.Nodes().Patch(n.Name, types.StrategicMergePatchType, patchBytes); err != nil { - if apierr.IsConflict(err) { - return errors.Wrap(err, "strategic patch conflict") - } - return errors.Wrap(err, "applying strategic patch") - } - - return nil -} - // elevateKubeSystemPrivileges gives the kube-system service account // cluster admin privileges to work with RBAC. func elevateKubeSystemPrivileges() error { diff --git a/pkg/minikube/bootstrapper/kubeadm/versions.go b/pkg/minikube/bootstrapper/kubeadm/versions.go index c0ac79a56dff..65621dd79d52 100644 --- a/pkg/minikube/bootstrapper/kubeadm/versions.go +++ b/pkg/minikube/bootstrapper/kubeadm/versions.go @@ -226,15 +226,6 @@ var versionSpecificOpts = []config.VersionedExtraOption{ // Cgroup args config.NewUnversionedOption(Kubelet, "cgroup-driver", "cgroupfs"), - { - Option: config.ExtraOption{ - Component: Apiserver, - Key: "admission-control", - Value: strings.Join(util.DefaultLegacyAdmissionControllers, ","), - }, - LessThanOrEqual: semver.MustParse("1.10.1000"), // Semver doesn't support wildcards. - GreaterThanOrEqual: semver.MustParse("1.9.0-alpha.0"), - }, { Option: config.ExtraOption{ Component: Apiserver, diff --git a/pkg/minikube/constants/constants.go b/pkg/minikube/constants/constants.go index 27b4bf685b41..23ac37a44de9 100644 --- a/pkg/minikube/constants/constants.go +++ b/pkg/minikube/constants/constants.go @@ -186,7 +186,7 @@ var DefaultKubernetesVersion = "v1.16.0-beta.1" var NewestKubernetesVersion = "v1.16.0-beta.1" // OldestKubernetesVersion is the oldest Kubernetes version to test against -var OldestKubernetesVersion = "v1.10.13" +var OldestKubernetesVersion = "v1.11.10" // ConfigFile is the path of the config file var ConfigFile = MakeMiniPath("config", "config.json") @@ -263,9 +263,6 @@ func GetKubeadmCachedImages(imageRepository string, kubernetesVersionStr string) v1_13 := semver.MustParseRange(">=1.13.0 <1.14.0") v1_12 := semver.MustParseRange(">=1.12.0 <1.13.0") v1_11 := semver.MustParseRange(">=1.11.0 <1.12.0") - v1_10 := semver.MustParseRange(">=1.10.0 <1.11.0") - v1_9 := semver.MustParseRange(">=1.9.0 <1.10.0") - v1_8 := semver.MustParseRange(">=1.8.0 <1.9.0") v1_12plus := semver.MustParseRange(">=1.12.0") kubernetesVersion, err := semver.Make(strings.TrimPrefix(kubernetesVersionStr, minikubeVersion.VersionPrefix)) @@ -345,37 +342,6 @@ func GetKubeadmCachedImages(imageRepository string, kubernetesVersionStr string) imageRepository + "etcd" + ArchTag(true) + "3.2.18", imageRepository + "coredns:1.1.3", }...) - - } else if v1_10(kubernetesVersion) { - podInfraContainerImage = imageRepository + "pause" + ArchTag(false) + "3.1" - images = append(images, []string{ - podInfraContainerImage, - imageRepository + "k8s-dns-kube-dns" + ArchTag(true) + "1.14.8", - imageRepository + "k8s-dns-dnsmasq-nanny" + ArchTag(true) + "1.14.8", - imageRepository + "k8s-dns-sidecar" + ArchTag(true) + "1.14.8", - imageRepository + "etcd" + ArchTag(true) + "3.1.12", - }...) - - } else if v1_9(kubernetesVersion) { - podInfraContainerImage = imageRepository + "pause" + ArchTag(false) + "3.0" - images = append(images, []string{ - podInfraContainerImage, - imageRepository + "k8s-dns-kube-dns" + ArchTag(true) + "1.14.7", - imageRepository + "k8s-dns-dnsmasq-nanny" + ArchTag(true) + "1.14.7", - imageRepository + "k8s-dns-sidecar" + ArchTag(true) + "1.14.7", - imageRepository + "etcd" + ArchTag(true) + "3.1.10", - }...) - - } else if v1_8(kubernetesVersion) { - podInfraContainerImage = imageRepository + "pause" + ArchTag(false) + "3.0" - images = append(images, []string{ - podInfraContainerImage, - imageRepository + "k8s-dns-kube-dns" + ArchTag(true) + "1.14.5", - imageRepository + "k8s-dns-dnsmasq-nanny" + ArchTag(true) + "1.14.5", - imageRepository + "k8s-dns-sidecar" + ArchTag(true) + "1.14.5", - imageRepository + "etcd" + ArchTag(true) + "3.0.17", - }...) - } else { podInfraContainerImage = imageRepository + "pause" + ArchTag(false) + "3.0" } diff --git a/site/content/en/docs/Reference/Configuration/kubernetes.md b/site/content/en/docs/Reference/Configuration/kubernetes.md index 544ac37f3d79..8c5c57f57156 100644 --- a/site/content/en/docs/Reference/Configuration/kubernetes.md +++ b/site/content/en/docs/Reference/Configuration/kubernetes.md @@ -15,7 +15,7 @@ This flag is repeated, so you can pass it several times with several different v minikube defaults to the latest stable version of Kubernetes. You may select a different Kubernetes release by using the `--kubernetes-version` flag, for example: - `minikube start --kubernetes-version=v1.10.13` + `minikube start --kubernetes-version=v1.11.10` minikube follows the [Kubernetes Version and Version Skew Support Policy](https://kubernetes.io/docs/setup/version-skew-policy/), so we guarantee support for the latest build for the last 3 minor Kubernetes releases. When practical, minikube aims for the the last 6 minor releases so that users can emulate legacy environments. @@ -27,7 +27,6 @@ As of September 2019, this means that minikube supports and actively tests again * v1.13 * v1.12 * v1.11 (best effort) -* v1.10 (best effort) For more up to date information, see `OldestKubernetesVersion` and `NewestKubernetesVersion` in [constants.go](https://github.com/kubernetes/minikube/blob/master/pkg/minikube/constants/constants.go)