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

Omission of --kubernetes-version upgrades cluster to the default version #2570

Closed
jar349 opened this issue Feb 23, 2018 · 27 comments
Closed
Assignees
Labels
kind/documentation Categorizes issue or PR as related to documentation. kind/ux priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.

Comments

@jar349
Copy link

jar349 commented Feb 23, 2018

Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

Please provide the following details:

Environment:
Mac Sierra (10.12.6)

Minikube version (use minikube version):

  • OS (e.g. from /etc/os-release): Buildroot 2017.02
  • VM Driver (e.g. cat ~/.minikube/machines/minikube/config.json | grep DriverName): virtualbox
  • ISO version (e.g. cat ~/.minikube/machines/minikube/config.json | grep -i ISO or minikube ssh cat /etc/VERSION): minikube-v0.23.6.iso

What happened:
minikube upgraded itself from 1.8 to 1.9 when it was stopped and started

What you expected to happen:
don't upgrade

How to reproduce it (as minimally and precisely as possible):

minikube start --kubernetes-version v1.8.0
kubectl version
minikube stop
minikube start
kubectl version
@r2d4
Copy link
Contributor

r2d4 commented Feb 23, 2018

You'll either need to supply the flag everytime or use minikube config set kubernetes-version v1.8.0

@jar349
Copy link
Author

jar349 commented Feb 26, 2018

Thank you for the workarounds. If I start a kube, is it unreasonable to expect that it will stay the same until deleted and re-created, or otherwise explicitly re-configured? If this isn't a bug, I at least consider current behavior to be non-normal.

@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 Jun 3, 2018
@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
/remove-lifecycle stale

@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 Jul 3, 2018
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

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

@utdrmac
Copy link

utdrmac commented May 8, 2019

Agree with @jar349 in that if I launch minikube specifying 1.13.1, then stop, then start it back up, it should NOT auto-upgrade k8s to latest. No other software I have does this behavior; not at least without prompting/asking me first. This is very non-standard behavior and is causing LOTS of problems with out students.

@tace
Copy link

tace commented Aug 17, 2019

I can't believe how stupid feature this is. No sw should ever upgrade itself without explicitly asking it! And user should ask it explicitly, no prompt even is not enough.

@utdrmac
Copy link

utdrmac commented Aug 17, 2019

/reopen
/remove-lifecycle rotten

@k8s-ci-robot
Copy link
Contributor

@utdrmac: You can't reopen an issue/PR unless you authored it or you are a collaborator.

In response to this:

/reopen
/remove-lifecycle rotten

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Aug 17, 2019
@jar349
Copy link
Author

jar349 commented Aug 18, 2019

/reopen
/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot reopened this Aug 18, 2019
@k8s-ci-robot
Copy link
Contributor

@jar349: Reopened this issue.

In response to this:

/reopen
/remove-lifecycle rotten

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@afbjorklund
Copy link
Collaborator

Might as well have opened a new ticket for discussing this, but I suppose we can start over here...

Currently minikube only has one single "start" command, that is used for both create and for start.
This means that there is no way to just start an existing VM, without for instance also upgrading it.

It is going to be hard to change this (minikube start), but we could at least make it opt-out ?
In the future we would also like to add a suspend/resume feature, if possible (with libmachine).

As stated above, the workaround for both vm-driver and kubernetes-version is using config.

@afbjorklund
Copy link
Collaborator

@tace the other ways of installing kubeadm also does this, unless explictly holding the version back:

https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/

apt-get install -y kubelet kubeadm kubectl
apt-mark hold kubelet kubeadm kubectl

So a similar feature ("hold") for minikube could also be an alternative, perhaps ? But probably opt-in.

@jar349
Copy link
Author

jar349 commented Aug 18, 2019

Is there an issue discussing the suspend/resume feature? A quick search for suspend turned up nothing that looked like a discussion or future plans. If you link such an issue here, I feel like we could close this thread for good since future readers can follow that issue.

@afbjorklund
Copy link
Collaborator

We’ve discussed it in the office hours, and in docker-machine context, but I don’t think there is any issue. The bot tended to auto-close them anyway, as you have discovered.

It is an unrelated feature, either way. You can suspend/resume today, but you have to do it from VirtualBox. Tends to happen automatically when it goes to sleep.

@afbjorklund
Copy link
Collaborator

For this issue, I think we could use the Kubernetes version recorded in the profile for re-start. Unless the user has explicitly given a new one?

@jar349
Copy link
Author

jar349 commented Aug 19, 2019

I think we could use the Kubernetes version recorded in the profile for re-start

Sounds reasonable.

Also, a line of output to the effect of: Reusing version 1.x from previous start. Use --kubernetes-version to change would probably clear up some future confusion.

@sharifelgamal sharifelgamal added kind/documentation Categorizes issue or PR as related to documentation. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. labels Aug 20, 2019
@tstromberg
Copy link
Contributor

This behavior is now documented: https://minikube.sigs.k8s.io/docs/reference/configuration/kubernetes/

In a nutshell, if you do not specify --kubernetes-version, minikube will use the default version for that minikube release. minikube will not magically update itself passed that version at a later date.

I agree that this behavior could be rather surprising. I think a good case could be made for making it so that the omission of --kubernetes-version defaults to whatever the configuration previously specified, and printing a warning similar to:

  • Kubernetes v1.16.0 is now available. If you would like to upgrade, specify:
    --kubernetes-version=v1.16.0

Thoughts?

@tstromberg tstromberg changed the title minikube upgrades itself to 1.9 upon restart Omission of --kubernetes-version automatically upgrades a cluster to the default version Sep 20, 2019
@jar349
Copy link
Author

jar349 commented Sep 20, 2019

I think a good case could be made for making it so that the omission of --kubernetes-version defaults to whatever the configuration previously specified, and printing a warning similar to:

Kubernetes v1.16.0 is now available. If you would like to upgrade, specify:
--kubernetes-version=v1.16.0

Yes, I am in favor of this. In my opinion, using an argument to do something is less surprising than doing something unless an argument is passed.

@tstromberg tstromberg changed the title Omission of --kubernetes-version automatically upgrades a cluster to the default version Omission of --kubernetes-version upgrades cluster to the default version Sep 20, 2019
@tstromberg
Copy link
Contributor

Sounds good. Let's commit to doing this.

@nanikjava
Copy link
Contributor

/assign @nanikjava

@nanikjava
Copy link
Contributor

nanikjava commented Oct 31, 2019

Initial investigation

  • Without using the --kubernetes-version flag the code will automatically install/upgrade the current VM to use the specific version declared in the code

    minikube start

  • Using --kubernetes-version flag will install the specific version

  • On existing VM running just 'minikube start' will automatically update kubernetes to the latest version (as specified in the code)

Analysis

  • The UpdateCluster(..) is the central function that drive copying, configuring and installing all the different kubernetes files. This function will always be called whether there is upgrade to kubernetes version or not.

  • The behaviour should be when user specify --kubernetes-version minikube should just install the specified version for both new or existing VM. When the flag is not specified then minikube should just run the VM without doing anything to the installed version of kubernetes

  • Introduce a new flag --upgrade-kubernetes to allow user to automatically update kubernetes if they don't know what is the latest version

@tstromberg
Copy link
Contributor

@nanikjava - Your approach sounds great.

I'd like to personally be able to set minikube config set upgrade-kubernetes true for automatic-updates (preserve old behavior), but I acknowledge that most people want predictability.

@tstromberg
Copy link
Contributor

tstromberg commented Oct 31, 2019

Thought: rather than having two flags which may have a confusing interaction (--kubernetes-version and --upgrade-kubernetes), could we just get by with --kubernetes-version?

  • Leave --kubernetes-version to default as "", which means 'currently deployed version'
  • If an update is available, output a tip to inform the user that they may use --kubernetes-version=<version>
  • If --kubernetes-version is specifically set, upgrade the cluster rather than ignore the argument.

In a future iteration, we could also build upon your work to support:

  • --kubernetes-version=latest
  • --kubernetes-version=stable

@nanikjava
Copy link
Contributor

  • Leave --kubernetes-version to default as "", which means 'currently deployed version'
  • If an update is available, output a tip to inform the user that they may use --kubernetes-version=<version>
  • If --kubernetes-version is specifically set, upgrade the cluster rather than ignore the argument.

Logic sounds good. Will implement it.

@nanikjava
Copy link
Contributor

@nanikjava - Your approach sounds great.

I'd like to personally be able to set minikube config set upgrade-kubernetes true for automatic-updates (preserve old behavior), but I acknowledge that most people want predictability.

It's a good idea to have auto upgrade however I think most minikube user would like to have some sort of control over things that are deployed inside the VM.

@tstromberg
Copy link
Contributor

Closing. This was fixed in v1.6! Thank you @nanikjava

@tstromberg tstromberg removed the triage/discuss Items for discussion label Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/documentation Categorizes issue or PR as related to documentation. kind/ux 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

No branches or pull requests

10 participants