Xsky
Xsky

Reputation: 51

Kubernetes v1.20 endpoints resource cannot view controller manger or scheduler

I want to check the election of basic components, but the information displayed is different in different versions of kubernetes binary installation methods.

Is the corresponding information cancelled in kubernetes v1.20 +? Or is there any other way to view the election of basic components?

The following kubernetes configuration parameters are consistent, except that the binary executable file is replaced

Kubernetes v1.20.8 or Kubernetes v1.20.2

$ kubectl get endpoints -n kube-system
No resources found in kube-system namespace.

Kubernetes v1.19.12

$ kubectl get endpoints -n kube-system
NAME                      ENDPOINTS   AGE
kube-controller-manager   <none>      9m12s
kube-scheduler            <none>      9m13s

Upvotes: 0

Views: 444

Answers (1)

Xsky
Xsky

Reputation: 51

I found the cause of the problem

The difference between the two versions is the default value of --leader-select resource-lock

Kubernetes v1.20.8 or Kubernetes v1.20.2

--leader-elect-resource-lock string        The type of resource object that is used for locking during leader election. Supported options are 'endpoints', 'configmaps', 'leases', 'endpointsleases' and 'configmapsleases'. (default "leases")

Kubernetes v1.19.12

--leader-elect-resource-lock string        The type of resource object that is used for locking during leader election. Supported options are 'endpoints', 'configmaps', 'leases', 'endpointsleases' and 'configmapsleases'. (default "endpointsleases")

When I don't set --leader-select-resource-lock string in controller-manager or scheduler in v1.20.8, the default value is leaders.

so I can use the following command to view the information of component leaders.

$ kubectl get leases -n kube-system
NAME                      HOLDER                                                      AGE
kube-controller-manager   master01_dec12376-f89e-4721-92c5-a20267a483b8   45h
kube-scheduler            master02_c0c373aa-1642-474d-9dbd-ec41c4da089d   45h

Upvotes: 3

Related Questions