Challenge, Medium,  on  Kubernetes

Kubernetes QoS Classes and Resource Management

Scenario

You are working in a Kubernetes cluster as a cluster administrator. You need to understand and manage Quality of Service (QoS) classes to ensure proper resource allocation and pod eviction priorities.


Task

Create a Deployment named guaranteed-deploy in the dev namespace with:

  • 3 replicas
  • Image: nginx
  • The pod must have the label app=guaranteed.
  • Ensure the Pods have the Guaranteed QoS class

Identify the QoS class of all Pods running in the dev namespace and save the result to /home/laborant/qos-class-dev.txt. The output must be formatted as a table:

NAME           QOS
pod-name       qos-class

Determine which Pods will be terminated first if the node runs out of resources (based on QoS priority). Save the names of those Pods to: /home/laborant/early-terminate-pod.txt


Hint
  • Use custom-columns to format the output as a table with NAME and QOS columns.
  • We can manually save the name of the Pod that was terminated when the node ran out of resources in a file called early-terminate-pod.txt, for example: echo "pod1" >> early-terminate-pod.txt

Test Cases