Giter VIP home page Giter VIP logo

health-check-example's Introduction

Health Check Spring Boot Example

https://appdev.openshift.io/docs/spring-boot-runtime.html#mission-health-check-spring-boot

Table of Contents

Prerequisites

  • JDK 11+ installed with JAVA_HOME configured appropriately

Deploying application on OpenShift using Dekorate

mvn clean verify -Popenshift -Ddekorate.deploy=true

Deploying application on OpenShift using Helm

First, make sure you have installed the Helm command line and connected/logged to a kubernetes cluster.

Then, you need to install the example by doing:

helm install healthcheck ./helm --set app.route.expose=true --set app.s2i.source.repo=https://github.com/snowdrop/health-check-example --set app.s2i.source.ref=<branch-to-use>

note: Replace <branch-to-use> with one branch from https://github.com/snowdrop/health-check-example/branches/all.

And to uninstall the chart, execute:

helm uninstall healthcheck

Deploying application on Kubernetes using Helm

Requirements:

You need to install the example by doing:

helm install healthcheck ./helm --set app.ingress.host=<your k8s domain>

And to uninstall the chart, execute:

helm uninstall healthcheck

Running Tests on OpenShift using Dekorate

./run_tests_with_dekorate_in_ocp.sh

Alternativelly, tests can be executed against a specific Spring Boot or Dekorate version by passing the version as a -D<variable property name>=value parameter. For instance overriding both the Spring Boot and the Dekorate versions using their corresponding version properties is done the following way:

./run_tests_with_dekorate_in_ocp.sh -Dspring-boot.version=2.7.3 -Ddekorate.version=2.11.1

Running Tests on OpenShift using S2i from Source

./run_tests_with_s2i.sh

This script can take up to 3 parameters which are:

  • --repository-url: repository to use to source the images from
  • --branch-to-test: branch to use to source the images from
  • --maven-settings: custom maven settings file
./run_tests_with_s2i.sh --repository-url "https://github.com/snowdrop/health-check-example" --branch-to-test branch-to-test --maven-settings "${HOME}/.m2/my-custom-maven-settings.xml"

Running Tests on OpenShift using Helm

./run_tests_with_helm.sh

This script can take 2 parameters referring to the repository and the branch to use to source the images from.

./run_tests_with_helm_in_ocp.sh "https://github.com/snowdrop/health-check-example" branch-to-test

Running Tests on Kubernetes using Helm

First, you need to create the k8s namespace:

kubectl create namespace <the k8s namespace>

Then, run the tests by specifying the container registry and the kubernetes namespace:

./run_tests_with_helm_in_k8s.sh <your container registry: for example "quay.io/user"> <the k8s namespace>

For example:

./run_tests_with_helm_in_k8s.sh "quay.io/user" "myNamespace"

health-check-example's People

Contributors

alesj avatar atomist-bot avatar aureamunoz avatar cmoulliard avatar edewit avatar gastaldi avatar geoand avatar ibuziuk avatar iocanel avatar jacobdotcosta avatar ladicek avatar lincolnthree avatar metacosm avatar radekkoubsky avatar sgitario avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

health-check-example's Issues

Need to add 'spring-boot-devtools' dependency

IMO, in general it would be great if all the samples and not only this particular spring-boot-health-check-booster quickstart would have spring boot devtools dependency [1]. This would allow features like automatic restarts [2] being enabled OOTB. Some notes from the official docs:

Developer tools are automatically disabled when running a fully packaged application. If your application is launched using java -jar or if it’s started using a special classloader, then it is considered a “production application”. Flagging the dependency as optional is a best practice that prevents devtools from being transitively applied to other modules using your project. Gradle does not support optional dependencies out-of-the-box so you may want to have a look to the propdeps-plugin in the meantime.

[1] https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-devtools.html
[2] https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-devtools.html#using-boot-devtools-restart

Removing oc command client from kubernetes bash script

Issue

The following messages

./run_tests_with_helm_in_k8s.sh: line 6: oc: command not found
...
scripts/waitFor.sh: line 12: oc: command not found

are reported when we execute the command ./run_tests_with_helm_in_k8s.sh kind-registry:5000/health-check health-check

As the goal is to execute the command against a kubernetes cluster, kubectl client should be used instead of oc !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.