Created
June 29, 2018 18:58
-
-
Save marciorodrigues87/c034c6597db6686f49e00ede34aaddb2 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
REPLICAS_COUNT=$(kubectl -s $K8S_CLUSTER --token=$K8S_TOKEN -n $NAMESPACE get pods -l app=$YOUR_APP | grep -i running | wc -l | grep -oE "[0-9]+") | |
if [ $REPLICAS_COUNT -eq 0 ]; then | |
REPLICAS_COUNT=2 | |
fi | |
REPLICAS_COUNT=$REPLICAS_COUNT envsubst < deploy/your-deployment.yaml.template > your-deployment.yaml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment