In order to provision a WildFly server for the cloud, you have first to integrate the WildFly Maven plugin
into the pom.xml
file of your project.
The package
goal of the plugin allows you to:
- Provision a WildFly server tailored to your needs.
- Incorporate custom content (keystores, properties files, etc).
- Execute CLI scripts.
- Deploy your application.
The generated server is then ready to be installed inside Docker or Podman container image to be deployed in your cluster.
The cloud feature-pack is to be provisioned along with WildFly Galleon feature-pack. This is configured in the feature-packs
configuration option
of the WildFly Maven plugin.
For example:
<feature-packs>
<feature-pack>
<location>org.wildfly:wildfly-galleon-pack:${version.wildfly}</location>
</feature-pack>
<feature-pack>
<location>org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.wildfly.cloud.galleon.pack}</location>
</feature-pack>
</feature-packs>
For a complete plugin configuration see this example.
Once the Maven plugin has been configured (see a complete example),
calling mvn clean package
will output a WildFly server containing your deployment in <project>/target/server
directory.
This server has then to be installed into the WildFly runtime image (JDK11 or JDK 17).
Use this Dockerfile example to build an application image using Docker or Podman.
With JDK 11 runtime image:
docker build -t my-application-jdk11:latest .
With JDK 17 runtime image:
docker build --build-arg runtime_image="quay.io/wildfly/wildfly-runtime-jdk17:latest" -t my-application-jdk17:latest .
Using WildFly Helm charts is the simplest way to initiate the build of your application image in the cloud.
JDK 11 or JDK 17 WildFly S2I Builder images can be configured in your helm chart to build and deploy an application image.
These examples will guide you step by step in order to deploy your application image in the cloud.
When using the cloud galleon feature-pack, the following content will get provisioned:
- Server startup scripts.
- Automatic adjustment of WildFly Galleon layers to cope with the cloud execution environment.
- Automatic provisioning of the health subsystem allowing for server state monitoring (Liveness and Readiness probes).
- Automatic routing of server logs to the console.