redhat-eap81

by joaquinito2051

Helm chartv1.0.2App 8.1

Build and deploy JBoss EAP 8.1 applications on OpenShift

About this chart

Helm Chart for EAP 8.1

A Helm chart for building and deploying a JBoss EAP 8.1 application on OpenShift.

Building and Deploying Applications

The build and deploy steps are configured in separate build and deploy values.

The input of the build step is a Git repository that contains the application code and the output is an ImageStreamTag resource that contains the built application image.

The input of the deploy step is an ImageStreamTag resource that contains the built application image and the output is a Deployment and related resources to access the application from inside and outside OpenShift.

To be able to install a Helm release with that chart, you must be able to provide a valid application image.

Build an Application Image from Source

If the application image must be built from source, the minimal configuration is:

build:
  uri: <git repository URL of your application>

If the source repository is private, you must have a source secret created in the same namespace where you are building the application which allows athenticating to the repository. Provide the name of the secret in the build section as follows:

build:
  sourceSecret: <name of secret to login to your Git repository>

The build step will use OpenShift BuildConfig to build an application image from this Git repository.

The application must be a Maven project that is configured to use the org.jboss.eap.plugins:eap-maven-plugin to provision a JBoss EAP server with the deployed application. The application is built during the S2I assembly by running:

mvn -e -Popenshift -DskipTests -Dcom.redhat.xpaas.repo.redhatga -Dfabric8.skip=true --batch-mode -Djava.net.preferIPv4Stack=true -s /tmp/artifacts/configuration/settings.xml -Dmaven.repo.local=/tmp/artifacts/m2  package

Any additional Maven arguments can be specified by adding the MAVEN_ARGS_APPEND environment variable in the .build.env field:

build:
  env:
    - name: MAVEN_ARGS_APPEND
      value: "-P my-profile"

Pull an existing Application Image

If your application image already exists, you can skip the build step and directly deploy your application image. In that case, the minimal configuration is:

image:
  name: <name of the application image. e.g. "quay.io/example.org/my-app">
  tag: <tag of the applicication image. e.g. "1.3" (defaults to "latest")>
build:
  enabled: false

Working With Private Image Registries

If you are using private image registries to build, push or pull the application image, you need first to create secrets that will allow the container platform where the Helm Chart is deployed to authenticate against the private image registries.

Pulling the Builder and Runtime Images from a Private Image Registry

This step applies if you build the image on OpenShift and need to pull the builder and runtime base images from an external private image registry.

You must first create a secret that contains the credentials to pull the base image (as explained in the Kubernetes documentation) and reference it from the build.pullSecret field:

build:
  pullSecret: my-pull-secret

Pushing the Application Image to a Private Image Registry

This step applies if you build the image with the Helm chart and want to push it to an external image registry.

You must first create a secret that contains the credentials to push the application image (as explained in the Kubernetes documentation) and reference it from the build.output.pushSecret field. You also need to set the build.output.kind field to DockerImage.

build:
  output:
    kind: DockerImage
    pushSecret: my-push-secret

Pulling the Application Image from a Private Registry

If the application image comes from a private registry that requires authentication, you must first create a secret that contains the credentials to pull the application image (as explained in the Kubernetes documentation) and reference it from the deploy.imagePullSecrets field:

image:
  name: quay.io/my-private-group/my-private-image
build:
  enabled: false
deploy:
  imagePullSecrets:
    - name: my-secret-quay-credentials

Application Image

The configuration for the application image that is built and deployed is configured in a image section.

ValueDescriptionDefaultAdditional Information
image.nameName of the image you want to build and/or deployDefaults to the Helm release name.The chart will create/reference an ImageStreamTag or a DockerImage based on this value.
image.tagTag that you want to build/deploylatest-

Building the Application Image

The configuration to build the application image is configured in a build section.

If the application image has been built by another mechanism, you can skip the building part of the Helm Chart by setting the build.enabled field to false.

ValueDescriptionDefaultAdditional Information
build.contextDirThe sub-directory where the application source code exists--
build.enabledDetermines if build-related resources should be created.trueSet this to false if you want to deploy a previously built image. Leave this set to true if you want to build and deploy a new image.
build.envFreeform env items-Kubernetes documentation. These environment variables will be used when the application is built. If you need to specify environment variables for the running application, use deploy.env instead.
build.imagesFreeform images injected in the source during S2I build-OKD API documentation
build.modeDetermines the mode to build the application image with EAP 8.1s2iAllowed values: s2i
build.output.kindDetermines if the image will be pushed to an ImageStreamTag or a DockerImageImageStreamTagOKD API documentation
build.output.pushSecretName of the push secret-The secret must exist in the same namespace or the chart will fail to install - Used only if build.output.kind is DockerImage
build.pullSecretName of the pull secret-The secret must exist in the same namespace or the chart will fail to install - OKD API documentation
build.refGit reference (branch, tag, or commit) containing the application you want to build. If unspecified, the default branch from the Git repository is used.--
build.resourcesFreeform resources items-Kubernetes documentation
build.s2iConfiguration specific to building with EAP S2I images--
build.s2i.buildApplicationImageWhether the application image is built. If false the Helm release will only create the builder image (and name it from the Helm release) true-
build.s2i.builderKindDetermines the type of images for S2I Builder image (DockerImage, ImageStreamTag or ImageStreamImage)the value of build.s2i.kind(OKD Documentation](https://docs.okd.io/latest/cicd/
build.s2i.galleonLayersA list of layer names to compose a EAP server-EAP Documentation
build.s2i.galleonDirDirectory relative to the root directory for the build that contains custom content for Galleon.-EAP Documentation
build.s2i.featurePacksList of additional Galleon feature-packs identified by Maven coordinates (<groupId>:<artifactId>:<version>)-The value can be be either a string with a list of comma-separated Maven coordinate or an array where each item is the Maven coordinate of a feature pack - EAP Documentation
build.s2i.channelsList of Channels identified by Maven coordinates (<groupId>:<artifactId>). If featurePacks are configured without any versioning, the channels that provides the latest feature packs can be specified. Deprecated, the recommended way to provision EAP is to use the eap-maven-plugin in the application pom.xml-The value can be be either a string with a list of comma-separated Maven coordinate or an array where each item is the Maven coordinate of a channel - EAP Documentation
build.s2i.jdkJDK Version of the EAP S2I images"17"Allowed Values: "17", "21"
build.s2i.jdk17.builderImageEAP S2I Builder image for JDK 17registry.redhat.io/jboss-eap-8-tech-preview/eap81-openjdk17-builder-openshift-rhel9:latestEAP Documentation
build.s2i.jdk17.runtimeImageEAP S2I Runtime image for JDK 17registry.redhat.io/jboss-eap-8-tech-preview/eap81-openjdk17-runtime-openshift-rhel9:latestEAP Documentation
build.s2i.jdk21.builderImageEAP S2I Builder image for JDK 21registry.redhat.io/jboss-eap-8-tech-preview/eap81-openjdk21-builder-openshift-rhel9:latestEAP Documentation
build.s2i.jdk21.runtimeImageEAP S2I Runtime image for JDK 21registry.redhat.io/jboss-eap-8-tech-preview/eap81-openjdk21-runtime-openshift-rhel9:latestEAP Documentation
build.s2i.kindDetermines the type of images for S2I Builder and Runtime images (DockerImage, ImageStreamTag or ImageStreamImage)DockerImageOKD Documentation
build.s2i.runtimeKindDetermines the type of images for S2I Runtime image (DockerImage, ImageStreamTag or ImageStreamImage)the value of build.s2i.kindOKD Documentation
build.sourceSecretName of the secret containing the credentials to login to Git source reposiory-The secret must exist in the same namespace or the chart will fail to install - OKD documentation
build.triggers.genericSecretName of the secret containing the WebHookSecretKey for the Generic Webhook-The secret must exist in the same namespace or the chart will fail to install - OKD documentation
build.triggers.githubSecretName of the secret containing the WebHookSecretKey for the GitHub Webhook-The secret must exist in the same namespace or the chart will fail to install - OKD documentation
build.uri(required) Git URI that references your Git repositoryhttps://github.com/jboss-eap-up-and-running/eap81-getting-startedBe sure to specify this to build your own application.

Provisioning Jboss EAP With S2I.

The recommended way to provision the JBoss EAP server is to use the eap-maven-plugin from the application pom.xml.

The build.s2i.featurePacks,build.s2i.galleonLayersand build.s2i.channels fields have been deprecated as they are no longer necessary with this recommendation.

For backwards compatibility, the EAP S2I Builder image still supports these fields to delegate to the provisioning of the server to the eap-maven-plugin if it is not configured in the application pom.xml. However if build.s2i.galleonLayers is set, build.s2i.featurePacks must be specified (including EAP own feature pack org.jboss.eap:wildfly-ee-galleon-pack).

Deploying the Application Image

The configuration to deploy the application image is configured in a deploy section.

If the Helm chart is only used to build the application image, you can skip the deploying part of the Helm

Deploy redhat-eap81 with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has redhat-eap81 on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartredhat-eap81 is pinned at v1.0.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply