Configuring a Guaranteed pod

The Guaranteed class has the highest priority of resource QoS classes. In the case of a resource shortage, the Kubernetes scheduler will try to retain the Guaranteed pod to the last.

In order to configure a pod to have the guaranteed class, explicitly set the resource limit and resource request as the same value, or only set the resource limit:

  1. Prepare a pod configuration that has the same value for resources.limit and resources.request:
$ cat guaranteed.yml
apiVersion: v1
kind: Pod
metadata:
name: guaranteed-pod
spec:
containers:
- name: nginx
image: nginx
resources:
limits:
cpu: 0.3
memory: 350Mi
requests:
cpu: 0.3
memory: 350Mi
  1. Create the pod on the chap8-no-qos namespace:
$ kubectl create -f guaranteed.yml --namespace=chap8-no-qos
pod "guaranteed-pod" created
  1. Check the QoS class; it has the Guaranteed class:
$ kubectl describe pods guaranteed-pod --namespace=chap8-no-qos |grep QoS
QoS Class: Guaranteed
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.117.75