0
0
Kubernetesdevops~5 mins

Control plane components (API server, scheduler, controller manager, etcd) in Kubernetes - Commands & Configuration

Choose your learning style9 modes available
Introduction
Kubernetes control plane components manage the cluster's state and operations. They ensure your applications run smoothly by controlling scheduling, state storage, and responding to changes.
When you want to understand how Kubernetes manages your app deployments behind the scenes
When you need to troubleshoot why a pod is not starting or scheduling
When you want to monitor or secure the cluster's core services
When you plan to set up a highly available Kubernetes cluster
When you want to backup or restore the cluster state stored in etcd
Commands
This command checks the health of the main control plane components like the API server, scheduler, and controller manager.
Terminal
kubectl get componentstatuses
Expected OutputExpected
NAME STATUS MESSAGE ERROR scheduler Healthy ok controller-manager Healthy ok apiserver Healthy ok
This command lists the API server pods running in the kube-system namespace to verify they are running.
Terminal
kubectl get pods -n kube-system -l component=kube-apiserver
Expected OutputExpected
NAME READY STATUS RESTARTS AGE kube-apiserver-master-1 1/1 Running 0 10m
-n - Specifies the namespace to look in
-l - Filters pods by label
This command lists the scheduler pods to confirm the scheduler is active.
Terminal
kubectl get pods -n kube-system -l component=kube-scheduler
Expected OutputExpected
NAME READY STATUS RESTARTS AGE kube-scheduler-master-1 1/1 Running 0 10m
-n - Specifies the namespace to look in
-l - Filters pods by label
This command lists the controller manager pods to verify they are running.
Terminal
kubectl get pods -n kube-system -l component=kube-controller-manager
Expected OutputExpected
NAME READY STATUS RESTARTS AGE kube-controller-manager-master-1 1/1 Running 0 10m
-n - Specifies the namespace to look in
-l - Filters pods by label
This command lists the etcd pods which store the cluster's state data.
Terminal
kubectl get pods -n kube-system -l component=etcd
Expected OutputExpected
NAME READY STATUS RESTARTS AGE etcd-master-1 1/1 Running 0 10m
-n - Specifies the namespace to look in
-l - Filters pods by label
Key Concept

If you remember nothing else from this pattern, remember: the control plane components work together to keep your Kubernetes cluster healthy and running by managing state, scheduling, and responding to changes.

Common Mistakes
Trying to check control plane health without specifying the kube-system namespace
Control plane components run in the kube-system namespace, so commands without this context may show no results or errors.
Always include '-n kube-system' when querying control plane pods.
Assuming control plane components are normal pods you can delete or restart like app pods
Control plane components are critical; deleting them without proper procedure can cause cluster downtime.
Use proper cluster management tools or procedures to manage control plane components.
Ignoring the output of 'kubectl get componentstatuses' because it looks technical
This command quickly shows if core components are healthy, ignoring it can delay troubleshooting.
Regularly check component statuses to catch issues early.
Summary
Use 'kubectl get componentstatuses' to check the health of control plane components.
List control plane pods in the kube-system namespace with label selectors to verify they are running.
Control plane components include the API server, scheduler, controller manager, and etcd, which together manage cluster state and scheduling.