Bird
Raised Fist0
Kubernetesdevops~5 mins

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

Choose your learning style10 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.

Practice

(1/5)
1. Which component of the Kubernetes control plane acts as the main entry point for all REST commands and handles communication with the cluster?
easy
A. etcd
B. Scheduler
C. API server
D. Controller manager

Solution

  1. Step 1: Understand the role of the API server

    The API server is the front door of the Kubernetes control plane. It receives REST requests and processes them.
  2. Step 2: Compare with other components

    The scheduler assigns pods to nodes, the controller manager runs controllers, and etcd stores cluster data. None handle REST communication directly.
  3. Final Answer:

    API server -> Option C
  4. Quick Check:

    API server = main REST entry point [OK]
Hint: API server handles all REST requests to the cluster [OK]
Common Mistakes:
  • Confusing scheduler with API server
  • Thinking controller manager handles REST calls
  • Assuming etcd processes API requests
2. Which of the following is the correct command to check the status of the Kubernetes scheduler component?
easy
A. kubectl get pods -n kube-system | grep scheduler
B. kubectl get nodes --show-scheduler
C. kubectl describe scheduler
D. kubectl get scheduler-status

Solution

  1. Step 1: Identify how to check scheduler status

    The scheduler runs as a pod in the kube-system namespace, so checking pods there helps find it.
  2. Step 2: Analyze each command

    kubectl get pods -n kube-system | grep scheduler lists pods in kube-system and filters for scheduler, which is correct. The other commands are invalid kubectl commands or do not exist.
  3. Final Answer:

    kubectl get pods -n kube-system | grep scheduler -> Option A
  4. Quick Check:

    Scheduler runs as pod, check pods in kube-system [OK]
Hint: Scheduler runs as pod; check pods in kube-system namespace [OK]
Common Mistakes:
  • Using invalid kubectl commands
  • Trying to describe scheduler directly
  • Assuming scheduler is a node property
3. Given the following scenario: The Kubernetes scheduler fails to assign pods to nodes. Which control plane component is most likely responsible for detecting and fixing this issue automatically?
medium
A. API server
B. kubelet
C. etcd
D. Controller manager

Solution

  1. Step 1: Understand the roles of components

    The controller manager runs controllers that watch cluster state and fix issues like unscheduled pods.
  2. Step 2: Identify responsible component for fixing scheduling issues

    When scheduler fails, controller manager detects pods not assigned and may trigger rescheduling or alerts. API server only handles requests, etcd stores data, kubelet runs on nodes.
  3. Final Answer:

    Controller manager -> Option D
  4. Quick Check:

    Controller manager fixes cluster state issues [OK]
Hint: Controller manager fixes cluster state problems automatically [OK]
Common Mistakes:
  • Confusing API server with controller manager
  • Thinking etcd fixes issues
  • Assuming kubelet manages scheduling
4. You notice that the etcd cluster is not storing new data correctly. Which of the following is the most likely cause and fix?
medium
A. etcd disk is full; free up disk space or increase storage
B. Scheduler is overloaded; scale scheduler pods
C. API server is down; restart the API server pods
D. Controller manager crashed; restart controller manager

Solution

  1. Step 1: Identify symptoms related to etcd

    etcd stores cluster data. If it fails to store new data, disk space or storage issues are common causes.
  2. Step 2: Match cause and fix

    API server, scheduler, and controller manager issues do not directly cause etcd storage failure. Disk full on etcd node is the likely cause; freeing space or increasing storage fixes it.
  3. Final Answer:

    etcd disk is full; free up disk space or increase storage -> Option A
  4. Quick Check:

    etcd storage issues = disk full fix [OK]
Hint: etcd storage issues often mean disk full; check storage first [OK]
Common Mistakes:
  • Restarting unrelated components
  • Ignoring disk space on etcd nodes
  • Assuming scheduler affects etcd storage
5. You want to ensure high availability of the Kubernetes control plane. Which combination of components should you deploy in multiple replicas to avoid a single point of failure?
hard
A. Multiple schedulers and controller managers only
B. Multiple API servers and etcd nodes
C. Multiple etcd nodes only
D. Multiple API servers only

Solution

  1. Step 1: Understand high availability needs

    High availability means no single point of failure. Both API servers and etcd store critical data and handle requests.
  2. Step 2: Identify components to replicate

    API servers can run multiple replicas behind a load balancer. etcd must run as a cluster with multiple nodes for data safety. Scheduler and controller manager can be run as leader election but are less critical to replicate for HA.
  3. Final Answer:

    Multiple API servers and etcd nodes -> Option B
  4. Quick Check:

    HA = replicate API servers + etcd nodes [OK]
Hint: Replicate API servers and etcd for control plane high availability [OK]
Common Mistakes:
  • Replicating only schedulers or controller managers
  • Ignoring etcd clustering
  • Assuming API server alone is enough
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard