kube controller manager keeps crashing because of a cyclic dependency with dns-controller on a cluster with metrics api servers enabled
1. What kops version are you running? The command kops version, will display
this information.
1.10.0
2. What Kubernetes version are you running? kubectl version will print the
version if a cluster is running or provide the Kubernetes version specified as
a kops flag.
1.10.7 (Single master)
3. What cloud provider are you using?
AWS
4. What commands did you run? What is the simplest way to reproduce this issue?
I did a rolling-update and the master never came up. This is exactly what has happened in my case.
5. What happened after the commands executed?
kube-controller-manager never became healthy
6. What did you expect to happen? rolling-update should have handled these race conditions.
These are the logs in the kube-controller-manager just before it crashes.
F0906 10:28:27.782050 1 controllermanager.go:164] error starting controllers: failed to discover resources: unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: an error on the server ("Internal Server Error: \"/apis/custom.metrics.k8s.io/v1beta1\": Post https://100.64.0.1:443/apis/authorization.k8s.io/v1beta1/subjectaccessreviews: dial tcp 100.64.0.1:443: connect: no route to host") has prevented the request from succeeding, external.metrics.k8s.io/v1beta1: an error on the server ("Internal Server Error: \"/apis/external.metrics.k8s.io/v1beta1\": Post https://100.64.0.1:443/apis/authorization.k8s.io/v1beta1/subjectaccessreviews: dial tcp 100.64.0.1:443: connect: no route to host") has prevented the request from succeeding, metrics.k8s.io/v1beta1: an error on the server ("Internal Server Error: \"/apis/metrics.k8s.io/v1beta1\": Post https://100.64.0.1:443/apis/authorization.k8s.io/v1beta1/subjectaccessreviews: dial tcp 100.64.0.1:443: getsockopt: no route to host") has prevented the request from succeeding
@justinsb Any inputs on this?
This happens only when the registered apiservice is not implemented / or is unreachable. Closing this for now.
This is actually happening again. I don't think it has anything do with kube api-server being slow.
The issue is getting fixed when the external and internal cluster dns records (cluster api server dns record) are updated to the correct ips (of the new master). Once this is done manually, then the controller-manager is getting healed. Until then, it keeps crashing with the same log.
F0906 10:28:27.782050 1 controllermanager.go:164] error starting controllers: failed to discover resources: unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: an error on the server ("Internal Server Error: \"/apis/custom.metrics.k8s.io/v1beta1\": Post https://100.64.0.1:443/apis/authorization.k8s.io/v1beta1/subjectaccessreviews: dial tcp 100.64.0.1:443: connect: no route to host") has prevented the request from succeeding, external.metrics.k8s.io/v1beta1: an error on the server ("Internal Server Error: \"/apis/external.metrics.k8s.io/v1beta1\": Post https://100.64.0.1:443/apis/authorization.k8s.io/v1beta1/subjectaccessreviews: dial tcp 100.64.0.1:443: connect: no route to host") has prevented the request from succeeding, metrics.k8s.io/v1beta1: an error on the server ("Internal Server Error: \"/apis/metrics.k8s.io/v1beta1\": Post https://100.64.0.1:443/apis/authorization.k8s.io/v1beta1/subjectaccessreviews: dial tcp 100.64.0.1:443: getsockopt: no route to host") has prevented the request from succeeding
The job of updating these DNS records is with dns-controller which will not be scheduled until kube-controller-manager is healthy (cyclic)
Just in case anyone else lands here after upgrading to kope.io/k8s-1.9-debian-stretch-amd64-hvm-ebs-2018-08-17, the workaround is to SSH into the master and kubectl delete apiservice v1beta1.metrics.k8s.io — after a minute or two you should see kube-controller-manager come up happy.
Should this apiservice get recreated somehow after applying the workaround?
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
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 rotten
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
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
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
@fejta-bot: Closing this issue.
In response to this:
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
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.