0
0
Azurecloud~15 mins

Kubectl for cluster management in Azure - Mini Project: Build & Apply

Choose your learning style9 modes available
Kubectl for cluster management
📖 Scenario: You are managing a Kubernetes cluster on Azure. You need to use kubectl commands to view and manage the cluster resources.
🎯 Goal: Learn to use kubectl commands to list pods, filter pods by status, and label pods for better management.
📋 What You'll Learn
Use kubectl commands to interact with the cluster
List all pods in the default namespace
Filter pods by their status
Add labels to pods for organization
💡 Why This Matters
🌍 Real World
Managing Kubernetes clusters on Azure requires using kubectl commands to view and organize cluster resources efficiently.
💼 Career
Cloud engineers and DevOps professionals use kubectl daily to maintain and troubleshoot Kubernetes clusters.
Progress0 / 4 steps
1
List all pods in the default namespace
Write the kubectl command to list all pods in the default namespace using kubectl get pods.
Azure
Need a hint?

Use kubectl get pods to see all pods in the default namespace.

2
Filter pods by status
Write the kubectl command to list pods that are in the Running status using kubectl get pods --field-selector=status.phase=Running.
Azure
Need a hint?

Use the --field-selector=status.phase=Running option to filter pods by status.

3
Label a pod for organization
Write the kubectl command to add a label env=production to a pod named my-pod using kubectl label pod my-pod env=production.
Azure
Need a hint?

Use kubectl label pod my-pod env=production to add a label to the pod.

4
Verify the label on the pod
Write the kubectl command to get the details of the pod named my-pod and verify the label using kubectl get pod my-pod --show-labels.
Azure
Need a hint?

Use kubectl get pod my-pod --show-labels to see the labels on the pod.