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

can't disable kube-dns: error disabling addon deploy/addons/kube-dns/kube-dns-controller.yaml #2808

Closed
den-is opened this issue May 14, 2018 · 6 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. os/macos

Comments

@den-is
Copy link

den-is commented May 14, 2018

BUG_REPORT

  • minikube version: v0.26.1
  • macos 10.13.4
  • virtualbox
  • "Boot2DockerURL": "file:///Users/den/.minikube/cache/iso/minikube-v0.26.0.iso"

I'm trying to start minikube with coredns enabled and kube-dns disabled by default to replicate my production cluster.
First of all I've tried to disable kube-dns on already running minikube instance. And got error from bellow.

What happened:

❯ minikube addons disable kube-dns
[error disabling addon deploy/addons/kube-dns/kube-dns-controller.yaml: %!s(MISSING): Process exited with status 1]

What you expected to happen:
disable kube-dns and use coredns instead

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

  • get minikube v0.26.1
  • minikube start
  • minikube addons disable kube-dns

After that i've tryed to setup minikube using its configuration in ~/.minikube/config/config.json.

{
    "kube-dns": false,
    "coredns": true
}

minikube addons list shows appropriate addons as disabled/enabled

❯ minikube addons list
- addon-manager: enabled
- coredns: enabled
- dashboard: enabled
- default-storageclass: enabled
- efk: disabled
- freshpod: disabled
- heapster: disabled
- ingress: disabled
- kube-dns: disabled
- metrics-server: disabled
- registry: disabled
- registry-creds: disabled
- storage-provisioner: enabled

But when cluster still has kube-dns enabled and running:

❯ kubectl get deploy -n kube-system
NAME                   DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
coredns                1         1         1            1           3h
kube-dns               1         1         1            1           3h
kubernetes-dashboard   1         1         1            1           3h

❯ kubectl get po -l k8s-app=kube-dns -n kube-system
NAME                        READY     STATUS    RESTARTS   AGE
coredns-74585495ff-xmvg5    1/1       Running   0          4h
kube-dns-86f4d74b45-h9wvx   3/3       Running   0          4h

If there is way to completely disable kube-dns and run with coredns from very start ?

@den-is
Copy link
Author

den-is commented May 15, 2018

Just to clarify.
After starting minikube with config file which disables kube-dns and enables coredns.
One last step required to get rid of kube-dns:

kubectl -n kube-system delete deployment kube-dns

@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 13, 2018
@rbierman
Copy link

I've done some digging as I was running in the exact same problem with version: v0.28.2

It seems like the minikube addons disable kube-dns command tries to remove the following files:

  • kube-dns-cm.yml
  • kube-dns-controller.yml
  • kube-dns-svc
    from the default addons path: /etc/kubernetes/addons

However after running: minikube start in a clean environment (No ~/.minikube) these files aren't there. This causes a non 0 exit status on the rm command which results in the error disabling addon... message.

So far I haven't figured out why these files aren't there while the add-on is enabled. @den-is 's workaround works but it's hard to script and shouldn't be required.

@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 14, 2018
@tstromberg
Copy link
Contributor

Dupe of #2281

@marxangels
Copy link

minikube stop
vi ~/.minikube/config/config.json # change some flag from true to false
minikube start

# then delete relative resources manually
kubectl -n xxx delete xxx xxx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. os/macos
Projects
None yet
Development

No branches or pull requests

6 participants