开发高可用集群

This commit is contained in:
zeaslity
2024-11-27 09:34:28 +08:00
parent a0792c50cb
commit 59c23a2a97
20 changed files with 8426 additions and 55 deletions

View File

@@ -5,7 +5,7 @@ wget https://oss.demo.uavcmlc.com/cmlc-installation/downloadfile/amd/jq-linux-am
chmod +x /usr/local/bin/jq
export name_space=xmyd
export name_space=uavcloud-demo
kubectl delete pods -n $name_space --field-selector status.phase!=Running --force

View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
name_space=jlyd
delete_all_fronted_cmii_pod(){
all_pod_list=($(kubectl get pods -n "$name_space" -o=jsonpath='{.items[*].metadata.name}' | tr " " "\n"))
for pod in "${all_pod_list[@]}"; do
if echo "$pod" | grep -q "platform"; then
echo ""
echo "current pod is $pod"
kubectl -n "$name_space" delete pod "$pod" --force
fi
done
}
delete_all_backend_cmii_pod(){
all_pod_list=($(kubectl get pods -n "$name_space" -o=jsonpath='{.items[*].metadata.name}' | tr " " "\n"))
for pod in "${all_pod_list[@]}"; do
if echo "$pod" | grep -v "platform" | grep -q "cmii"; then
echo ""
echo "current pod is $pod"
kubectl -n "$name_space" delete pod "$pod" --force
fi
done
}
delete_all_fronted_cmii_pod