Readiness probe
The PaaS can deliver value-added services both at deployment and at runtime.
One important service is only routing traffic to applications that are up-and-running. But in order to do so, the platform needs information about your application … it’s you who decide what is “up-and-running”.
For more information :
- https://www.gcloud.belgium.be/doc/PAAS/probes/
- https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
Create a test page
Create a probe.xhtml page in folder src/main/webapp/html.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<!-- test page for openshift readiness and liveness probes -->
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><h:outputText value="Hello XX test Page" /></title>
</h:head>
</html>
Add config in dc
Add the configuration in the dc after the volumeMounts and replace the dc in Openshift.
readinessProbe:
httpGet:
path: /trainings-hellostco-jsf/html/probe.xhtml
port: 8080
scheme: HTTP
initialDelaySeconds: 60
timeoutSeconds: 3
livenessProbe:
httpGet:
path: /trainings-hellostco-jsf/html/probe.xhtml
port: 8080
scheme: HTTP
initialDelaySeconds: 300
timeoutSeconds: 30
