INT 21h

Select language

Kubernetes: wait all pods actually terminated after scale to 0

№ 11269 В разделе Sysadmin от April 26th, 2021,
В подшивках: , ,

Use labels of deployment:

echo "$(date): Stop app pods"

kubectl -n default scale --replicas=0 deployment/my-application
kubectl -n default wait --for=delete pod -l app.kubernetes.io/name=appname 
                                         -l app.kubernetes.io/instance=my-application 
                                         --timeout=90s

echo "$(date): Start backup"

Нет комментариев »

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Облачная платформа
Яндекс.Метрика

Fortune cookie: "There is no question that deadly force should be used to protect innocent life." [Paul Hill, leader of Defensive Action]