作者 Administrator

增加新文件

#!/bin/bash
export PATH=/root/local/bin:$PATH
kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-user
if [ "$?" == "1" ];then
kubectl create -f /tmp/prd/allied-creation-user/allied-creation-user.yaml --record
kubectl -n mmm-suplus-prd get svc | grep -q allied-creation-user
if [ "$?" == "0" ];then
echo "allied-creation-user service install success!"
else
echo "allied-creation-user service install fail!"
fi
kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-user
if [ "$?" == "0" ];then
echo "allied-creation-user deployment install success!"
else
echo "allied-creation-user deployment install fail!"
fi
else
kubectl delete -f /tmp/prd/allied-creation-user/allied-creation-user.yaml
kubectl -n mmm-suplus-prd get svc | grep -q allied-creation-user
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-prd get svc | grep -q allied-creation-user
done
kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-user
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-user
done
kubectl create -f /tmp/prd/allied-creation-user/allied-creation-user.yaml --record
kubectl -n mmm-suplus-prd get svc | grep -q allied-creation-user
if [ "$?" == "0" ];then
echo "allied-creation-user service update success!"
else
echo "allied-creation-user service update fail!"
fi
kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-user
if [ "$?" == "0" ];then
echo "allied-creation-user deployment update success!"
else
echo "allied-creation-user deployment update fail!"
fi
fi
\ No newline at end of file
... ...