first, create a configmap secret which will contain the 503 page
apiVersion: v1
data:
error-page-503.http: |-
HTTP/1.0 503 Service Unavailable
Pragma: no-cache
Cache-Control: private, max-age=0, no-cache, no-store
Connection: close
Content-Type: text/html
<html><head><body>We'll be back!</body></head></html>
kind: ConfigMap
metadata:
name: haproxy-error-page
namespace: default
then create it
oc -n default create -f haproxy-error-page.yml
now you need to add it as a volume
oc -n default set volume --add --configmap-name=haproxy-error-page dc/router -m /var/lib/haproxy/conf/error-page-503.http --name=haproxy-config-volume
and patch the router config (see https://github.com/openshift/origin/issues/16275 for why this is necessary)
oc -n default patch dc router -p '{"spec":{"template":{"spec":{"containers":[{"volumeMounts":[{"mountPath":"/var/lib/haproxy/conf/error-page-503.http","subPath":"error-page-503.http","name":"haproxy-config-volume"}],"name":"router"}]}}}}
selinux also has to be disabled on the router box (for now)