Skip to content
Browse files

helper for adding nginx-healthchecks

  • Loading branch information...
Schnitzel committed Jun 1, 2019
1 parent d89447f commit 5d85dae4de70c307f3dbbdc73d9157c6284f739b
Showing with 21 additions and 0 deletions.
  1. +21 −0 helpers/
@@ -0,0 +1,21 @@

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

set -eu -o pipefail


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

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

0 comments on commit 5d85dae

Please sign in to comment.
You can’t perform that action at this time.