Kubernetes: Zero to Confident

0%
k8s-lab, bash
Welcome to the DevOpsLesson Kubernetes Lab ⎈
This is a safe, simulated Kubernetes cluster. Nothing runs on your machine.
Follow the steps on the left. Type a kubectl command below, or type 'help' anytime.
 
devops@k8s-lab:~$

Every command this lab teaches

Kubernetes: Zero to Confident is 18 steps, about 30 minutes. Each one asks a question, you type the answer in the terminal above, and it is checked before you move on. Nothing is installed and nothing can break.

Beginner6 steps

  1. Print the kubectl client and server version.kubectl version
  2. Show the cluster’s control plane endpoints.kubectl cluster-info
  3. List the nodes in the cluster.kubectl get nodes
  4. List all namespaces.kubectl get namespaces
  5. Run a single nginx pod named “nginx”.kubectl run nginx --image=nginx
  6. List the pods in the default namespace.kubectl get pods

Intermediate6 steps

  1. Describe the nginx pod.kubectl describe pod nginx
  2. Create a deployment named “web” from the nginx image.kubectl create deployment web --image=nginx
  3. List the deployments.kubectl get deployments
  4. Scale the “web” deployment to 3 replicas.kubectl scale deployment web --replicas=3
  5. Expose the “web” deployment on port 80.kubectl expose deployment web --port=80
  6. List the services.kubectl get services

Advanced6 steps

  1. View the logs of one of your pods.kubectl logs nginx
  2. Exec a command inside a pod (e.g. ls).kubectl exec nginx -- ls
  3. Update the “web” deployment to a newer nginx image.kubectl set image deployment/web nginx=nginx:1.27
  4. Check the rollout status of the “web” deployment.kubectl rollout status deployment/web
  5. Roll the “web” deployment back to its previous version.kubectl rollout undo deployment/web
  6. Delete the “web” deployment.kubectl delete deployment web