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

Warn if incompatible kubectl version is in use #3329

Closed
tstromberg opened this issue Nov 12, 2018 · 8 comments · Fixed by #5596
Closed

Warn if incompatible kubectl version is in use #3329

tstromberg opened this issue Nov 12, 2018 · 8 comments · Fixed by #5596
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.

Comments

@tstromberg
Copy link
Contributor

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

@tstromberg tstromberg added the kind/bug Categorizes issue or PR as related to a bug. label Dec 4, 2018
@tstromberg tstromberg added priority/backlog Higher priority than priority/awaiting-more-evidence. kind/feature Categorizes issue or PR as related to a new feature. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. and removed kind/bug Categorizes issue or PR as related to a bug. labels Jan 23, 2019
@tstromberg tstromberg changed the title Warn if unsupported kubectl version is in use Warn if incompatible kubectl version is in use Apr 5, 2019
@tstromberg tstromberg added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed priority/backlog Higher priority than priority/awaiting-more-evidence. labels Apr 5, 2019
@tstromberg tstromberg added this to the v1.1.0-candidate milestone Apr 16, 2019
@tstromberg tstromberg removed this from the v1.1.0 milestone May 1, 2019
@tstromberg tstromberg added priority/backlog Higher priority than priority/awaiting-more-evidence. r/2019q2 Issue was last reviewed 2019q2 and removed priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels May 22, 2019
@fejta-bot
Copy link

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

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 20, 2019
@fejta-bot
Copy link

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

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 19, 2019
@tstromberg tstromberg added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/backlog Higher priority than priority/awaiting-more-evidence. r/2019q2 Issue was last reviewed 2019q2 labels Sep 25, 2019
@tstromberg
Copy link
Contributor Author

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 use minikube kubectlto connect to your cluster

@nanikjava
Copy link
Contributor

Assigning this ticket to myself

@nanikjava
Copy link
Contributor

/assign @nanikjava

@tstromberg
Copy link
Contributor Author

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

@nanikjava
Copy link
Contributor

nanikjava commented Oct 11, 2019

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"
  }
}

nanikjava added a commit to nanikjava/minikube-1 that referenced this issue Oct 11, 2019
Fixes: kubernetes#3329

Modification is done inside start.go where additional checking on the
version returned via the kubectl CLI is checked.

Running 'kubectl version --output=json' will return both client
and server information.
@nanikjava
Copy link
Contributor

nanikjava commented Oct 11, 2019

@tstromberg PR ready #5596

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants