Kubernetes: How to implement a Network ResourceQuota
Asked Answered
T

1

8

I'm familiar with the Kubernetes quotas for CPU and memory usage. However, I'm envisaging a scenario in which certain containers are guaranteed to use a lot of network bandwidth, and I can't see any way of warning Kubernetes of this. (e.g. don't put two on the same machine, don't put too much else on this machine even if the other quotas are fine). How can I effect this sort of behaviour? For the purposes of the question I have full control of the cluster and am prepared to write code if necessary.

Timothee answered 18/1, 2019 at 12:1 Comment(0)
W
14

The only thing you can do is to apply Support traffic shaping using kubernetes.io/ingress-bandwidth and kubernetes.io/egress-bandwidth annotations. It can only be applied to your PODS.

Example:

apiVersion: v1
kind: Pod
metadata:
  annotations:
    kubernetes.io/ingress-bandwidth: 1M
    kubernetes.io/egress-bandwidth: 1M
.. 

Also official k8s documentation gives link to bandwidth plugin. Try to apply in for your needs.

And read this GitHub issue.

Walrus answered 21/1, 2019 at 13:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.