Pod termination takes long time
Pod delete takes long time
Sometimes deletion of pod takes longer time. There could be multiple reasons for that. For me, it was ‘busybox’ pod. It used to take more than a minute to delete the pod. Below is the yaml.
apiVersion: v1
kind: Pod
metadata:
name: busybox
namespace: default
spec:
containers:
- image: busybox
command:
- sleep
- "3600"
imagePullPolicy: IfNotPresent
name: busybox
restartPolicy: Always
kubectl delete pod <podname> --grace-period=0 --force
or,
kubectl delete pod <podname> --wait=false
or use TerminationGracePeriodSeconds in pod’s spec,
...
spec:
containers:
- image: busybox
command:
- sleep
- "3600"
imagePullPolicy: IfNotPresent
name: busybox
restartPolicy: Always
TerminationGracePeriodSeconds: 0
Reference:
Share this post
Twitter
Google+
Facebook
Reddit
LinkedIn
StumbleUpon
Pinterest
Email