大量更新
This commit is contained in:
24
55-202501-DEMO迁移/0-批量命令
Normal file
24
55-202501-DEMO迁移/0-批量命令
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
kubectl scale deployment --all --replicas=0 -n uavcloud-dev
|
||||
kubectl scale statefulset --all --replicas=0 -n uavcloud-dev
|
||||
|
||||
kubectl scale deployment --all --replicas=0 -n uavcloud-devflight
|
||||
kubectl scale statefulset --all --replicas=0 -n uavcloud-devflight
|
||||
|
||||
|
||||
kubectl scale deployment --all --replicas=0 -n uavcloud-devoperation
|
||||
kubectl scale statefulset --all --replicas=0 -n uavcloud-devoperation
|
||||
|
||||
export name_space=uavcloud-devflight
|
||||
export name_space=uavcloud-devoperation
|
||||
export name_space=uavcloud-dev
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
/var/lib/docker/containers/8380daef87f894cdc0ba98f0b528c39945f6d5c603129fe68fd7f00132d89001/8380daef87f894cdc0ba98f0b528c39945f6d5c603129fe68fd7f00132d89001-json.log
|
||||
Reference in New Issue
Block a user