In the kubernetes documentation here the conditions for a pod that is classified as Burstable
in regards to resource QOS is defined as
If requests and optionally limits are set (not equal to 0) for one or more resources across one or more containers, and they are not equal, then the pod is classified as Burstable. When limits are not specified, they default to the node capacity.
so basically stated differently:
requests
set for one or more resources (cpu/memory) across one or more containers in the pod.limits
are optional: if set, they should be not be equal to the requests
of the same resource.But then later on the documentation gives the following as an example of Burstable
pod:
containers:
name: foo
resources:
limits:
cpu: 10m
memory: 1Gi
requests:
cpu: 10m
memory: 1Gi
name: bar
Note: Container bar
has no resources specified.
This example fulfils condition 1. However, it doesn't satisfy condition 2, since the limits and requests are set for one container but they are equal.
So why is this pod classified as a Burstable
pod?
K8s documentation containing QOS explanation and examples: https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/resource-qos.md#qos-classes
The evaluation of the Quality of Service (QoS) is done by scheduler on the whole pod, i.e. container by container and then taking the lowest evaluation.
Take a look at this example:
apiVersion: v1
kind: Pod
metadata:
name: class
spec:
containers:
- name: container1
image: busybox
command: ["sh"]
args: ["-c","sleep 3600"]
resources:
requests:
memory: 100Mi
cpu: 200m
limits:
memory: 100Mi
cpu: 200m
- name: container2
image: busybox
command: ["sh"]
args: ["-c","sleep 3600"]
resources:
requests:
memory: 100Mi
cpu: 200m
container1
has Guaranteed QoS, because it has both requests and limits defined, and they are equals.
container2
has Burstable QoS, because it hasn't limits defined, but only requests.
class pod is evaluated, based on both containers and taking the lowest evaluation:
min(Guaranteed, Burstable) = Burstable
Reference: https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/