Minikube: Warn if incompatible kubectl version is in use

Created on 13 Nov 2018  路  8Comments  路  Source: kubernetes/minikube

Currently, it's possible to use minikube on a host running v1.6.1 against a master running v1.12.1. This isn't a supported configuration, as per https://github.com/kubernetes/community/blob/master/contributors/design-proposals/release/versioning.md#supported-releases-and-component-skew

We should have a flight check that validates that ancient version of kubectl aren't in use. This would also serve as an early warning to users about issues such as #3203

good first issue help wanted kinfeature prioritimportant-longterm

All 8 comments

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

If someone wants to implement this:

  • showKubectlConnectInfo in cmd/minikube/cmd/start.go might be the right place to start
  • kubectl version --client -o json will return an easily JSON blob containing the current version of the kubectl client.
  • If clientVersion is more than one minor release away from k8sVersion, issue a warning, like:

out.WarningT("The version of kubectl [{{.kcVersion}}] installed is incompatible with your Kubernetes [{{.k8sVersion}}] deployment"). Please upgrade/downgrade as necessary, or useminikube kubectlto connect to your cluster

Assigning this ticket to myself

/assign @nanikjava

@nanikjava - excellent news! Please let me know if you need any additional help, either here or on the Slack #minikube channel.

Output from 'kubectl version --output=json' is applicable for all version of kubectl.

Following is a sample output

{
  "clientVersion": {
    "major": "1",
    "minor": "12",
    "gitVersion": "v1.12.0",
    "gitCommit": "0ed33881dc4355495f623c6f22e7dd0b7632b7c0",
    "gitTreeState": "clean",
    "buildDate": "2018-09-27T17:05:32Z",
    "goVersion": "go1.10.4",
    "compiler": "gc",
    "platform": "linux/amd64"
  },
  "serverVersion": {
    "major": "1",
    "minor": "16",
    "gitVersion": "v1.16.0",
    "gitCommit": "2bd9643cee5b3b3a5ecbd3af49d09018f0773c77",
    "gitTreeState": "clean",
    "buildDate": "2019-09-18T14:27:17Z",
    "goVersion": "go1.12.9",
    "compiler": "gc",
    "platform": "linux/amd64"
  }
}

@tstromberg PR ready https://github.com/kubernetes/minikube/pull/5596

Thank you.

Was this page helpful?
0 / 5 - 0 ratings