0
0
Kubernetesdevops~30 mins

Control plane components (API server, scheduler, controller manager, etcd) in Kubernetes - Mini Project: Build & Apply

Choose your learning style9 modes available
Understanding Kubernetes Control Plane Components
📖 Scenario: You are learning how Kubernetes manages your containerized applications. The control plane is like the brain of Kubernetes. It has parts that talk to each other to keep your apps running smoothly.In this project, you will create simple representations of the main control plane components: the API server, scheduler, controller manager, and etcd. This will help you understand their roles and how they connect.
🎯 Goal: Build a simple Python script that models the Kubernetes control plane components as a dictionary. Then add a configuration for their status, write logic to check which components are running, and finally print the running components.
📋 What You'll Learn
Create a dictionary named control_plane with keys for api_server, scheduler, controller_manager, and etcd with initial status values.
Add a variable named running_status that holds the string "Running".
Write a loop that creates a list running_components containing the names of components whose status matches running_status.
Print the list running_components.
💡 Why This Matters
🌍 Real World
Kubernetes control plane components manage the cluster state and ensure your applications run correctly. Understanding their status helps troubleshoot and maintain healthy clusters.
💼 Career
DevOps engineers and site reliability engineers often monitor and manage these components to keep Kubernetes clusters stable and performant.
Progress0 / 4 steps
1
Create the control plane components dictionary
Create a dictionary called control_plane with these exact entries: 'api_server': 'Running', 'scheduler': 'Stopped', 'controller_manager': 'Running', and 'etcd': 'Running'.
Kubernetes
Need a hint?

Use curly braces {} to create a dictionary. Each key is a component name as a string, and each value is its status as a string.

2
Add the running status variable
Add a variable called running_status and set it to the string 'Running'.
Kubernetes
Need a hint?

Just assign the string 'Running' to the variable running_status.

3
Find running components
Write a for loop using variables component and status to iterate over control_plane.items(). Inside the loop, if status equals running_status, add component to a list called running_components. Initialize running_components as an empty list before the loop.
Kubernetes
Need a hint?

Use control_plane.items() to get key-value pairs. Check if the status matches running_status. If yes, add the component name to the list.

4
Print the running components
Write a print statement to display the list running_components.
Kubernetes
Need a hint?

Use print(running_components) to show the list of running components.