first, create a configmap secret which will contain the 503 page
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
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
1 |
oc -n default create -f haproxy-error-page.yml |
now you need to add it as a volume
1 |
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)
1 |
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)