作者 Administrator

更新 install.sh

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