作者 yangfu

k8s修改

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