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
A Pod is given a QoS class of Burstable if: The Pod does not meet the criteria for QoS class Guaranteed. At least one Container in the Pod has a memory or CPU request or limit.
Burstable (QoS)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.
Smallest unit in that context means "smallest deployable thing". Technically a container is an even smaller unit because a pod can contain multiple containers, but you can not deploy a single container, only a pod with one container. That's why the pod is considered the smallest unit in kubernetes.
No more than 5000 nodes. No more than 150000 total pods. No more than 300000 total containers.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With