Red Hat JBoss Web Server Operator
Installing and using the Red Hat JBoss Web Server Operator 2.x for OpenShift
Abstract
Providing feedback on Red Hat JBoss Web Server documentation Copy linkLink copied to clipboard!
To report an error or to improve our documentation, log in to your Red Hat Jira account and submit an issue. If you do not have a Red Hat Jira account, then you will be prompted to create an account.
Procedure
- Click the following link to create a ticket.
- Enter a brief description of the issue in the Summary.
- Provide a detailed description of the issue or enhancement in the Description. Include a URL to where the issue occurs in the documentation.
- Clicking Create creates and routes the issue to the appropriate documentation team.
Making open source more inclusive Copy linkLink copied to clipboard!
Red Hat is committed to replacing problematic language in our code, documentation, and web properties. We are beginning with these four terms: master, slave, blacklist, and whitelist. Because of the enormity of this endeavor, these changes will be implemented gradually over several upcoming releases. For more details, see our CTO Chris Wright’s message.
Chapter 1. Red Hat JBoss Web Server Operator Copy linkLink copied to clipboard!
An Operator is a Kubernetes-native application that makes it easy to manage complex stateful applications in Kubernetes and OpenShift environments. Red Hat JBoss Web Server (JWS) provides an Operator to manage JWS for OpenShift images. You can use the JWS Operator to create, configure, manage, and seamlessly upgrade instances of web server applications in OpenShift.
Operators include the following key concepts:
The Operator Framework is a toolkit to manage Operators in an effective, automated, and scalable way. The Operator Framework consists of three main components:
- You can use OperatorHub to discover Operators that you want to install.
- You can use the Operator Lifecycle Manager (OLM) to install and manage Operators in your OpenShift cluster.
- You can use the Operator SDK if you want to develop your own custom Operators.
-
An Operator group is an OLM resource that provides multitenant configuration to OLM-installed Operators. An Operator group selects target namespaces in which to generate role-based access control (RBAC) for all Operators that are deployed in the same namespace as the
OperatorGroupobject. - Custom resource definitions (CRDs) are a Kubernetes extension mechanism that Operators use. CRDs allow the custom objects that an Operator manages to behave like native Kubernetes objects. The JWS Operator provides a set of CRD parameters that you can specify in custom resource files for web server applications that you want to deploy.
This document describes how to install the JWS Operator, deploy an existing JWS image, and delete Operators from a cluster. This document also provides details of the CRD parameters that the JWS Operator provides.
Before you follow the instructions in this guide, you must ensure that an OpenShift cluster is already installed and configured as a prerequisite. For more information about installing and configuring OpenShift clusters, see the OpenShift Container Platform Installing guide.
For a faster but less detailed guide to deploying a prepared image or building an image from an existing image stream, see the JWS Operator QuickStart guide.
Red Hat supports images for JWS 5.4 or later versions only.
Chapter 2. What is new in JWS Operator 2.x? Copy linkLink copied to clipboard!
JWS Operator 2.x provides level-2 Operator capabilities such as seamless integration. JWS Operator 2.x also supports Red Hat JBoss Web Server metering labels and includes some new or enhanced Custom Resource Definition (CRD) parameters.
Due to a known issue, seamless upgrades do not work properly between versions 2.2 and 2.3 of the JWS Operator. If you have an existing Operator 2.2.x installation, you must first uninstall Operator 2.2.x, as described in JWS Operator deletion from a cluster. Then install the latest Operator 2.3.x version, as described in JWS Operator installation from OperatorHub.
2.1. What is new in the JWS Operator 2.3 release? Copy linkLink copied to clipboard!
The JWS Operator 2.3 release includes the following new features, enhancements, and deprecations.
- Operator package name change
From JWS Operator 2.3 onward, the package names for the JWS Operator and its respective bundle are changed to
jboss-webserver-operator-container-<version>andjboss-webserver-operator-bundle-container-<version>.This change supersedes the behavior in earlier releases where the package names were
jboss-webserver-5-operator-container-<version>andjboss-webserver-5-operator-bundle-container-<version>.This removal of the JBoss Web Server major version from the package names reflects the fact that the Operator is version-agnostic across different major versions of JBoss Web Server.
- New
sourceRepositorySecretparameter JWS Operator 2.3 introduces a
sourceRepositorySecretparameter under thewebImageStream:webSourceshierarchy in the CRD. This parameter specifies the secret for a private repository that contains the application source files.For more information, see JWS Operator CRD parameters.
- Removed Operator responsibility for managing cluster-wide configuration for monitoring system
JWS Operator 2.3 no longer automatically manages the cluster-wide configuration that is required for the cluster monitoring system. From JWS Operator 2.3 onward, users must maintain responsibility for creating this cluster-wide configuration file for monitoring.
For more information, see Management of cluster-wide configuration for monitoring.
- Fixed issues
- JWS Operator 2.3 includes fixes for various issues that were observed in earlier releases.
2.2. What is new in the JWS Operator 2.2 release? Copy linkLink copied to clipboard!
The JWS Operator 2.2 release includes the following new features and enhancements.
- New
volumeSpecparameter JWS Operator 2.2 introduces a
volumeSpecparameter in the CRD. This parameter specifies the volumes that are to be mounted.The
volumeSpecparameter containspersistentVolumeClaims,secrets,configMaps, andvolumeClaimTemplatesfields.For more information, see JWS Operator CRD parameters.
2.3. What is new in the JWS Operator 2.1 release? Copy linkLink copied to clipboard!
The JWS Operator 2.1 release includes the following new features, enhancements, and deprecations.
- New
webhookSecretsparameter JWS Operator 2.1 introduces a
webhookSecretsparameter under thewebImageStream:webSourceshierarchy in the CRD. This parameter specifies secret names for triggering a build through a generic, GitHub, or GitLab webhook.The
webhookSecretsparameter containsgeneric,github, andgitlabfields.For more information, see JWS Operator CRD parameters.
- New
tlsConfigparameter JWS Operator 2.1 introduces a
tlsConfigparameter in the CRD. This parameter specifies the TLS configuration for a web server.The
tlsConfigparameter containsrouteHostname,certificateVerification,tlsSecret, andtlsPasswordfields.For more information, see JWS Operator CRD parameters.
- New
environmentVariablesparameter JWS Operator 2.1 introduces an
environmentVariablesparameter in the CRD. This parameter specifies the environment variables for the deployment.For more information, see JWS Operator CRD parameters.
- New
persistentLogsparameter JWS Operator 2.1 introduces a
persistentLogsparameter in the CRD. This parameter specifies persistent volume and logging configuration.The
persistentLogsparameter containscatalinaLogs,enableAccessLogs,volumeName, andstorageClassfields.For more information, see JWS Operator CRD parameters.
- New
podResourcesparameter JWS Operator 2.1 introduces a
podResourcesparameter in the CRD. This parameter specifies the configuration of the central processing unit (CPU) and memory resources that the web server uses.For more information, see JWS Operator CRD parameters.
- New
securityContextparameter JWS Operator 2.1 introduces a
securityContextparameter in the CRD. This parameter defines the security capabilities that are required to run the application.For more information, see JWS Operator CRD parameters.
- New
useInsightsClientparameter JWS Operator 2.1 introduces a
useInsightsClientparameter in the CRD. This parameter indicates whether to create a connection with the runtimes inventory operator that Red Hat provides.You can enable debug logging for the Insights client by setting the
INSIGHTS_DEBUGenvironment variable totrue.NoteThe
useInsightsClientparameter requires use of a Red Hat JBoss Web Server 6.1 or later image.This parameter is available as a Technology Preview only.
For more information, see JWS Operator CRD parameters.
- Deprecated
genericWebhookSecretparameter JWS Operator 2.1 deprecates the
genericWebhookSecretparameter that is under thewebImageStream.webSources.webSourcesParamshierarchy in the CRD.This parameter is superseded by the
webImageStream.webSources.webhookSecrets.genericparameter.For more information, see JWS Operator CRD parameters.
- Deprecated
githubWebhookSecretparameter JWS Operator 2.1 deprecates the
githubWebhookSecretparameter that is under thewebImageStream.webSources.webSourcesParamshierarchy in the CRD.This parameter is superseded by the
webImageStream.webSources.webhookSecrets.githubparameter.For more information, see JWS Operator CRD parameters.
- Enhanced format for default generated hostnames
- JWS Operator 2.1 uses an enhanced format for default generated hostnames that can consist of an application name and a project name that are each up to 63 characters in length.
2.4. What is new in the JWS Operator 2.0 release? Copy linkLink copied to clipboard!
The JWS Operator 2.0 release includes the following new features and enhancements.
- Level-2 Operator capabilities
JWS Operator 2.0 provides the following level-2 Operator capability features:
- Enables seamless upgrades
- Supports patch and minor version upgrades
- Manages web servers deployed by the JWS Operator 1.1.x.
- Level-2 seamless integration for new images
The
Deploymentobject definition includes a trigger that OpenShift uses to deploy new pods when a new image is pushed to the image stream. The image stream can monitor the repository for new images or you can instruct the image stream that a new image is available for use.For more information, see Enabling level-2 seamless integration for new images.
- Level-2 seamless integration for rebuilding existing images
The
BuildConfigobject definition includes a trigger for image stream updates and a webhook, which is a GitHub, GitLab, or Generic webhook, that enables the rebuilding of images when the webhook is triggered.For more information about creating a secret for a webhook, see Creating a secret for a generic or GitHub webhook.
For more information about configuring a generic or GitHub webhook in a custom resource WebServer file, see JWS Operator CRD parameters.
- Support for Red Hat JBoss Web Server metering labels
JWS Operator 2.0 supports the ability to add metering labels to the Red Hat JBoss Web Server pods that the JWS Operator creates.
Red Hat JBoss Web Server can use the following metering labels:
-
com.company: Red_Hat -
rht.prod_name: Red_Hat_Runtimes -
rht.prod_ver: 2026-Q1 -
rht.comp: JBoss_Web_Server -
rht.comp_ver: 6.2.0 -
rht.subcomp: Tomcat 10 rht.subcomp_t: applicationYou can add labels under the
metadatasection in the custom resourceWebServerfile for a web application that you want to deploy. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you change any label key or label value for a deployed web server, the JWS Operator redeploys the web server application. If the deployed web server was built from source code, the JWS Operator also rebuilds the web server application.
-
- Enhanced
webImageparameter In the JWS Operator 2.0 release, the
webImageparameter in the CRD contains the following additional fields:imagePullSecretThe secret that the JWS Operator uses to pull images from the repository
NoteThe secret must contain the key
.dockerconfigjson. The JWS Operator mounts and uses the secret (for example,--authfile /mount_point/.dockerconfigjson) to pull the images from the repository. TheSecretobject definition file might contain server username and password values or tokens to allow access to images in the image stream, the builder image, and images built by the JWS Operator.webAppA set of parameters that describe how the JWS Operator builds the web server application
- Enhanced
webAppparameter In the JWS Operator 2.0 release, the
webAppparameter in the CRD contains the following additional fields:nameThe name of the web server application
sourceRepositoryURLThe URL where the application source files are located
sourceRepositoryRefThe branch of the source repository that the Operator uses
sourceRepositoryContextDirThe subdirectory where the
pom.xmlfile is located and where themvn installcommand must be runwebAppWarImageThe URL of the images where the JWS Operator pushes the built image
webAppWarImagePushSecretThe secret that the JWS Operator uses to push images to the repository
builderA set of parameters that contain all the information required to build the web application and create and push the image to the image repository
NoteTo ensure that the builder can operate successfully and run commands with different user IDs, the builder must have access to the
anyuidsecurity context constraint (SCC).To grant the builder access to the
anyuidSCC, enter the following command:oc adm policy add-scc-to-user anyuid -z builderThe
builderparameter contains the following fields:imageThe image of the container where the web application is built (for example,
quay.io/$user/tomcat10-buildah)imagePullSecretThe secret (if specified) that the JWS Operator uses to pull the builder image from the repository
applicationBuildScriptThe script that the builder image uses to build the application
.warfile and move it to the/mntdirectoryNoteIf you do not specify a value for this parameter, the builder image uses a default script that uses Maven and Buildah.
Chapter 3. JWS Operator installation from OperatorHub Copy linkLink copied to clipboard!
You can install the JWS Operator from OperatorHub to facilitate the deployment and management of JBoss Web Server applications in an OpenShift cluster. OperatorHub is a component of the Operator Framework that you can use to discover Operators that you want to install. OperatorHub works in conjunction with the Operator Lifecycle Manger (OLM), which installs and manages Operators in a cluster.
Due to a known issue, seamless upgrades do not work properly between versions 2.2 and 2.3 of the JWS Operator. If you have an existing Operator 2.2.x installation, you must first uninstall Operator 2.2.x, as described in JWS Operator deletion from a cluster. Then install the latest Operator 2.3.x version as described in this section.
You can install the JWS Operator from OperatorHub in either of the following ways:
3.1. Installing the JWS Operator by using the web console Copy linkLink copied to clipboard!
If you want to install the JWS Operator by using a graphical user interface, you can use the OpenShift web console to install the JWS Operator.
When you install the JWS Operator by using the web console, and the Operator is using SingleNamespace installation mode, the OperatorGroup and Subscription objects are installed automatically.
Prerequisites
- You have deployed an OpenShift Container Platform cluster by using an account with cluster administrator and Operator installation permissions.
Procedure
- Open the web console and select Operators > OperatorHub.
- In the Filter by keyword search field, type "JWS".
- Select the JWS Operator.
- On the JBoss Web Server Operator menu, select the Capability level that you want to use and click Install.
On the Install Operator page, perform the following steps:
Select the Update channel where the JWS Operator is available.
NoteThe JWS Operator is currently available through one channel only.
Select the Installation mode for the Operator.
You can install the Operator to all namespaces or to a specific namespace on the cluster. If you select the specific namespace option, use the Installed Namespace field to specify the namespace where you want to install the Operator.
NoteIf you do not specify a namespace, the Operator is installed to all namespaces on the cluster by default.
Select the Approval strategy for the Operator.
Consider the following guidelines:
- If you select Automatic updates, when a new version of the Operator is available, the OLM upgrades the running instance of your Operator automatically.
- If you select Manual updates, when a newer version of the Operator is available, the OLM creates an update request. As a cluster administrator, you must then manually approve the update request to ensure that the Operator is updated to the new version.
Click Install.
NoteIf you have selected a Manual approval strategy, you must approve the install plan before the installation is complete.
The JWS Operator then appears in the Installed Operators section of the Operators tab.
3.2. Installing the JWS Operator by using the command line Copy linkLink copied to clipboard!
If you want to install the JWS Operator by using a command-line interface, you can use the oc command-line tool to install the JWS Operator. The JWS Operator that Red Hat provides is named jws-operator.
The steps to install the JWS Operator from the command line include verifying the supported installation modes and available channels for the Operator and creating a Subscription object. Depending on the installation mode that the Operator uses, you might also need to create an Operator group in the project namespace before you create the Subscription object.
Prerequisites
- You have deployed an OpenShift Container Platform cluster by using an account with Operator installation permissions.
-
You have installed the
octool on your local system.
Procedure
To inspect the JWS Operator, perform the following steps:
View the list of JWS Operators that are available to the cluster from OperatorHub:
oc get packagemanifests -n openshift-marketplace | grep jws
$ oc get packagemanifests -n openshift-marketplace | grep jwsCopy to Clipboard Copied! Toggle word wrap Toggle overflow The preceding command displays the name, catalog, and age of each available Operator.
For example:
NAME CATALOG AGE jws-operator Red Hat Operators 16h
NAME CATALOG AGE jws-operator Red Hat Operators 16hCopy to Clipboard Copied! Toggle word wrap Toggle overflow Inspect the JWS Operator to verify the supported installation modes and available channels for the Operator:
oc describe packagemanifests jws-operator -n openshift-marketplace
$ oc describe packagemanifests jws-operator -n openshift-marketplaceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Check the actual list of Operator groups:
oc get operatorgroups -n <project_name>
$ oc get operatorgroups -n <project_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the preceding example, replace
<project_name>with your OpenShift project name.The preceding command displays the name and age of each available Operator group.
For example:
NAME AGE mygroup 17h
NAME AGE mygroup 17hCopy to Clipboard Copied! Toggle word wrap Toggle overflow If you need to create an Operator group, perform the following steps:
NoteIf the Operator you want to install uses
SingleNamespaceinstallation mode and you do not already have an appropriate Operator group in place, you must complete this step to create an Operator group. You must ensure that you create only one Operator group in the specified namespace.If the Operator you want to install uses
AllNamespacesinstallation mode or you already have an appropriate Operator group in place, you can ignore this step.Create a YAML file for the
OperatorGroupobject.For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the preceding example, replace
<operatorgroup_name>with the name of the Operator group that you want to create, and replace<project_name>with the name of the project where you want to install the Operator. To view the project name, you can run theoc project -qcommand.Create the
OperatorGroupobject from the YAML file:oc apply -f <filename>.yaml
$ oc apply -f <filename>.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow In the preceding example, replace
<filename>.yamlwith the name of the YAML file that you have created for theOperatorGroupobject.
To create a Subscription object, perform the following steps:
Create a YAML file for the
Subscriptionobject.For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the preceding example, replace
<project_name>with the name of the project where you want to install the Operator. To view the project name, you can run theoc project -qcommand.The namespace that you specify must have an
OperatorGroupobject that has the same installation mode setting as the Operator. If the Operator usesAllNamespacesinstallation mode, replace<project_name>withopenshift-operators, which already provides an appropriate Operator group. If the Operator usesSingleNamespaceinstallation mode, ensure that this namespace has only oneOperatorGroupobject.Ensure that the
sourcesetting matches theCatalog Sourcevalue that was displayed when you verified the available channels for the Operator (for example,redhat-operators).Create the
Subscriptionobject from the YAML file:oc apply -f <filename>.yaml
$ oc apply -f <filename>.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow In the preceding example, replace
<filename>.yamlwith the name of the YAML file that you have created for theSubscriptionobject.
Verification
To verify that the JWS Operator is installed successfully, enter the following command:
oc get csv -n <project_name>
$ oc get csv -n <project_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the preceding example, replace
<project_name>with the name of the project where you have installed the Operator.The preceding command displays details of the installed Operator.
For example:
Expand NAME DISPLAY VERSION REPLACES PHASE jws-operator.v2.3.x
JWS Operator
2.3.x
jws-operator.v2.2.y
Succeeded
In the preceding output,
2.3.xrepresents the current Operator version (for example,2.3.0), and2.2.yrepresents the previous Operator version that the current version replaces (for example,2.2.4).
Chapter 4. Deploying an existing JWS image Copy linkLink copied to clipboard!
You can use the JWS Operator to facilitate the deployment of an existing image for a web server application that you want to deploy in an OpenShift cluster. In this situation, you must create a custom resource WebServer file for the web server application that you want to deploy. The JWS Operator uses the custom resource WebServer file to handle the application deployment.
Prerequisites
You have installed the JWS Operator from OperatorHub.
To ensure that the JWS Operator is installed, enter the following command:
oc get deployment.apps/jws-operator-controller-manager
$ oc get deployment.apps/jws-operator-controller-managerCopy to Clipboard Copied! Toggle word wrap Toggle overflow The preceding command displays the name and status details of the Operator.
For example:
NAME READY UP-TO-DATE AVAILABLE AGE jws-operator 1/1 1 1 15h
NAME READY UP-TO-DATE AVAILABLE AGE jws-operator 1/1 1 1 15hCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you want to view more detailed output, you can use the following command:
oc describe deployment.apps/jws-operator-controller-manager
Procedure
-
Prepare your image and push it to the location where you want to display the image (for example,
quay.io/<USERNAME>/tomcat-demo:latest). To create a custom resource file for your web server application, perform the following steps:
-
Create a YAML file named, for example,
webservers_cr.yaml. Enter details in the following format:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Create a YAML file named, for example,
To deploy your web application, perform the following steps:
- Go to the directory where you have created the web application.
Enter the following command:
oc apply -f webservers_cr.yaml
$ oc apply -f webservers_cr.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow The preceding command displays a message to confirm that the web application is deployed.
For example:
webserver/example-image-webserver created
webserver/example-image-webserver createdCopy to Clipboard Copied! Toggle word wrap Toggle overflow When you run the preceding command, the Operator also creates a route automatically.
Verify the route that the Operator has automatically created:
oc get routes
$ oc get routesCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Delete the
webserverthat you created in Step 3:oc delete webserver example-image-webserver
$ oc delete webserver example-image-webserverCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteAlternatively, you can delete the
webserverby deleting the YAML file. For example:oc delete -f webservers_cr.yaml
Chapter 5. JWS Operator deletion from a cluster Copy linkLink copied to clipboard!
If you no longer need to use the JWS Operator, you can subsequently delete the JWS Operator from a cluster.
You can delete the JWS Operator from a cluster in either of the following ways:
5.1. Deleting the JWS Operator by using the web console Copy linkLink copied to clipboard!
If you want to delete the JWS Operator by using a graphical user interface, you can use the OpenShift web console to delete the JWS Operator.
Prerequisites
You have deployed an OpenShift Container Platform cluster by using an account with
cluster adminpermissions.NoteIf you do not have
cluster adminpermissions, you can circumvent this requirement. For more information, see Allowing non-cluster administrators to install Operators.
Procedure
- Open the web console and click Operators > Installed Operators.
Select the Actions menu and click Uninstall Operator.
NoteThe Uninstall Operator option automatically removes the Operator, any Operator deployments, and Pods.
Deleting the Operator does not remove any custom resource definitions or custom resources for the Operator, including CRDs or CRs. If the Operator has deployed applications on the cluster, or if the Operator has configured resources outside the cluster, you must clean up these applications and resources manually.
5.2. Deleting the JWS Operator by using the command line Copy linkLink copied to clipboard!
If you want to delete the JWS Operator by using a command-line interface, you can use the oc command-line tool to delete the JWS Operator.
Prerequisites
You have deployed an OpenShift Container Platform cluster by using an account with
cluster adminpermissions.NoteIf you do not have
cluster adminpermissions, you can circumvent this requirement. For more information, see Allowing non-cluster administrators to install Operators.-
You have installed the
octool on your local system.
Procedure
Check the current version of the subscribed Operator:
oc get subscription jws-operator -n <project_name> -o yaml | grep currentCSV
$ oc get subscription jws-operator -n <project_name> -o yaml | grep currentCSVCopy to Clipboard Copied! Toggle word wrap Toggle overflow In the preceding example, replace
<project_name>with the namespace of the project where you installed the Operator. If your Operator was installed to all namespaces, replace<project_name>withopenshift-operators.The preceding command displays the following output, where
v2.1.xrefers to the Operator version (for example,v2.1.0):f:currentCSV: {} currentCSV: jws-operator.v2.1.xf:currentCSV: {} currentCSV: jws-operator.v2.1.xCopy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the subscription for the Operator:
oc delete subscription jws-operator -n <project_name>
$ oc delete subscription jws-operator -n <project_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the preceding example, replace
<project_name>with the namespace of the project where you installed the Operator. If your operator was installed to all namespaces, replace<project_name>withopenshift-operators.Delete the CSV for the Operator in the target namespace:
oc delete clusterserviceversion <currentCSV> -n <project_name>
$ oc delete clusterserviceversion <currentCSV> -n <project_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the preceding example, replace
<currentCSV>with thecurrentCSVvalue that you obtained in Step 1 (for example,jws-operator.v2.1.0). Replace<project_name>with the namespace of the project where you installed the Operator. If your operator was installed to all namespaces, replace<project_name>withopenshift-operators.The preceding command displays a message to confirm that the CSV is deleted.
For example:
clusterserviceversion.operators.coreos.com "jws-operator.v2.1.x" deleted
clusterserviceversion.operators.coreos.com "jws-operator.v2.1.x" deletedCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 6. Enabling level-2 seamless integration for new images Copy linkLink copied to clipboard!
You can create an image stream in your project, create a custom resource (CR) for the web application that you want the Operator to deploy, and trigger an update to the image stream.
Procedure
In your project namespace, create an image stream by using the
oc import-imagecommand to import the tag and other information for an image.For example:
oc import-image <my-image>-imagestream:latest \ --from=quay.io/$user/<my-image>:latest \ --confirm
oc import-image <my-image>-imagestream:latest \ --from=quay.io/$user/<my-image>:latest \ --confirmCopy to Clipboard Copied! Toggle word wrap Toggle overflow In the preceding example, replace each occurrence of
<my-image>with the name of the image that you want to import.The preceding command creates an image stream named
<my-image>-imagestreamby importing information for thequay.io/$user/<my-image>image. For more information about the format and management of image streams, see Managing image streams.Create a custom resource of the
WebServerkind for the web application that you want the JWS Operator to deploy whenever the image stream is updated. You can define the custom resource in YAML file format.For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Trigger an update to the image stream by using the
oc tagcommand.For example:
oc tag quay.io/$user/<my-image> <my-image>-imagestream:latest --scheduled
oc tag quay.io/$user/<my-image> <my-image>-imagestream:latest --scheduledCopy to Clipboard Copied! Toggle word wrap Toggle overflow The preceding command causes OpenShift Container Platform to update the specified image stream tag periodically. This period is a cluster-wide setting that is set to 15 minutes by default.
Chapter 7. Creating a secret for a webhook Copy linkLink copied to clipboard!
You can create a secret that you can use with a generic, GitHub, or GitLab webhook to trigger application builds in a Git repository. Depending on the type of Git hosting platform that you use for your application code, the JWS Operator provides webhookSecrets:generic, webhookSecrets:github, and webhookSecrets:gitlab parameters that you can use to specify the secret in the custom resource file for a web application.
Procedure
Create a Base64-encoded secret string.
For example:
echo -n "qwerty" | base64
echo -n "qwerty" | base64Copy to Clipboard Copied! Toggle word wrap Toggle overflow The preceding command encodes a plain-text string,
qwerty, and displays the encoded string.For example:
cXdlcnR5
cXdlcnR5Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
secret.yamlfile that defines an object of kindSecret.For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the preceding example,
jws-secretis the name of the secret andcXdlcnR5is the encoded secret string.To create the secret, enter the following command:
oc create -f secret.yaml
oc create -f secret.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow The preceding command displays a message to confirm that the secret is created.
For example:
secret/jws-secret created
secret/jws-secret createdCopy to Clipboard Copied! Toggle word wrap Toggle overflow Based on the preceding example, you can set the
webhookSecrets:genericparameter tojws-secret.
Verification
Get the URL for the webhook:
oc describe BuildConfig | grep webhooks
oc describe BuildConfig | grep webhooksCopy to Clipboard Copied! Toggle word wrap Toggle overflow The preceding command generates the webhook URL in the following format:
https://<host>:<port>/apis/build.openshift.io/v1/namespaces/<namespace>/buildconfigs/<name>/webhooks/<secret>/generic
https://<host>:<port>/apis/build.openshift.io/v1/namespaces/<namespace>/buildconfigs/<name>/webhooks/<secret>/genericCopy to Clipboard Copied! Toggle word wrap Toggle overflow To send a request to the webhook, enter the following
curlcommand:curl -k -X POST https://<host>:<port>/apis/build.openshift.io/v1/namespaces/<namespace>/buildconfigs/<name>/webhooks/<secret>/generic
curl -k -X POST https://<host>:<port>/apis/build.openshift.io/v1/namespaces/<namespace>/buildconfigs/<name>/webhooks/<secret>/genericCopy to Clipboard Copied! Toggle word wrap Toggle overflow In the preceding command, replace
<host>,<port>,<namespace>, and<name>in the URL string with values that are appropriate for your environment. Replace<secret>with the plain-text secret string (for example,qwerty).The preceding command generates the following type of webhook response in JSON format and the build is triggered:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf a
User "system:anonymous" cannot create resource errorresults, you can resolve this error either by adding unauthenticated users to thesystem:webhookrole binding or by creating a token and running thecurlcommand.For example, to create a token and run the
curlcommand:TOKEN=`oc create token builder` curl -H "Authorization: Bearer $TOKEN" -k -X POST https://<host>:<port>/apis/build.openshift.io/v1/namespaces/<namespace>/buildconfigs/<name>/webhooks/<secret>/generic
TOKEN=`oc create token builder` curl -H "Authorization: Bearer $TOKEN" -k -X POST https://<host>:<port>/apis/build.openshift.io/v1/namespaces/<namespace>/buildconfigs/<name>/webhooks/<secret>/genericCopy to Clipboard Copied! Toggle word wrap Toggle overflow If you want to use the webhook in GitHub:
- In your GitHub project, select Settings > Webhooks > Add webhook.
- In the Payload URL field, add the URL.
-
Set the content type to
application/json. - Disable SSL verification, if necessary.
- Click Add webhook.
For more information, see https://docs.openshift.com/container-platform/4.6/builds/triggering-builds-build-hooks.html.
Chapter 8. Management of cluster-wide configuration for monitoring Copy linkLink copied to clipboard!
Before the JWS Operator 2.3 release, the Operator automatically managed the cluster-wide configuration that is required for the monitoring system. However, from JWS Operator 2.3 onward, users must maintain responsibility for managing the cluster-wide configuration for monitoring.
When using JWS Operator 2.3, you must create a cluster-monitoring-config ConfigMap. To enable monitoring for user-defined projects in the cluster, you must edit the ConfigMap to include an enableUserWorkload entry that is set to true, as shown in the following example:
For more information about the prerequisites and steps for completing this task, see Configuring user workload monitoring: Enabling monitoring for user-defined projects in the Red Hat OpenShift Container Platform documentation.
Chapter 9. JWS Operator CRD parameters Copy linkLink copied to clipboard!
The JWS Operator provides a set of custom resource definition (CRD) parameters. When you create a custom resource WebServer file for a web application, you can specify parameter values in a <key>: <value> format. The JWS Operator uses the information that you specify in the custom resource WebServer file to deploy the web application.
9.1. CRD parameter hierarchy Copy linkLink copied to clipboard!
The JWS Operator provides CRD parameters in the following hierarchical format:
When you create a custom resource WebServer file, specify parameter names and values in the same hierarchical format that the preceding example outlines. For more information about creating a custom resource WebServer file, see Deploying an existing JWS image.
The genericWebhookSecret and githubWebhookSecret parameters are deprecated in the JWS Operator 2.1 release. The useInsightsClient parameter is a Technology Preview feature only.
9.2. CRD parameter details Copy linkLink copied to clipboard!
The following table describes the CRD parameters that the JWS Operator provides. This table shows each parameter name in the context of any higher-level parameters that are above it in the hierarchy.
| Parameter name | Description |
|---|---|
|
| The number of pods of the JBoss Web Server image that you want to run For example:
|
|
| The name of the web application that you want the JWS Operator to deploy The application name must be a unique value in the OpenShift namespace or project. The JWS Operator uses the application name that you specify to create the route to access the web application. For example:
|
|
| Enables DNSping session clustering
This is set to
Note: In this release, the session clustering functionality is available as a Technology Preview feature only. The current Operator version uses the For example:
|
|
| A set of parameters that controls how the JWS Operator deploys pods from existing images
This parameter contains |
|
| The full path to the name of the application image that you want to deploy For example:
|
|
| The name of the secret that the JWS Operator uses to pull images from the repository
The secret must contain the key
The For example:
|
|
| A set of parameters that describe how the JWS Operator builds the web application that you want to add to the application image
If you do not specify the
This parameter contains |
|
| The name of the web application file
The default name is For example:
|
|
| The URL where the application source files are located
The source should contain a Maven For example:
|
|
| The branch of the source repository that the JWS Operator uses For example:
|
|
|
The subdirectory in the source repository where the For example:
|
|
| The URL of the images where the JWS Operator pushes the built image |
|
| The name of the secret that the JWS Operator uses to push images to the repository
The secret must contain the key
If the JWS Operator uses a pull secret to pull images from the repository, you must specify the name of the pull secret as the value for the For example:
|
|
| A set of parameters that describe how the JWS Operator builds the web application and creates and pushes the image to the image repository
To ensure that the builder can operate successfully and run commands with different user IDs, the builder must have access to the
This parameter contains |
|
| The image of the container where the JWS Operator builds the web application For example:
|
|
| The name of the secret (if specified) that the JWS Operator uses to pull the builder image from the repository
The secret must contain the key
The For example:
|
|
|
The script that the builder image uses to build the application If you do not specify a value for this parameter, the builder image uses a default script that uses Maven and Buildah. |
|
| The health check that the JWS Operator uses The default behavior is to use the health valve, which does not require any parameters.
This parameter contains |
|
| A string that specifies the logic for the pod readiness health check
If this parameter is not specified, the JWS Operator uses the default health check by using the OpenShift internal registry to check For example:
|
|
| A string that specifies the logic for the pod liveness health check This parameter is optional. |
|
| A set of parameters that control how the JWS Operator uses an image stream that provides images to run or to build upon The JWS Operator uses the latest image in the image stream.
This parameter contains |
|
| The name of the image stream that you have created to allow the JWS Operator to find the base images For example:
|
|
| The namespace or project where you have created the image stream For example:
|
|
| A set of parameters that describe where the application source files are located and how to build them
If you do not specify the
This parameter contains |
|
| The URL where the application source files are located
The source should contain a Maven For example:
|
|
| The secret for the repository of the application source files You can use this parameter to grant access to application source files that are contained in a private Git repository. For example:
For more information, see Builds using BuildConfig: Source clone secrets in the Red Hat OpenShift Container Platform documentation. |
|
| The branch of the source repository that the JWS Operator uses For example:
|
|
|
The subdirectory in the source repository where the For example:
|
|
| A set of parameters that specify secret names for triggering a build through a webhook
This parameter contains |
|
| The name of a secret for a generic webhook that can trigger a build For more information about creating a secret, see Creating a secret for a webhook. For more information about using generic webhooks, see Webhook Triggers. For example:
|
|
| The name of a secret for a GitHub webhook that can trigger a build For more information about creating a secret, see Creating a secret for a webhook. For more information about using GitHub webhooks, see Webhook Triggers. For example:
|
|
| The name of a secret for a GitLab webhook that can trigger a build For more information about creating a secret, see Creating a secret for a webhook. For more information about using GitLab webhooks, see Webhook Triggers. For example:
|
|
| A set of parameters that describe how to build the application images This parameter is optional.
This parameter contains
Note: The |
|
| The Maven proxy URL that Maven uses to build the web application This parameter is required if the cluster does not have internet access. |
|
|
The directory where Maven stores the
The contents of this directory are copied to the
The default value is |
|
|
Important: This parameter is deprecated in the 2.1 release. Use the A webhook secret string For more information about creating a secret, see Creating a secret for a webhook. For more information about using generic webhooks, see Webhook Triggers. For example:
|
|
|
Important: This parameter is deprecated in the 2.1 release. Use the A webhook secret string specific to GitHub For more information about creating a secret, see Creating a secret for a webhook. For more information about using GitHub webhooks, see Webhook Triggers. Note: You cannot perform manual tests of a GitHub webhook. GitHub generates the payload and it is not empty. |
|
| The health check that the JWS Operator uses The default behavior is to use the health valve, which does not require any parameters.
This parameter contains |
|
| A string that specifies the logic for the pod readiness health check
If this parameter is not specified, the JWS Operator uses the default health check by using the OpenShift internal registry to check For example:
|
|
| A string that specifies the logic for the pod liveness health check This parameter is optional. |
|
| A set of parameters that specify the TLS configuration for a web server
This parameter contains |
|
| Indicates whether the Operator should create a route or whether the route uses TLS
Supported values are
For example:
|
|
| Indicates whether the Operator should use the TLS connector with a client certificate
Supported values are
For more information, see the Apache Tomcat HTTP Connector documentation about the For example:
|
|
|
The secret to use for the server certificate ( For example:
|
|
|
The passphrase used to protect the server key ( For example:
|
|
| Environment variables for deployment |
|
| A set of parameters that specify persistent volume and logging configuration
This parameter contains |
|
|
Indicates whether the
Supported values are For example:
|
|
|
Indicates whether the
Supported values are For example:
|
|
| Name of the persistent volume that is used to store the log files For example:
|
|
| Name of the storage class of the persistent volume that is used to store the log files For example:
|
|
| Specifies the configuration of the CPU and memory resources that the web server uses
These values must be categorized under For example:
These values are used for autoscaling. For more information about autoscaling, see Automatically scaling pods with the horizontal pod autoscaler. |
|
| Defines the security capabilities that are required to run the application |
|
| A set of parameters that specify the volumes to be mounted
This parameter contains |
|
|
A list of the names of persistent volume claims (PVCs) that are to be mounted to the For example:
|
|
|
A list of the names of secrets that are to be mounted to the For example:
|
|
|
A list of the names of config maps that are to be mounted to the For example:
|
|
|
A list of
For more information about |
|
| Indicates whether to create a connection with the runtimes inventory operator that Red Hat provides
Supported values are For example:
You can enable debug logging for the Insights client by setting the
Note: The |
Support contact information Copy linkLink copied to clipboard!
For general support queries, see https://access.redhat.com/support for more information.
If you want to report a potential security issue with Red Hat JBoss Web Server, see https://access.redhat.com/security/team/contact for more information.