BUG_REPORT
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):
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 ?
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.ymlkube-dns-controller.ymlkube-dns-svc/etc/kubernetes/addonsHowever 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