0
0
Kubernetesdevops~30 mins

Kubernetes architecture (control plane and nodes) - Mini Project: Build & Apply

Choose your learning style9 modes available
Kubernetes Architecture: Control Plane and Nodes
📖 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
Need a 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
Need a 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
Need a 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
Need a hint?

Use print() statements to output the YAML content exactly as created, including the separator line ---.