add
This commit is contained in:
15
998-常用脚本/故障恢复脚本/删除状态不为Running的Pod.sh
Normal file
15
998-常用脚本/故障恢复脚本/删除状态不为Running的Pod.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
wget https://oss.demo.uavcmlc.com/cmlc-installation/downloadfile/amd/jq-linux-amd64 -O /usr/local/bin/jq
|
||||
chmod +x /usr/local/bin/jq
|
||||
|
||||
|
||||
export name_space=xmyd
|
||||
|
||||
kubectl delete pods -n $name_space --field-selector status.phase!=Running --force
|
||||
|
||||
kubectl get pods -n $name_space -o json | jq -r '.items[] | select(.status.containerStatuses[0].ready == false) | .metadata.name' | xargs -r kubectl delete pod -n $name_space --force
|
||||
|
||||
|
||||
kubectl -n ${name_space} delete pod helm-nacos-0 --force
|
||||
Reference in New Issue
Block a user