#!/usr/bin/env bash

namespace=zjjt

all_error_app_list=(cmii-uav-user cmii-uav-oauth cmii-admin-user cmii-admin-gateway cmii-uav-gateway cmii-uav-cloud-live cmii-uav-material-warehouse)

for app in ${all_error_app_list[@]};do
   echo "current app is ${app}"
   old_replicas=$(kubectl -n ${namespace} get deployment ${app} -o jsonpath='{.spec.replicas}')
   kubectl -n ${namespace} scale deployment ${app} --replicas=0
   sleep 1
   kubectl -n ${namespace} scale deployment ${app} --replicas=${old_replicas}
done