Install WebSphere Liberty operator with the Red Hat OpenShift CLI
A cluster administrator can install a WebSphere Liberty operator and create an instance of WebSphere Liberty operator with the Red Hat OpenShift command-line interface (CLI).
Install prerequisites.
WebSphere Liberty operator requires an Red Hat OpenShift cluster. We need the Red Hat OpenShift Container Platform (OCP) CLI to run Red Hat OpenShift CLI (oc) commands. Also, we need the IBM Operator catalog source and the IBM Cloud Pak foundational services catalog source. The CatalogSources pods must be running.
Log in to the Red Hat OpenShift cluster as a cluster administrator.
Install the WebSphere Liberty operator
The operator supports OwnNamespace, SingleNamespace, and AllNamespaces install modes. The AllNamespaces installation mode applies to most installations.
- Set the WLO_NAMESPACE and WLO_TARGET_NAMESPACE shell
variables.
For the AllNamespaces installation mode, set WLO_NAMESPACE to openshift-operators.
WLO_NAMESPACE=openshift-operators
For SingleNamespace where the operator watches a different namespace, set WLO_NAMESPACE to the name where the operator is installed, and set WLO_TARGET_NAMESPACE to the name of the namespace to be watched.
WLO_NAMESPACE=my-wlo-namespace WLO_TARGET_NAMESPACE=websphere-liberty-target
For OwnNamespace mode, set WLO_NAMESPACE and WLO_TARGET_NAMESPACE to the same value.
WLO_NAMESPACE=my-wlo-namespace WLO_TARGET_NAMESPACE=my-wlo-namespace
- Create the namespaces, if needed.
For AllNamespaces installation mode, the openshift-operators namespace already exists.
oc create namespace $WLO_NAMESPACE
Note: For security considerations applicable at the namespace level, see Set limits with the ResourceQuota resource.
- For either an OwnNamespace or SingleNamespace installation mode, create an OperatorGroup.
Note: For the default AllNamespaces mode, skip this step.
cat <<EOF | oc apply -f - apiVersion: operators.coreos.com/v1alpha2 kind: OperatorGroup metadata: name: ibm-websphere-liberty namespace: $WLO_NAMESPACE spec: targetNamespaces: - $WLO_TARGET_NAMESPACE EOF
- Create a Subscription to install WebSphere Liberty operator.
cat <<EOF | oc apply -f - apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: ibm-websphere-liberty namespace: $WLO_NAMESPACE spec: installPlanApproval: Automatic name: ibm-websphere-liberty source: ibm-operator-catalog sourceNamespace: openshift-marketplace EOF
- To ensure that the wlo-controller-manager pod is running:
$ oc get pods -n $WLO_NAMESPACE NAME READY STATUS RESTARTS AGE wlo-controller-manager-78d89454c7-lhs72 1/1 Running 0 109s
$ oc get WebSphereLiberty -n $WLO_INSTANCE_NAMESPACE NAME READY AGE websphere-liberty False 5m39s
What to do next
Validate the installation. At your discretion, we can deploy the sample application.