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: Use the OpenShift web console . Use the oc command-line tool . 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. Note 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. Note The 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. Note If 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 . Note If 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 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 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: The preceding command displays the name, catalog, and age of each available Operator. For example: Inspect the JWS Operator to verify the supported installation modes and available channels for the Operator: Check the actual list of Operator groups: 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: If you need to create an Operator group, perform the following steps: Note If 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: 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 the oc project -q command. Create the OperatorGroup object from the YAML file: In the preceding example, replace <filename> .yaml with the name of the YAML file that you have created for the OperatorGroup object. To create a Subscription object, perform the following steps: Create a YAML file for the Subscription object. For example: 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 the oc 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 uses AllNamespaces installation mode, replace <project_name> with openshift-operators , which already provides an appropriate Operator group. If the Operator uses SingleNamespace installation mode, ensure that this namespace has only one OperatorGroup object. Ensure that the source setting matches the Catalog 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: In the preceding example, replace <filename> .yaml with the name of the YAML file that you have created for the Subscription object. Verification To verify that the JWS Operator is installed successfully, enter the following command: 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 JWS Operator 2.0. x jws-operator.v2.0. y Succeeded In the preceding output, 2.0. x represents the current Operator version (for example, 2.0.6 ), and 2.0. y represents the Operator version that the current version replaces (for example, 2.0.5 ).

Commands:
oc get packagemanifests -n openshift-marketplace | grep jws
NAME CATALOG AGE jws-operator Red Hat Operators 16h
oc describe packagemanifests jws-operator -n openshift-marketplace
oc get operatorgroups -n <project_name>
NAME AGE mygroup 17h
apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: <operatorgroup_name> namespace: <project_name> spec: targetNamespaces: - <project_name>
oc apply -f <filename> .yaml
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
oc apply -f <filename> .yaml
oc get csv -n <project_name>