Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retire Kubernetes v1.10 support, update OldestKubernetesVersion to v1.11 #5342

Merged
merged 1 commit into from
Sep 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions pkg/minikube/bootstrapper/kubeadm/kubeadm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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")) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
`,
Expand Down Expand Up @@ -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

Expand Down

This file was deleted.

This file was deleted.

17 changes: 0 additions & 17 deletions pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/containerd.yaml

This file was deleted.

This file was deleted.

17 changes: 0 additions & 17 deletions pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/crio.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/default.yaml

This file was deleted.

This file was deleted.

21 changes: 0 additions & 21 deletions pkg/minikube/bootstrapper/kubeadm/testdata/v1.10/options.yaml

This file was deleted.

56 changes: 1 addition & 55 deletions pkg/minikube/bootstrapper/kubeadm/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 0 additions & 9 deletions pkg/minikube/bootstrapper/kubeadm/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
36 changes: 1 addition & 35 deletions pkg/minikube/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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"
}
Expand Down
3 changes: 1 addition & 2 deletions site/content/en/docs/Reference/Configuration/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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)

Expand Down