作者 Administrator

更新 install.sh

#!/bin/bash
export PATH=/root/local/bin:$PATH
kubectl -n mmm-worth-prd get pods | grep -q mmm-worth
kubectl -n mmm-suplus-prd get pods | grep -q mmm-worth
if [ "$?" == "1" ];then
kubectl create -f /tmp/prd/mmm-worth/mmm-worth.yaml --record
kubectl -n mmm-worth-prd get svc | grep -q mmm-worth
kubectl -n mmm-suplus-prd get svc | grep -q mmm-worth
if [ "$?" == "0" ];then
echo "mmm-worth service install success!"
else
echo "mmm-worth service install fail!"
fi
kubectl -n mmm-worth-prd get pods | grep -q mmm-worth
kubectl -n mmm-suplus-prd get pods | grep -q mmm-worth
if [ "$?" == "0" ];then
echo "mmm-worth deployment install success!"
else
... ... @@ -17,24 +17,24 @@ if [ "$?" == "1" ];then
fi
else
kubectl delete -f /tmp/prd/mmm-worth/mmm-worth.yaml
kubectl -n mmm-worth-prd get svc | grep -q mmm-worth
kubectl -n mmm-suplus-prd get svc | grep -q mmm-worth
while [ "$?" == "0" ]
do
kubectl -n mmm-worth-prd get svc | grep -q mmm-worth
kubectl -n mmm-suplus-prd get svc | grep -q mmm-worth
done
kubectl -n mmm-worth-prd get pods | grep -q mmm-worth
kubectl -n mmm-suplus-prd get pods | grep -q mmm-worth
while [ "$?" == "0" ]
do
kubectl -n mmm-worth-prd get pods | grep -q mmm-worth
kubectl -n mmm-suplus-prd get pods | grep -q mmm-worth
done
kubectl create -f /tmp/prd/mmm-worth/mmm-worth.yaml --record
kubectl -n mmm-worth-prd get svc | grep -q mmm-worth
kubectl -n mmm-suplus-prd get svc | grep -q mmm-worth
if [ "$?" == "0" ];then
echo "mmm-worth service update success!"
else
echo "mmm-worth service update fail!"
fi
kubectl -n mmm-worth-prd get pods | grep -q mmm-worth
kubectl -n mmm-suplus-prd get pods | grep -q mmm-worth
if [ "$?" == "0" ];then
echo "mmm-worth deployment update success!"
else
... ...