Update the WebSphere Liberty operator
We can update WebSphere Liberty operator. Instructions are provided for both network-connected installations and installations in air gap environments.
Update a network-connected installation on Red Hat OpenShift
To update a network-connected installation,- Update the update channel for the WebSphere Liberty operator to v1.4. For more information, see Changing the update channel for an Operator in the Red Hat OpenShift® documentation. For patch updates, if the operator was configured with the Automatic update approval strategy, no action is needed. The WebSphere Liberty operator automatically
upgrades your installation.
If the operator was configured with the Manual update strategy, follow the instructions for Manually approving a pending operator upgrade.
Update an installation in an air gap environment
To update an installation of WebSphere Liberty operator in an air gap environment, follow these instructions.
- Mirror the WebSphere Liberty operator container images and configure a cluster.
- Download Container Application Software for Enterprises (CASE).
Run the following command to download the CASE metadata.
oc ibm-pak get $CASE_NAME --version $CASE_VERSION
For the current release of WebSphere Liberty operator,
- CASE_NAME=ibm-websphere-liberty
- CASE_VERSION is the version of WebSphere Liberty operator we want to install, for example, 1.4.4; we can see the available versions.
- Verify that we downloaded the correct
version.
oc ibm-pak list --downloaded
- Generate the mirror manifests, substituting the actual target
registry.
export TARGET_REGISTRY=my_example_registry.com oc ibm-pak generate mirror-manifests $CASE_NAME $TARGET_REGISTRY --version $CASE_VERSION
- Authenticate to all registries by following the instructions for using either podman or docker. Set the REGISTRY_AUTH_FILE environment variable appropriately.
- Mirror the images.
oc image mirror \ -f ~/.ibm-pak/data/mirror/$CASE_NAME/$CASE_VERSION/images-mapping.txt \ --filter-by-os '.*' \ -a $REGISTRY_AUTH_FILE \ --insecure \ --skip-multiple-scopes \ --max-per-registry=1
- Configure the cluster for insecure registry. Replace
TARGET_REGISTRY with the name of the registry and then run the oc patch
command.
oc patch image.config.openshift.io/cluster --type=merge \ -p '{"spec":{"registrySources":{"insecureRegistries":["'${TARGET_REGISTRY}'"]}}}'
- Update the global image pull secret for your Red Hat OpenShift cluster. Follow the instructions in Update the global cluster pull secret.
- Create the ImageContentSourcePolicy
resource.
oc apply -f ~/.ibm-pak/data/mirror/$CASE_NAME/$CASE_VERSION/image-content-source-policy.yaml
Tip: Deployment of the ImageContentSourcePolicy resource takes several minutes while each node is drained of its pods. Before you move to the next step, ensure that the status of all nodes is Ready. Run the oc get nodes command to get status.
- Wait for rollout process to finish.
Run the following command to verify that Updated is set to true.
oc get MachineConfigPool -w
- Download Container Application Software for Enterprises (CASE).
- Install the WebSphere Liberty operator.
- Set the WLO_NAMESPACE and WLO_TARGET_NAMESPACE shell variables.
For the AllNamespaces installation mode, set WLO_NAMESPACE to openshift-operators. Set WLO_TARGET_NAMESPACE to the instance namespace, for example, websphere-liberty. For a SingleNamespace installation mode, use different namespace values. For an OwnNamespace mode, set WLO_NAMESPACE to the same value as WLO_TARGET_NAMESPACE.
WLO_NAMESPACE=openshift-operators WLO_TARGET_NAMESPACE=websphere-liberty
- Create the namespaces, if needed.
For catalog namespace, openshift-marketplace exists. For an AllNamespaces installation mode, the openshift-operators namespace exists.
oc create namespace $WLO_NAMESPACE oc create namespace $WLO_TARGET_NAMESPACE
- 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
- Install operator catalog for WebSphere Liberty operator and its dependencies.
export NAMESPACE=openshift-marketplace
export CASE_INVENTORY_SETUP=websphereLibertyOperatorSetup
oc ibm-pak launch \ $CASE_NAME \ --version $CASE_VERSION \ --action install-catalog \ --inventory $CASE_INVENTORY_SETUP \ --namespace $NAMESPACE \ --args "--registry $TARGET_REGISTRY --recursive \ --inputDir ~/.ibm-pak/data/cases/$CASE_NAME/$CASE_VERSION"
- Set the WLO_NAMESPACE and WLO_TARGET_NAMESPACE shell variables.
- Update the update channel for the WebSphere Liberty operator to v1.4. For more information, see Changing the update channel for an Operator in the Red Hat OpenShift documentation. For patch updates, if the operator was configured with the Automatic update approval strategy, no action is needed. The WebSphere Liberty operator automatically
upgrades your installation.
If the operator was configured with the Manual update strategy, follow the instructions for Manually approving a pending operator upgrade.
Update in a non-OCP Kubernetes environment
To update the WebSphere Liberty operator in a non-OCP Kubernetes environment, follow the instructions in Install WebSphere Liberty operator with the Kubernetes CLI.