#!/bin/bash

pod01=`kubectl get pod -o wide -n weifeng-system|grep official-ui-node-prod|awk -F : 'NR==1'|awk -F " " '{print $1}'`
pod02=`kubectl get pod -o wide -n weifeng-system|grep official-ui-node-prod|awk -F : 'NR==2'|awk -F " " '{print $1}'`
pod03=`kubectl get pod -o wide -n weifeng-system|grep official-ui-node-prod|awk -F : 'NR==3'|awk -F " " '{print $1}'`

kubectl delete pod $pod01  -n weifeng-system

sleep 60

kubectl delete pod $pod02  -n weifeng-system

sleep 60

kubectl delete pod $pod03  -n weifeng-system

sleep 20
 

node_prod_status=`kubectl get pod -o wide -n weifeng-system|grep official-ui-node-prod|awk -F " " '{print $3}'|grep -ci "Running"`


if [ $node_prod_status -eq 3 ];then

    echo -e "\033[32m[ the application official-ui-node-pre successfully deployed  ]\033[0m"

else
    echo -e "\033[31m\033[01m[ the application official-ui-node-pre deploy failed  ]\033[0m"

fi

  

转载于:https://www.cnblogs.com/weifeng1463/p/10254951.html

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐