kubernetes / minikube

Run Kubernetes locally
https://minikube.sigs.k8s.io/
Apache License 2.0
29.21k stars 4.87k forks source link

`minikue config set` ignores `--profile` arg #11343

Open ilya-zuyev opened 3 years ago

ilya-zuyev commented 3 years ago

Scenario:

  1. Start two minikube instances - foo and bar
  2. Run minikube -p foo config set <param> <value>
  3. Restart instance bar
  4. Config changes are applied although should be ignored as they were made for foo

We probably should apply config changes only to specified profile, or display a warning that profile is ignored

ilyaz@myhost --- g/minikube ‹master› » m start -p foo 
* [foo] minikube v1.20.0 on Ubuntu 20.10
* Automatically selected the docker driver. Other choices: kvm2, podman, virtualbox, none, ssh
* Starting control plane node foo in cluster foo
* Pulling base image ...
* Downloading Kubernetes v1.20.2 preload ...
    > preloaded-images-k8s-v10-v1...: 491.71 MiB / 491.71 MiB  100.00% 6.02 MiB
    > gcr.io/k8s-minikube/kicbase...: 358.09 MiB / 358.10 MiB  100.00% 4.18 MiB
* Creating docker container (CPUs=2, Memory=8000MB) ...
* Preparing Kubernetes v1.20.2 on Docker 20.10.6 ...
  - Generating certificates and keys ...
  - Booting up control plane ...
  - Configuring RBAC rules ...
* Verifying Kubernetes components...
  - Using image gcr.io/k8s-minikube/storage-provisioner:v5
* Enabled addons: storage-provisioner, default-storageclass

! /home/ilyaz/google-cloud-sdk/bin/kubectl is version 1.17.17-dispatcher, which may have incompatibilites with Kubernetes 1.20.2.
  - Want kubectl v1.20.2? Try 'minikube kubectl -- get pods -A'
* Done! kubectl is now configured to use "foo" cluster and "default" namespace by default

ilyaz@myhost --- g/minikube ‹master› » m start -p bar 
* [bar] minikube v1.20.0 on Ubuntu 20.10
* Automatically selected the docker driver. Other choices: kvm2, podman, virtualbox, none, ssh
* Starting control plane node bar in cluster bar
* Pulling base image ...
* Creating docker container (CPUs=2, Memory=8000MB) ...
* Preparing Kubernetes v1.20.2 on Docker 20.10.6 ...
  - Generating certificates and keys ...
  - Booting up control plane ...
  - Configuring RBAC rules ...
* Verifying Kubernetes components...
  - Using image gcr.io/k8s-minikube/storage-provisioner:v5
* Enabled addons: storage-provisioner, default-storageclass

! /home/ilyaz/google-cloud-sdk/bin/kubectl is version 1.17.17-dispatcher, which may have incompatibilites with Kubernetes 1.20.2.
  - Want kubectl v1.20.2? Try 'minikube kubectl -- get pods -A'
* Done! kubectl is now configured to use "bar" cluster and "default" namespace by default

ilyaz@myhost --- g/minikube ‹master› » m -p foo config set driver virtualbox
! These changes will take effect upon a minikube delete and then a minikube start

ilyaz@myhost --- g/minikube ‹master› » m -p foo stop; m -p bar stop 
* Stopping node "foo"  ...
* Powering off "foo" via SSH ...
* 1 nodes stopped.
* Stopping node "bar"  ...
* Powering off "bar" via SSH ...
* 1 nodes stopped.

ilyaz@myhost --- g/minikube ‹master› » m start -p bar
* [bar] minikube v1.20.0 on Ubuntu 20.10
! Deleting existing cluster bar with different driver docker due to --delete-on-failure flag set by the user. 

! Exiting due to GUEST_DRIVER_MISMATCH: The existing "bar" cluster was created using the "docker" driver, which is incompatible with requested "virtualbox" driver.
* Suggestion: Delete the existing 'bar' cluster using: 'minikube delete -p bar', or start the existing 'bar' cluster using: 'minikube start -p bar --driver=docker'
medyagh commented 3 years ago

yeah this is confusing, good point !

minikube config set is supposed to be global ! I think we should make that clear to the user.

I think since that one is global we should not allow setting "-p " and let user know that is a glboal config for all profiles

dinever commented 3 years ago

/assign

k8s-triage-robot commented 3 years ago

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-contributor-experience at kubernetes/community. /lifecycle stale

k8s-triage-robot commented 3 years ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

spowelljr commented 3 years ago

Hi @dinever, are you still working on this issue?