<p>i've finished setting up my HA k8s cluster using kubeadm.
Everything seems to be working fine, but after checking with the command <strong>kubectl get componentstatus</strong> I get:</p>
<pre><code>NAME                 STATUS      MESSAGE
scheduler            Unhealthy   Get http://127.0.0.1:10251/healthz: dial tcp 12
controller-manager   Unhealthy   Get http://127.0.0.1:10252/healthz: dial tcp 12
etcd-0               Healthy     {&quot;health&quot;:&quot;true&quot;}
etcd-2               Healthy     {&quot;health&quot;:&quot;true&quot;}
etcd-1               Healthy     {&quot;health&quot;:&quot;true&quot;}
</code></pre>
<p>I see that manifests for scheduler and controller have other ports set up for the health check:</p>
<p><strong>kube-scheduler.yaml</strong></p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    component: kube-scheduler
    tier: control-plane
  name: kube-scheduler
  namespace: kube-system
spec:
  containers:
  - command:
    - kube-scheduler
    - --authentication-kubeconfig=/etc/kubernetes/scheduler.conf
    - --authorization-kubeconfig=/etc/kubernetes/scheduler.conf
    - --bind-address=127.0.0.1
    - --kubeconfig=/etc/kubernetes/scheduler.conf
    - --leader-elect=true
    - --port=0
    image: k8s.gcr.io/kube-scheduler:v1.18.6
    imagePullPolicy: IfNotPresent
    livenessProbe:
      failureThreshold: 8
      httpGet:
        host: 127.0.0.1
        path: /healthz
        port: 10259
        scheme: HTTPS
      initialDelaySeconds: 15
      timeoutSeconds: 15
    name: kube-scheduler
    resources:
      requests:
        cpu: 100m
    volumeMounts:
    - mountPath: /etc/kubernetes/scheduler.conf
      name: kubeconfig
      readOnly: true
  hostNetwork: true
  priorityClassName: system-cluster-critical
  volumes:
  - hostPath:
      path: /etc/kubernetes/scheduler.conf
      type: FileOrCreate
    name: kubeconfig
status: {}
</code></pre>
<p><strong>kube-controller-manager.yaml</strong></p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    component: kube-controller-manager
    tier: control-plane
  name: kube-controller-manager
  namespace: kube-system
spec:
  containers:
  - command:
    - kube-controller-manager
    - --allocate-node-cidrs=true
    - --authentication-kubeconfig=/etc/kubernetes/controller-manager.conf
    - --authorization-kubeconfig=/etc/kubernetes/controller-manager.conf
    - --bind-address=127.0.0.1
    - --client-ca-file=/etc/kubernetes/pki/ca.crt
    - --cluster-cidr=10.244.0.0/16
    - --cluster-name=kubernetes
    - --cluster-signing-cert-file=/etc/kubernetes/pki/ca.crt
    - --cluster-signing-key-file=/etc/kubernetes/pki/ca.key
    - --controllers=*,bootstrapsigner,tokencleaner
    - --kubeconfig=/etc/kubernetes/controller-manager.conf
    - --leader-elect=true
    - --node-cidr-mask-size=24
    - --port=0
    - --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt
    - --root-ca-file=/etc/kubernetes/pki/ca.crt
    - --service-account-private-key-file=/etc/kubernetes/pki/sa.key
    - --service-cluster-ip-range=10.96.0.0/12
    - --use-service-account-credentials=true
    image: k8s.gcr.io/kube-controller-manager:v1.18.6
    imagePullPolicy: IfNotPresent
    livenessProbe:
      failureThreshold: 8
      httpGet:
        host: 127.0.0.1
        path: /healthz
        port: 10257
        scheme: HTTPS
      initialDelaySeconds: 15
      timeoutSeconds: 15
    name: kube-controller-manager
    resources:
      requests:
        cpu: 200m
    volumeMounts:
    - mountPath: /etc/ssl/certs
      name: ca-certs
      readOnly: true
    - mountPath: /etc/pki
      name: etc-pki
      readOnly: true
    - mountPath: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
      name: flexvolume-dir
    - mountPath: /etc/kubernetes/pki
      name: k8s-certs
      readOnly: true
    - mountPath: /etc/kubernetes/controller-manager.conf
      name: kubeconfig
      readOnly: true
  hostNetwork: true
  priorityClassName: system-cluster-critical
  volumes:
  - hostPath:
      path: /etc/ssl/certs
      type: DirectoryOrCreate
    name: ca-certs
  - hostPath:
      path: /etc/pki
      type: DirectoryOrCreate
    name: etc-pki
  - hostPath:
      path: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
      type: DirectoryOrCreate
    name: flexvolume-dir
  - hostPath:
      path: /etc/kubernetes/pki
      type: DirectoryOrCreate
    name: k8s-certs
  - hostPath:
      path: /etc/kubernetes/controller-manager.conf
      type: FileOrCreate
    name: kubeconfig
status: {}
</code></pre>
<p>So these are using ports 10259 and 10257 respectively.
Any idea why is kubectl trying to perform health check using 10251 and 10252?</p>
<p>version:</p>
<pre><code>kubectl version 
Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;18&quot;, GitVersion:&quot;v1.18.6&quot;, GitCommit:&quot;dff82dc0de47299ab66c83c626e08b245ab19037&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-07-15T16:58:53Z&quot;, GoVersion:&quot;go1.13.9&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;} 
Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;18&quot;, GitVersion:&quot;v1.18.6&quot;, GitCommit:&quot;dff82dc0de47299ab66c83c626e08b245ab19037&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-07-15T16:51:04Z&quot;, GoVersion:&quot;go1.13.9&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
</code></pre>
<p>PS: I am able to make deployments and expose services, no problem there.</p>

MarceloPrego
<p>This is a known issue which unfortunately is not going to be fixed as the feature is <a href="https://github.com/kubernetes/enhancements/issues/553#issuecomment-529591505" rel="noreferrer">planned to be deprecated</a>. Also, see this <a href="https://github.com/Azure/AKS/issues/173#issuecomment-664430043" rel="noreferrer">source</a>:</p>
<blockquote>
<p>I wouldn't expect a change for this issue. Upstream Kubernetes wants
to deprecate component status and does not plan on enhancing it. If
you need to check for cluster health using other monitoring sources is
recommended.</p>
<p><a href="https://github.com/kubernetes/kubernetes/pull/93171" rel="noreferrer">kubernetes/kubernetes#93171</a> - 'fix component status server address'
which is getting recommendation to close due to deprecation talk.</p>
<p><a href="https://github.com/kubernetes/enhancements/issues/553" rel="noreferrer">kubernetes/enhancements#553</a> - Deprecate ComponentStatus</p>
<p><a href="https://github.com/kubernetes/kubeadm/issues/2222" rel="noreferrer">kubernetes/kubeadm#2222</a> - kubeadm default init and they are looking to
'start printing a warning in kubect get componentstatus that this API
object is no longer supported and there are plans to remove it.'</p>
</blockquote>
