kops icon indicating copy to clipboard operation
kops copied to clipboard

kube controller manager keeps crashing because of a cyclic dependency with dns-controller on a cluster with metrics api servers enabled

Open kumudt opened this issue 8 years ago • 12 comments

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

kumudt avatar Sep 06 '18 10:09 kumudt

@justinsb Any inputs on this?

kumudt avatar Sep 07 '18 08:09 kumudt

This happens only when the registered apiservice is not implemented / or is unreachable. Closing this for now.

kumudt avatar Sep 09 '18 11:09 kumudt

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)

kumudt avatar Sep 09 '18 20:09 kumudt

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.

tsuna avatar Sep 26 '18 07:09 tsuna

Should this apiservice get recreated somehow after applying the workaround?

tsuna avatar Sep 26 '18 08:09 tsuna

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

fejta-bot avatar Dec 25 '18 08:12 fejta-bot

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

fejta-bot avatar Jan 24 '19 09:01 fejta-bot

/remove-lifecycle rotten

tsuna avatar Jan 24 '19 16:01 tsuna

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

fejta-bot avatar Apr 29 '19 10:04 fejta-bot

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

fejta-bot avatar May 29 '19 11:05 fejta-bot

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 avatar Jun 28 '19 12:06 fejta-bot

@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.

k8s-ci-robot avatar Jun 28 '19 12:06 k8s-ci-robot