Skip to content

MelissaFlinn/fuse-health-check-booster

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Health Check - Fuse Booster

Overview

Demonstrates how the Kubernetes health checks work to determine if a container is still alive (the liveness of the container) and ready to serve the traffic for the HTTP endpoints of the application (the readiness of the container).

To demonstrate this behavior, the application configures a /health HTTP endpoint, which is used by Kubernetes to issue HTTP requests. If the container is still alive—​which means the Health HTTP endpoint is able to reply the management platform will receive HTTP code 200 as a response, and no further action is taken. If the HTTP endpoint stops returning a 200 response, the platform will restarts the pod.

Deployment options

This booster can run in the following modes:

  • Standalone on your machine (although there will not be an automatic mechanism to restart your application when needed)

  • Single-node OpenShift cluster

  • OpenShift Online at https://developers.redhat.com/launch

The most effective way to demonstrate the booster is to deploy and run the project on OpenShift. For more details about running this booster on a single-node OpenShift cluster, CI/CD deployments, as well as the rest of the runtime, see the Spring Boot Runtime Guide.

Important
This booster requires Java 8 JDK or greater and Maven 3.3.x or greater.

Running the booster standalone on your machine

You can run this booster as a standalone project on your local machine:

  1. Download the project and extract the archive on your local filesystem.

  2. Build the project:

    $ cd PROJECT_DIR
    $ mvn clean package
  3. then run the services as follows:

    $ mvn spring-boot:run
  4. Visit http://localhost:8080 and follow the instructions on that page.

Important
there will not be an automatich mechanism to restart your application when needed since is not running in a managed container platform.

Running the booster on a single-node OpenShift cluster

If you have a single-node OpenShift cluster, such as Minishift or the Red Hat Container Development Kit, installed and running, you can deploy your booster there. A single-node OpenShift cluster provides you with access to a cloud environment that is similar to a production environment.

To deploy your booster to a running single-node OpenShift cluster:

  1. Download the project and extract the archive on your local filesystem.

  2. Log in to your OpenShift cluster:

    $ oc login -u developer -p developer
  3. Create a new OpenShift project for the booster:

    $ oc new-project MY_PROJECT_NAME
  4. Build and deploy the project to the OpenShift cluster:

    $ mvn clean -DskipTests fabric8:deploy -Popenshift
  5. In your browser, navigate to the MY_PROJECT_NAME project in the OpenShift console. Wait until you can see that the pod for the fuse-health-check-booster application has started up.

  6. Just above the entry for the fuse-health-check-booster application on the Overview page, there is a URL of the form http://fuse-health-check-booster-MY_PROJECT_NAME.OPENSHIFT_IP_ADDR.nip.io. Click on the URL to access the greetings service application and follow the instructions on that page.

Running the booster on OpenShift Online

You can deploy the circuit breaker booster directly to OpenShift Online when you create the project at https://developers.redhat.com/launch.

  1. Visit https://developers.redhat.com/launch.

  2. At the Deployment step, select Use OpenShift Online.

  3. Follow the on-screen instructions to create a new Health Check project using the Fuse runtime.

Note
As part of the process of creating this booster, https://developers.redhat.com/launch sets up a project with a CI/CD deployment of this booster. You can see the status of this deployment in your Single-node OpenShift Cluster or OpenShift Online Web Console.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 65.5%
  • HTML 34.5%