k8s删除状态为Evicted的pod

# kubectl get pod -n gocluster
NAME READY STATUS RESTARTS AGE
gohi-7vbd7 1/1 Running 0 2d
gohi-bvgzb 0/1 Evicted 0 2d
gohi-gd8cc 0/1 Evicted 0 11h
gohi-h77cq 0/1 Evicted 0 11h
gohi-kpgcq 0/1 Evicted 0 11h
gohi-nt92q 0/1 Evicted 0 11h
gohi-pscsk 1/1 Running 0 2d
gohi-sr6mq 1/1 Running 0 11h
# kubectl get pods -n gocluster -o wide |grep Evicted|awk ‘{print $1}’|xargs kubectl delete pods -n gocluster
gohi-bvgzb
gohi-gd8cc
gohi-h77cq
gohi-kpgcq
gohi-nt92q

打赏

发表评论

电子邮件地址不会被公开。 必填项已用*标注