Skip to content
Permalink
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/nginx-healthchecks.sh
@@ -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.
You can’t perform that action at this time.