How to force Eviction on a Kubernetes Cluster (minikube)

885 views Asked by At

I am relatively new to Kubernetes, and have a current task to debug Eviction pods on my work. I'm trying to replicate the behaviour on a local k8s cluster in minikube. So far I just cannot get evicted pods happening.

Can you help me trigger this mechanism?

1

There are 1 answers

0
breizh5729 On

the eviction of pods is managed by the qos classes (quality of pods)

there are 3 categories

Guaranteed (limit = request cpu or ram) not evictable Burstable BestEffort

if you want test this mechanism , you can scale a pod that consume lot of memory or cpu and before that launch your example pods with différent request and limit for test this behavior. this behavior is only avaible for eviction so your pods must be already started before a cpu load.

after if you test a scheduling mechanism during a luanch time you can configure a priorityclassname for schedule a pods even if the cluster is full.

by example if your cluster is full you can't schedule a new pods because your pod don't have a sufficient privilege.

if you want schedule anyway a pod despite that you can add a priorityclassname system-node-critical or create your own priorityclass and one of the pod with a lower priority will be evict and your pod will be launched