作者 Administrator

更新 install.sh

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