Chapter 3. JWS Operator installation from OperatorHub
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.
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
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
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 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
oc
tool 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
The preceding command displays the name, catalog, and age of each available Operator.
For example:
NAME CATALOG AGE jws-operator Red Hat Operators 16h
Inspect the JWS Operator to verify the supported installation modes and available channels for the Operator:
$ oc describe packagemanifests jws-operator -n openshift-marketplace
Check the actual list of Operator groups:
$ oc get operatorgroups -n <project_name>
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
If you need to create an Operator group, perform the following steps:
NoteIf the Operator you want to install uses
SingleNamespace
installation 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
AllNamespaces
installation mode or you already have an appropriate Operator group in place, you can ignore this step.Create a YAML file for the
OperatorGroup
object.For example:
apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: <operatorgroup_name> namespace: <project_name> spec: targetNamespaces: - <project_name>
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 -q
command.Create the
OperatorGroup
object from the YAML file:$ oc apply -f <filename>.yaml
In the preceding example, replace
<filename>.yaml
with the name of the YAML file that you have created for theOperatorGroup
object.
To create a Subscription object, perform the following steps:
Create a YAML file for the
Subscription
object.For example:
apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: jws-operator namespace: <project_name> spec: channel: alpha name: jws-operator source: redhat-operators sourceNamespace: openshift-marketplace
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 -q
command.The namespace that you specify must have an
OperatorGroup
object that has the same installation mode setting as the Operator. If the Operator usesAllNamespaces
installation mode, replace<project_name>
withopenshift-operators
, which already provides an appropriate Operator group. If the Operator usesSingleNamespace
installation mode, ensure that this namespace has only oneOperatorGroup
object.Ensure that the
source
setting matches theCatalog Source
value that was displayed when you verified the available channels for the Operator (for example,redhat-operators
).Create the
Subscription
object from the YAML file:$ oc apply -f <filename>.yaml
In the preceding example, replace
<filename>.yaml
with the name of the YAML file that you have created for theSubscription
object.
Verification
To verify that the JWS Operator is installed successfully, enter the following command:
$ oc get csv -n <project_name>
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:
NAME DISPLAY VERSION REPLACES PHASE jws-operator.V2.0.x
JBoss Web Server Operator
2.0.x
Succeeded
In the preceding output,
2.0.x
represents the actual Operator version (for example,2.0.0
).