作者 Administrator

增加新文件

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