Last active
July 1, 2023 06:04
-
-
Save mshafiee/5e3e7b08aaf27f580797b363b4a61922 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Problem Description: | |
How to resolve scheduler and controller-manager unhealthy state in Kubernetes | |
# Symptom: | |
$ kubectl get cs / kubectl get componentstatuses | |
Warning: v1 ComponentStatus is deprecated in v1.19+ | |
NAME STATUS MESSAGE ERROR | |
controller-manager Unhealthy Get "http://127.0.0.1:10252/healthz": dial tcp 127.0.0.1:10252: connect: connection refused | |
scheduler Unhealthy Get "http://127.0.0.1:10251/healthz": dial tcp 127.0.0.1:10251: connect: connection refused | |
etcd-0 Healthy {"health":"true"} | |
# Solution: | |
Modify the following files on all master nodes: | |
$ sudo vi /etc/kubernetes/manifests/kube-scheduler.yaml | |
Clear the line (spec->containers->command) containing this phrase: - --port=0 | |
$ sudo vi /etc/kubernetes/manifests/kube-controller-manager.yaml | |
Clear the line (spec->containers->command) containing this phrase: - --port=0 | |
$ sudo systemctl restart kubelet.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks! This really saves my time!