Last active
March 1, 2018 08:27
-
-
Save onlymellb/6cabac2b113b41dee3848bd9e3ea79b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -xe | |
ns=${1:-} | |
mode=${2:-debug} | |
if [[ ${mode} == debug ]] | |
then | |
patch='{"metadata":{"labels":{"runmode":"debug"}}}' | |
else | |
patch='{"metadata":{"labels":{"runmode":"normal"}}}' | |
fi | |
pods=`kubectl get po -n ${ns}|grep tikv|cut -d' ' -f1` | |
for pod in ${pods} | |
do | |
echo "start to patch ns: ${ns}, pod: ${pod}" | |
kubectl patch po/${pod} -n ${ns} --patch ${patch} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment