Control pod's container IO prioritization

7/23/2019

Docker offers support for some prioritization to a container's use of block device IO. It also offers control over transfer rates.

https://docs.docker.com/engine/reference/run/#block-io-bandwidth-blkio-constraint

I can also see it in OCI specification:

https://github.com/opencontainers/runtime-spec/blob/master/config-linux.md#block-io

How this functionality can be used with Kubernetes pods? Kubernetes offers control over CPU/Memory, but documentation lacks information on IO. Is it possible to pass flags like --blkio-weight to docker from k8s container? Maybe it can be achieved indirectly?

-- Adiqq
docker
kubernetes

1 Answer

7/24/2019

There is no way of passing --blkio flag into Kubernetes container.

If you would be able to build it as a representation into your docker-compose.yml, you can use tool called kompose from kompose.io to convert it into Kubernetes yaml.

As you already mentioned the resources that can be controlled are Compute Resources Quota. There is also a Storage Resource Quota, but this is for:

You can limit the total sum of storage resources that can be requested in a given namespace.

In addition, you can limit consumption of storage resources based on associated storage-class.

There is also something called Pod priority, but this is for scheduling order.

-- Crou
Source: StackOverflow