作者 Administrator

更新 install.sh

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