Skip to content

Commit

Permalink
helper for adding nginx-healthchecks
Browse files Browse the repository at this point in the history
  • Loading branch information
Schnitzel committed Jun 1, 2019
1 parent d89447f commit 5d85dae
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions helpers/nginx-healthchecks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

if [ -z "$OPENSHIFT_PROJECT" ]; then
echo "OPENSHIFT_PROJECT not set"
exit 1
fi

set -eu -o pipefail

OC="oc"

echo "${OPENSHIFT_PROJECT}: starting =================================================================="

# Remove any backupcommand from nginx pods if they exit
if oc -n ${OPENSHIFT_PROJECT} get deploymentconfig nginx -o json &> /dev/null; then
oc -n ${OPENSHIFT_PROJECT} patch dc/nginx --patch '{"spec":{"template":{"spec":{"containers":[{"name":"php","livenessProbe":{"$patch":"replace","tcpSocket":{"port":9000},"initialDelaySeconds":60,"periodSeconds":10},"readinessProbe":{"$patch":"replace","tcpSocket":{"port":9000},"initialDelaySeconds":2,"periodSeconds":10}}]}}}}' || true
oc -n ${OPENSHIFT_PROJECT} rollout status --watch dc/nginx
fi


echo "${OPENSHIFT_PROJECT}: done =================================================================="

0 comments on commit 5d85dae

Please sign in to comment.