0
0
Kubernetesdevops~30 mins

What is Kubernetes - Hands-On Activity

Choose your learning style9 modes available
What is Kubernetes
📖 Scenario: Imagine you have many small toy robots that need to work together to build a big castle. You want to control them easily, make sure they keep working even if one breaks, and add more robots when needed. Kubernetes helps you do this but with computer programs instead of robots.
🎯 Goal: Learn the basic idea of Kubernetes by creating a simple setup that shows how it manages containers (small packages of software) to keep applications running smoothly.
📋 What You'll Learn
Create a YAML file that defines a Kubernetes Pod with one container
Add a label to the Pod for identification
Use a simple container image like nginx
Display the Pod configuration
💡 Why This Matters
🌍 Real World
Kubernetes helps companies run many software containers reliably, like managing many robots working together.
💼 Career
Understanding Kubernetes basics is essential for DevOps roles that manage cloud applications and infrastructure.
Progress0 / 4 steps
1
Create a basic Pod definition
Create a YAML file called pod.yaml with a Kubernetes Pod definition. The Pod should have apiVersion set to v1, kind set to Pod, and metadata with name set to my-first-pod. Under spec, add one container named nginx-container using the image nginx.
Kubernetes
Need a hint?

Start with the basic structure of a Pod YAML file. Use apiVersion, kind, metadata, and spec. Under spec, define one container with the nginx image.

2
Add a label to the Pod
Add a label called app with the value webserver under the metadata section in the pod.yaml file. This label helps identify the Pod.
Kubernetes
Need a hint?

Under metadata, add a labels section with app: webserver.

3
Explain the Pod's purpose
Write a comment at the top of the pod.yaml file explaining that this Pod runs an nginx web server container.
Kubernetes
Need a hint?

Start the file with a comment line beginning with # describing the Pod's purpose.

4
Display the Pod configuration
Print the contents of the pod.yaml file to show the complete Pod configuration.
Kubernetes
Need a hint?

Use Python's open and read functions to print the file contents.