Red Hat OpenShift Workshop For Developers
  • OpenShift Workshop For Developers
    • Getting Started
  • Application Containerization
    • Building Application
    • Application Packaging
    • Running Application Container
    • Externalize Application Configurations
  • Deployment On OpenShift
    • Database Deployment Via Web Console
    • Build And Deploy Application Using S2I
    • Configure Application With ConfigMap
    • Simple Application Scaling
  • Monitoring And Logging
    • View Application Logs
    • Application Monitoring
  • Scaling
    • Resources Allocation For Application
    • Scale Application Automatically
  • Resiliency
    • Application Health Checks
    • Self Healing
Powered by GitBook
On this page
  • Understand Liveness And Readiness
  • Setting The Probes
  1. Resiliency

Application Health Checks

PreviousScale Application AutomaticallyNextSelf Healing

Last updated 2 years ago

Understand Liveness And Readiness

  1. Open application URL and edit the URL by replacing todo.html with following path:

    • /q/health

    • /q/health/live

    • /q/health/ready

    Our To Do application already has the URLs which can be used to configure liveness and readiness probes.

  2. Go back to OpenShift web console, scale the todo-db Pod to 0 and now open the application URL with /q/health/live and /q/health/ready paths.

    Ideally, the application is up and running that's why the /q/health/live returns "status": "UP". However, it cannot connect to database so it's not ready to use or serve any incoming requests so the /q/health/ready returns "status": "DOWN"

    Kubernetes/OpenShift uses application health checks for traffic routing/load balancing, auto recovery/self-healing etc.

  3. Scale the todo-db Pod back to 1 and wait until it's up and running.

Setting The Probes

  1. Select the quarkus-todo-app node, click on the Actions drowdownlist menu then select Add Health Checks.

  2. Click Add Readiness probe link.

  3. Enter following inputs:

    • Path: /q/health/ready

    • Initial delay: 60

    • Timeout: 5

    Then click on the check button.

  4. Click Add Liveness probe link.

  5. Enter following inputs:

    • Path: /q/health/live

    • Initial delay: 60

    • Timeout: 5

    Then click on the check button.

  6. Click Add button.

  7. Deployment object will deploy a new Pod with health checks settings and terminate the old one. Wait until this completed.

  8. Go to Resources tab and click View logs link.

  9. You should see the logs indicate that /q/health/ready and /q/health/live URLs get called by kube-probe agent. Basically, Kubernetes/OpenShift will keep doing application health checks.

Health check URL
Health check URL
Add health checks
Add health checks
Add health checks
Add health checks
Add health checks
Add health checks
Add health checks
Add health checks
Add health checks