Este conteúdo não está disponível no idioma selecionado.
Chapter 14. Updating OpenShift Container Storage
14.1. Overview of the OpenShift Container Storage update process Copiar o linkLink copiado para a área de transferência!
You can upgrade Red Hat OpenShift Container Storage and its components, either between minor releases like 4.5 and 4.6, or between batch updates like 4.6.0 and 4.6.1.
You need to upgrade the different parts of OpenShift Container Storage in a specific order.
- Update OpenShift Container Platform according to the Updating clusters documentation for OpenShift Container Platform.
Update OpenShift Container Storage.
Update the OpenShift Container Storage operator, using the appropriate process for your setup:
- To prepare a disconnected or proxy environment for updates, see Operators guide to using Operator Lifecycle Manager on restricted networks.
- Update OpenShift Container Storage in internal mode
Update considerations
Review the following important considerations before you begin.
Red Hat recommends using the same version of Red Hat OpenShift Container Platform with Red Hat OpenShift Container Storage.
See the Interoperability Matrix for more information about supported combinations of OpenShift Container Platform and OpenShift Container Storage.
- The Local Storage Operator is fully supported only when the Local Storage Operator version matches the Red Hat OpenShift Container Platform version.
14.2. Preparing to update in a disconnected environment Copiar o linkLink copiado para a área de transferência!
When your Red Hat OpenShift Container Storage environment is not directly connected to the internet, some additional configuration is required to provide the Operator Lifecycle Manager (OLM) with alternatives to the default Operator Hub and image registries.
See the OpenShift Container Platform documentation for more general information: Updating an Operator catalog image.
To configure your cluster for disconnected update:
When these steps are complete, Continue with update as usual.
14.2.1. Adding mirror registry authentication details Copiar o linkLink copiado para a área de transferência!
Prerequisites
- Verify that your existing disconnected cluster uses OpenShift Container Platform 4.3 or higher.
-
Verify that you have an
oc clientversion of 4.4 or higher. - Prepare a mirror host with a mirror registry. See Preparing your mirror host for details.
Procedure
-
Log in to the OpenShift Container Platform cluster using the
cluster-adminrole. Locate your
auth.jsonfile.This file is generated when you use podman or docker to log in to a registry. It is located in one of the following locations:
-
~/.docker/auth.json -
/run/user/<UID>/containers/auth.json -
/var/run/containers/<UID>/auth.json
-
Obtain your unique Red Hat registry pull secret and paste it into your
auth.jsonfile. It will look something like this.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Export environment variables with the appropriate details for your setup.
export AUTH_FILE="<location_of_auth.json>" export MIRROR_REGISTRY_DNS="<your_registry_url>:<port>"
$ export AUTH_FILE="<location_of_auth.json>" $ export MIRROR_REGISTRY_DNS="<your_registry_url>:<port>"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use
podmanto log in to the mirror registry and store the credentials in the${AUTH_FILE}.podman login ${MIRROR_REGISTRY_DNS} --tls-verify=false --authfile ${AUTH_FILE}$ podman login ${MIRROR_REGISTRY_DNS} --tls-verify=false --authfile ${AUTH_FILE}Copy to Clipboard Copied! Toggle word wrap Toggle overflow This adds the mirror registry to the
auth.jsonfile.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
14.2.2. Building and mirroring the Red Hat operator catalog Copiar o linkLink copiado para a área de transferência!
Follow this process on a host that has access to Red Hat registries to create a mirror of those registries.
Prerequisites
- Run these commands as a cluster administrator.
-
Be aware that mirroring the
redhat-operatorcatalog can take hours to complete, and requires substantial available disk space on the mirror host.
Procedure
Build the catalog for
redhat-operators.Set
--fromto theose-operator-registrybase image using the tag that matches the target OpenShift Container Platform cluster major and minor version.oc adm catalog build --appregistry-org redhat-operators \ --from=registry.redhat.io/openshift4/ose-operator-registry:v4.6 \ --from=registry.redhat.io/openshift4/ose-operator-registry:v4.6 \ --to=${MIRROR_REGISTRY_DNS}/olm/redhat-operators:v2 \ --to=${MIRROR_REGISTRY_DNS}/olm/redhat-operators:v2 \ --registry-config=${AUTH_FILE} \ --registry-config=${AUTH_FILE} \ --filter-by-os="linux/amd64" --insecure --filter-by-os="linux/amd64" --insecure$ oc adm catalog build --appregistry-org redhat-operators \ --from=registry.redhat.io/openshift4/ose-operator-registry:v4.6 \ --to=${MIRROR_REGISTRY_DNS}/olm/redhat-operators:v2 \ --registry-config=${AUTH_FILE} \ --filter-by-os="linux/amd64" --insecureCopy to Clipboard Copied! Toggle word wrap Toggle overflow Mirror the catalog for
redhat-operators.This is a long operation and can take 1-5 hours. Make sure there is 100 GB available disk space on the mirror host.
oc adm catalog mirror ${MIRROR_REGISTRY_DNS}/olm/redhat-operators:v2 \ ${MIRROR_REGISTRY_DNS} --registry-config=${AUTH_FILE} --insecure ${MIRROR_REGISTRY_DNS} --registry-config=${AUTH_FILE} --insecure$ oc adm catalog mirror ${MIRROR_REGISTRY_DNS}/olm/redhat-operators:v2 \ ${MIRROR_REGISTRY_DNS} --registry-config=${AUTH_FILE} --insecureCopy to Clipboard Copied! Toggle word wrap Toggle overflow
14.2.3. Creating Operator imageContentSourcePolicy Copiar o linkLink copiado para a área de transferência!
After the oc adm catalog mirror command is completed, the imageContentSourcePolicy.yaml file gets created. The output directory for this file is usually, ./[catalog image name]-manifests). Use this procedure to add any missing entries to the .yaml file and apply them to cluster.
Procedure
Check the content of this file for the mirrors mapping shown as follows:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Add any missing entries to the end of the
imageContentSourcePolicy.yamlfile. Apply the imageContentSourcePolicy.yaml file to the cluster.
oc apply -f ./[output dir]/imageContentSourcePolicy.yaml
$ oc apply -f ./[output dir]/imageContentSourcePolicy.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Once the Image Content Source Policy is updated, all the nodes (master, infra, and workers) in the cluster need to be updated and rebooted. This process is automatically handled through the Machine Config Pool operator and take up to 30 minutes although the exact elapsed time might vary based on the number of nodes in your OpenShift cluster. You can monitor the update process by using the
oc get mcpcommand or theoc get nodecommand.
14.2.4. Updating redhat-operator CatalogSource Copiar o linkLink copiado para a área de transferência!
Procedure
Recreate a
CatalogSourceobject that references the catalog image for Red Hat operators.NoteMake sure you have mirrored the correct catalog source with the correct version (that is,
v2).Save the following in a
redhat-operator-catalogsource.yamlfile, remembering to replace <your_registry> with your mirror registry URL:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a catalogsource using the redhat-operator-catalogsource.yaml file:
oc apply -f redhat-operator-catalogsource.yaml
$ oc apply -f redhat-operator-catalogsource.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the new
redhat-operatorpod is running.oc get pod -n openshift-marketplace | grep redhat-operators
$ oc get pod -n openshift-marketplace | grep redhat-operatorsCopy to Clipboard Copied! Toggle word wrap Toggle overflow
14.2.5. Continue to update Copiar o linkLink copiado para a área de transferência!
After your alternative catalog source is configured, you can continue to the appropriate update process:
14.3. Updating OpenShift Container Storage in internal mode Copiar o linkLink copiado para a área de transferência!
Use the following procedures to update your OpenShift Container Storage cluster deployed in internal mode.
14.3.1. Enabling automatic updates for OpenShift Container Storage operator in internal mode Copiar o linkLink copiado para a área de transferência!
Use this procedure to enable automatic update approval for updating OpenShift Container Storage operator in OpenShift Container Platform.
Prerequisites
- Under Persistent Storage in the Status card, confirm that the OCS Cluster and Data Resiliency has a green tick mark.
-
Under Object Service in the Status card, confirm that both the Object Service and Data Resiliency are in
Readystate (green tick). - Update the OpenShift Container Platform cluster to the latest stable release of version 4.5.X or 4.6.Y, see Updating Clusters.
Switch the Red Hat OpenShift Container Storage channel from
stable-4.5tostable-4.6. For details about channels, see OpenShift Container Storage upgrade channels and releases.NoteYou are required to switch channels only when you are updating minor versions (for example, updating from 4.5 to 4.6) and not when updating between batch updates of 4.6 (for example, updating from 4.6.0 to 4.6.1).
Ensure that all OpenShift Container Storage Pods, including the operator pods, are in
Runningstate in theopenshift-storage namespace.To view the state of the pods, click Workloads
Pods from the left pane of the OpenShift Web Console. Select openshift-storage from the Project drop down list. - Ensure that you have sufficient time to complete the Openshift Container Storage update process, as the update time varies depending on the number of OSDs that run in the cluster.
Procedure
- Log in to OpenShift Web Console.
-
Click Operators
Installed Operators -
Select the
openshift-storageproject. - Click the OpenShift Container Storage operator name.
- Click the Subscription tab and click the link under Approval.
- Select Automatic (default) and click Save.
Perform one of the following depending on the Upgrade Status:
Upgrade Status shows requires approval.
NoteUpgrade status shows requires approval if the new OpenShift Container Storage version is already detected in the channel, and approval strategy was changed from Manual to Automatic at the time of update.
- Click on the Install Plan link.
- On the InstallPlan Details page, click Preview Install Plan.
- Review the install plan and click Approve.
- Wait for the Status to change from Unknown to Created.
-
Click Operators
Installed Operators -
Select the
openshift-storageproject. - Wait for the Status to change to Up to date
Upgrade Status does not show requires approval:
- Wait for the update to initiate. This may take up to 20 minutes.
-
Click Operators
Installed Operators -
Select the
openshift-storageproject. - Wait for the Status to change to Up to date
Verification steps
-
Click Overview
Persistent Storage tab and in the Status card confirm that the OCS Cluster and Data Resiliency has a green tick mark indicating it is healthy. -
Click Overview
Object Service tab and in the Status card confirm that both the Object Service and Data Resiliency are in Readystate (green tick) indicating it is healthy. Click Operators
Installed Operators OpenShift Container Storage Operator. Under Storage Cluster, verify that the cluster service status is Ready.NoteOnce updated from OpenShift Container Storage version 4.5 to 4.6, the
Versionfield here will still display 4.5. This is because theocs-operatordoes not update the string represented in this field.Ensure that all OpenShift Container Storage Pods, including the operator pods, are in
Runningstate in theopenshift-storage namespace.To view the state of the pods, click Workloads
Pods. Select openshift-storage from the Project drop down list. - If verification steps fail, contact Red Hat Support.
Additional Resources
If you face any issues while updating OpenShift Container Storage, see the Commonly required logs for troubleshooting section in the Troubleshooting guide.
14.3.2. Manually updating OpenShift Container Storage operator in internal mode Copiar o linkLink copiado para a área de transferência!
Use this procedure to update OpenShift Container Storage operator by providing manual approval to the install plan.
Prerequisites
- Under Persistent Storage in the Status card, confirm that the OCS Cluster and Data Resiliency has a green tick mark.
-
Under Object Service in the Status card, confirm that both the Object Service and Data Resiliency are in
Readystate (green tick). - Update the OpenShift Container Platform cluster to the latest stable release of version 4.5.X or 4.6.Y, see Updating Clusters.
Switch the Red Hat OpenShift Container Storage channel from
stable-4.5tostable-4.6. For details about channels, see OpenShift Container Storage upgrade channels and releases.NoteYou are required to switch channels only when you are updating minor versions (for example, updating from 4.5 to 4.6) and not when updating between batch updates of 4.6 (for example, updating from 4.6.0 to 4.6.1).
Ensure that all OpenShift Container Storage Pods, including the operator pods, are in
Runningstate in theopenshift-storage namespace.To view the state of the pods, click Workloads
Pods from the left pane of the OpenShift Web Console. Select openshift-storage from the Project drop down list. - Ensure that you have sufficient time to complete the Openshift Container Storage update process, as the update time varies depending on the number of OSDs that run in the cluster.
Procedure
- Log in to OpenShift Web Console.
-
Click Operators
Installed Operators -
Select the
openshift-storageproject. - Click the OpenShift Container Storage operator name.
- Click the Subscription tab and click the link under Approval.
- Select Manual and click Save.
- Wait for the Upgrade Status to change to Upgrading.
- If the Upgrade Status shows requires approval, click on requires approval.
- On the InstallPlan Details page, click Preview Install Plan.
- Review the install plan and click Approve.
- Wait for the Status to change from Unknown to Created.
-
Click Operators
Installed Operators -
Select the
openshift-storageproject. - Wait for the Status to change to Up to date
Verification steps
-
Click Overview
Persistent Storage tab and in the Status card confirm that the OCS Cluster and Data Resiliency has a green tick mark indicating it is healthy. -
Click Overview
Object Service tab and in the Status card confirm that both the Object Service and Data Resiliency are in Readystate (green tick) indicating it is healthy. Click Operators
Installed Operators OpenShift Container Storage Operator. Under Storage Cluster, verify that the cluster service status is Ready.NoteOnce updated from OpenShift Container Storage version 4.5 to 4.6, the
Versionfield here will still display 4.5. This is because theocs-operatordoes not update the string represented in this field.Ensure that all OpenShift Container Storage Pods, including the operator pods, are in
Runningstate in theopenshift-storage namespace.To view the state of the pods, click Workloads
Pods from the left pane of the OpenShift Web Console. Select openshift-storage from the Project drop down list. - If verification steps fail, contact Red Hat Support.
Additional Resources
If you face any issues while updating OpenShift Container Storage, see the Commonly required logs for troubleshooting section in the Troubleshooting guide.