This lab will teach us the basic usage of Kubernetes. Through Minikube, a simplified Kubernetes engine running on a single computer, we practice the key concepts and usage of Kubernetes.
Same as Lab 6, this lab will be performed in GitHub CodeSpaces. Create an instance using GitHub Codespaces. Choose repository denoslab/ensf400-lab7-kubernetes-1
.
minikube start
This step will start the Minikube service in a container.
Go to Section 1 - 6 and complete the steps for each section. The steps can be found in the README.md
files in each subdirectory.
The TA will check the completion of the following tasks:
- Output of Section 1.
- Output of Section 2.
- Output of Section 3.
- Output of Section 4.
- Output of Section 5.
- Output of Section 6.
Each member of the group should be able to answer all of the following questions. The TA will ask each person one question selected at random, and the student must be able to answer the question to get credit for the lab.
- Q1: How to check which Node a Pod is running on? Use an example to show where this information can be found.
kubectl describe pod webserver
- Q2: How to scale a ReplicaSet? Use an example to demonstrate scaling a ReplicaSet to 3 replicas.
kubectl scale --replicas=3 rs/web
- Q3: Briefly describe the process of a deployment rolling update, i.e., how are new version of pods created and how are old version of pods terminated. Which configurations can control the pods being created or deleted in parallel?
The deployment controller creates new pods with the updated version of the application. Once the new pods are successfully running and ready, the deployment controller gradually terminates the pods running the old version of the application. Both done gradually to ensure number of running pods.
- Q4: Inside the Kubernetes cluster, how to access a service named "svc1" offering HTTP service at Port 8000?
curl HTTP://:8000 curl HTTP://svc1.default.svc.cluster.local:8000
- Q5: What is an Ingress in Kubernetes? What type of resources does an Ingress configuration typically point to as its backend? manages external access to services within a Kubernetes cluster