{"id":1136,"date":"2020-12-09T07:12:34","date_gmt":"2020-12-09T07:12:34","guid":{"rendered":"https:\/\/blog.samarthya.me\/wps\/?p=1136"},"modified":"2020-12-09T07:13:37","modified_gmt":"2020-12-09T07:13:37","slug":"controller-manager-unhealthy","status":"publish","type":"post","link":"https:\/\/blog.samarthya.me\/wps\/2020\/12\/09\/controller-manager-unhealthy\/","title":{"rendered":"controller-manager   #Unhealthy"},"content":{"rendered":"\n<p>In my K8S cluster when I was looking at component status I was observing an error.<\/p>\n\n\n\n<p>Please note <code>componentstatus<\/code> is deprecated in 1.19+ but the steps will still at least help out the OCD&#8217;s like me.<\/p>\n\n\n\n<figure class=\"wp-block-pullquote has-background has-luminous-vivid-orange-background-color is-style-solid-color\"><blockquote class=\"has-text-color has-white-color\"><p>alias k=kubectl<\/p><cite>my way of working! <\/cite><\/blockquote><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>root@master>k version\nClient Version: version.Info{Major:\"1\", Minor:\"19\", GitVersion:\"v1.19.4\", GitCommit:\"d360454c9bcd1634cf4cc52d1867af5491dc9c5f\", GitTreeState:\"clean\", BuildDate:\"2020-11-11T13:17:17Z\", GoVersion:\"go1.15.2\", Compiler:\"gc\", Platform:\"linux\/amd64\"}\nServer Version: version.Info{Major:\"1\", Minor:\"19\", GitVersion:\"v1.19.3\", GitCommit:\"1e11e4a2108024935ecfcb2912226cedeafd99df\", GitTreeState:\"clean\", BuildDate:\"2020-10-14T12:41:49Z\", GoVersion:\"go1.15.2\", Compiler:\"gc\", Platform:\"linux\/amd64\"}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>> k get cs\n\nNAME                 STATUS      MESSAGE                                                                                       ERROR\ncontroller-manager   Unhealthy   Get \"http:\/\/127.0.0.1:10252\/healthz\": dial tcp 127.0.0.1:10252: connect: connection refused   \nscheduler            Unhealthy   Get \"http:\/\/127.0.0.1:10251\/healthz\": dial tcp 127.0.0.1:10251: connect: connection refused   \netcd-0               Healthy     {\"health\":\"true\"}                                                                          <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How to remove<\/h2>\n\n\n\n<p>I simply commented out the following <code>port<\/code> in the configuration yamls.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@master>vi \/etc\/kubernetes\/manifests\/kube-controller-manager.yaml <\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>piVersion: v1\nkind: Pod\nmetadata:\n  creationTimestamp: null\n  labels:\n    component: kube-controller-manager\n    tier: control-plane\n  name: kube-controller-manager\n  namespace: kube-system\nspec:\n  containers:\n  - command:\n    - kube-controller-manager\n    - --allocate-node-cidrs=true\n    - --authentication-kubeconfig=\/etc\/kubernetes\/controller-manager.conf\n    - --authorization-kubeconfig=\/etc\/kubernetes\/controller-manager.conf\n    - --bind-address=127.0.0.1\n    - --client-ca-file=\/etc\/kubernetes\/pki\/ca.crt\n    - --cluster-cidr=192.168.0.0\/16\n    - --cluster-name=kubernetes\n    - --cluster-signing-cert-file=\/etc\/kubernetes\/pki\/ca.crt\n    - --cluster-signing-key-file=\/etc\/kubernetes\/pki\/ca.key\n    - --controllers=*,bootstrapsigner,tokencleaner\n    - --kubeconfig=\/etc\/kubernetes\/controller-manager.conf\n    - --leader-elect=true\n    - --node-cidr-mask-size=24\n    #- --port=0 &lt;- This line commented<\/code><\/pre>\n\n\n\n<p>and<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@master>vi \/etc\/kubernetes\/manifests\/kube-scheduler.yaml<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>apiVersion: v1\nkind: Pod\nmetadata:\n  creationTimestamp: null\n  labels:\n    component: kube-scheduler\n    tier: control-plane\n  name: kube-scheduler\n  namespace: kube-system\nspec:\n  containers:\n  - command:\n    - kube-scheduler\n    - --authentication-kubeconfig=\/etc\/kubernetes\/scheduler.conf\n    - --authorization-kubeconfig=\/etc\/kubernetes\/scheduler.conf\n    - --bind-address=127.0.0.1\n    - --kubeconfig=\/etc\/kubernetes\/scheduler.conf\n    - --leader-elect=true\n    #- --port=0 &lt;- Commented<\/code><\/pre>\n\n\n\n<p>restart the <code>kubelet<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@master>systemctl restart kubelet<\/code><\/pre>\n\n\n\n<p>then time to check the <code>componentstatus<\/code> again<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>> k get cs\nNAME                 STATUS    MESSAGE             ERROR\ncontroller-manager   Healthy   ok                  \nscheduler            Healthy   ok                  \netcd-0               Healthy   {\"health\":\"true\"}   <\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my K8S cluster when I was looking at component status I was observing an error. Please note componentstatus is deprecated in 1.19+ but the steps will still at least help out the OCD&#8217;s like me. alias k=kubectl my way of working! How to remove I simply commented out the following port in the configuration [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1138,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1136","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-technical","post_format-post-format-image"],"_links":{"self":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts\/1136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/comments?post=1136"}],"version-history":[{"count":0,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts\/1136\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/media\/1138"}],"wp:attachment":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/media?parent=1136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/categories?post=1136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/tags?post=1136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}