Is it okay to change the pod eviction timeout?(k8s, openshift)

2/18/2022

I want to know about pod eviction timeout. I've already read k8s, openshift manual and some blog. but i couldn't find an article on impact of reducing pod-eviction-timeout.(default : 5m)

I think there is a reason why the default value is 5 minutes. but I can't find reason...

Can you tell me how it will affect k8s cluster if I change the settings? (EX: Change pod-eviction-time: 2minute or less)

refer: we have openshift(okd) cluster and it has many services.

-- n00bandroid
containers
kubernetes
kubernetes-pod
openshift

1 Answer

2/18/2022

if the 5m timeout is a valid choice or not depends on your services and your infrastructure.

there are multiple reasons for a pod to be evicted like node pressure, scheduling priorities due to resource limits, priorityClasses, taints/tolerations, etc. basically, pods will be evicted on some kind of failure or on some kind of scheduling event that can also be initiated by a user.

if you change the timeout, kubernetes will not wait as long to forcefully kill the processes during the eviction. that can lead to some unwanted behaviour with stateful services, because it may not have enough time to be shutdown gracefully and the attached volume may not be available in time when the pod is scheduled on another node again. with stateless services everything is easier, so there won't be such problems.

in short: if you are running stateless services, this should not lead to any problems. if you have stateful services, it may cause problems, but that cannot be answered generally. you gotta test it and see what happens, because you (and your team) know your services best.

-- OlGe
Source: StackOverflow