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

Created on 14 May 2018  ·  6Comments  ·  Source: kubernetes/minikube

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 ?

kinbug lifecyclrotten omacos

All 6 comments

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

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

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.

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

Dupe of #2281

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

Was this page helpful?
0 / 5 - 0 ratings