Update the rolling-update-canary script to kill containers in the right namespace

Since canary is defined as a Deployment with an ImagePullPolicy of Always,
killing a pod is sufficient to deploy a new version of the app 👏
This commit is contained in:
R. Tyler Croy 2017-12-15 08:30:32 -08:00
parent 21f17763fa
commit 10fb3cb454
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
1 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,9 @@
#!/bin/sh
exec kubectl rolling-update canary --image=rtyler/codevalet-canary:latest --image-pull-policy=Always --update-period=10s
NAMESPACE=canary
for pod in $(kubectl get pods --namespace=${NAMESPACE} -l app=canary -o name); do
echo ">> Terminating ${pod}"
kubectl delete --namespace=${NAMESPACE} ${pod}
# Sleep to allow Kubernetes to pull the latest image
sleep 5
done;