📖 Scenario: You are learning how Kubernetes manages containerized applications. Kubernetes uses a control plane to manage the cluster and nodes to run your applications.Imagine you want to understand the basic components of Kubernetes architecture by creating a simple representation of the control plane and nodes using YAML files.
🎯 Goal: Build a simple Kubernetes cluster configuration with a control plane and two worker nodes using YAML manifests.
📋 What You'll Learn
Create a YAML manifest for the control plane with specific components
Add a YAML manifest for worker nodes with labels
Use selectors to identify nodes
Display the final YAML manifests
💡 Why This Matters
🌍 Real World
Kubernetes uses YAML manifests to define and manage cluster components and workloads. Understanding this helps you configure and troubleshoot clusters.
💼 Career
DevOps engineers and site reliability engineers often write and read Kubernetes manifests to deploy and maintain applications in production.
Progress0 / 4 steps
1
Create Control Plane YAML Manifest
Create a YAML manifest called control-plane.yaml that defines the control plane components with these exact keys and values: apiVersion: v1, kind: ControlPlane, metadata: with name: kubernetes-control-plane, and spec: with components: listing etcd, kube-apiserver, kube-controller-manager, and kube-scheduler.
Kubernetes
Hint
Use YAML syntax with indentation. List the components under spec.components.
2
Create Worker Nodes YAML Manifest
Create a YAML manifest called worker-nodes.yaml that defines two worker nodes with these exact details: apiVersion: v1, kind: NodeList, items: containing two nodes each with metadata: including name as worker-node-1 and worker-node-2, and labels: with role: worker.
Kubernetes
Hint
Use a list under items to define multiple nodes. Each node has metadata.name and metadata.labels.role.
3
Add Node Selector to Control Plane Spec
In the existing control-plane.yaml manifest, add a new key nodeSelector under spec with the exact value role: worker to specify that control plane components should run on worker nodes.
Kubernetes
Hint
Indent nodeSelector under spec and set role: worker.
4
Display Final YAML Manifests
Print the full content of both control-plane.yaml and worker-nodes.yaml manifests exactly as created, separated by a line with three dashes ---.
Kubernetes
Hint
Use print() statements to output the YAML content exactly as created, including the separator line ---.
Practice
(1/5)
1. Which component of Kubernetes is responsible for deciding what runs and where?
easy
A. Container runtime
B. Node
C. Pod
D. Control plane
Solution
Step 1: Understand Kubernetes architecture roles
The control plane manages the cluster and makes decisions about scheduling and managing workloads.
Step 2: Identify the component that schedules workloads
The control plane includes the scheduler which decides what runs and where.
Final Answer:
Control plane -> Option D
Quick Check:
Control plane = workload decision maker [OK]
Hint: Control plane manages; nodes run workloads [OK]
Common Mistakes:
Confusing nodes with control plane
Thinking containers decide scheduling
Mixing pods with control plane
2. Which of the following is a correct component of the Kubernetes control plane?
easy
A. etcd
B. kube-proxy
C. kubelet
D. containerd
Solution
Step 1: List control plane components
Control plane includes etcd, kube-apiserver, kube-controller-manager, and kube-scheduler.
Step 2: Identify which option is part of control plane
etcd stores cluster data and is part of the control plane.
Final Answer:
etcd -> Option A
Quick Check:
etcd = control plane data store [OK]
Hint: etcd stores data in control plane [OK]
Common Mistakes:
Confusing kubelet as control plane
Thinking kube-proxy is control plane
Mixing container runtime with control plane
3. Given a Kubernetes cluster, which component runs on each node to ensure containers are running properly?
medium
A. kubelet
B. kube-apiserver
C. kube-scheduler
D. etcd
Solution
Step 1: Identify node components
Nodes run components like kubelet and kube-proxy to manage containers and networking.
Step 2: Determine which component manages container lifecycle on nodes
kubelet runs on each node and ensures containers are running as expected.
Final Answer:
kubelet -> Option A
Quick Check:
kubelet = node container manager [OK]
Hint: kubelet runs on nodes to manage containers [OK]
Common Mistakes:
Confusing kube-apiserver as node component
Thinking scheduler runs on nodes
Mixing etcd with node components
4. You notice pods are not starting on a node. Which component should you check first for errors on that node?
medium
A. kube-scheduler
B. kubelet
C. kube-apiserver
D. etcd
Solution
Step 1: Understand pod startup process
Pods are started and managed on nodes by the kubelet component.
Step 2: Identify component to check for node pod issues
Since pods fail to start on a node, kubelet logs and status should be checked first.
Final Answer:
kubelet -> Option B
Quick Check:
kubelet manages pods on nodes [OK]
Hint: Check kubelet logs for node pod issues [OK]
Common Mistakes:
Checking scheduler instead of kubelet
Looking at etcd for node pod errors
Confusing apiserver with node issues
5. In a Kubernetes cluster, if the control plane node fails, which of the following is true?
hard
A. New pods can still be scheduled on nodes
B. Nodes automatically become control planes
C. Existing pods continue running but no new scheduling occurs
D. All pods immediately stop running
Solution
Step 1: Understand control plane failure impact
The control plane manages scheduling and cluster state but nodes run pods independently.
Step 2: Analyze pod behavior when control plane is down
Existing pods keep running on nodes, but no new pods can be scheduled without control plane.
Final Answer:
Existing pods continue running but no new scheduling occurs -> Option C
Quick Check:
Control plane down = no new scheduling, pods run [OK]
Hint: Control plane down stops scheduling, not running pods [OK]
Common Mistakes:
Thinking pods stop immediately
Assuming nodes become control planes
Believing new pods schedule without control plane
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.