This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.Chapter 3. Installing and configuring the OpenShift Update Service
For clusters with internet accessibility, Red Hat provides over-the-air updates through an OpenShift Container Platform update service as a hosted service located behind public APIs. However, clusters in a restricted network have no way to access public APIs for update information.
To provide a similar update experience in a restricted network, you can install and configure the OpenShift Update Service locally so that it is available within a disconnected environment.
The following sections describe how to provide over-the-air updates for your disconnected cluster and its underlying operating system.
3.1. Prerequisites
- For more information on installing Operators, see Installing Operators in your namespace.
3.1.1. Configuring access to a secured registry for the OpenShift update service
If the release images are contained in a secure registry, complete the steps in Configuring additional trust stores for image registry access along with following changes for the update service.
The OpenShift Update Service Operator needs the config map key name updateservice-registry
in the registry CA cert.
Image registry CA config map example for the update service
apiVersion: v1 kind: ConfigMap metadata: name: my-registry-ca data: updateservice-registry: | -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- registry-with-port.example.com..5000: | -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE-----
apiVersion: v1
kind: ConfigMap
metadata:
name: my-registry-ca
data:
updateservice-registry: |
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
registry-with-port.example.com..5000: |
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
3.1.2. Updating the global cluster pull secret
You can update the global pull secret for your cluster by either replacing the current pull secret or appending a new pull secret.
The procedure is required when users use a separate registry to store images than the registry used during installation.
Cluster resources must adjust to the new pull secret, which can temporarily limit the usability of the cluster.
Updating the global pull secret will cause node reboots while the Machine Config Operator (MCO) syncs the changes.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admin
role.
Procedure
Optional: To append a new pull secret to the existing pull secret, complete the following steps:
Enter the following command to download the pull secret:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc get secret/pull-secret -n openshift-config --template='{{index .data ".dockerconfigjson" | base64decode}}' ><pull_secret_location>
$ oc get secret/pull-secret -n openshift-config --template='{{index .data ".dockerconfigjson" | base64decode}}' ><pull_secret_location>
1 - 1
- Provide the path to the pull secret file.
Enter the following command to add the new pull secret:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc registry login --registry="<registry>" \ --auth-basic="<username>:<password>" \ --to=<pull_secret_location>
$ oc registry login --registry="<registry>" \
1 --auth-basic="<username>:<password>" \
2 --to=<pull_secret_location>
3 Alternatively, you can perform a manual update to the pull secret file.
Enter the following command to update the global pull secret for your cluster:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc set data secret/pull-secret -n openshift-config --from-file=.dockerconfigjson=<pull_secret_location>
$ oc set data secret/pull-secret -n openshift-config --from-file=.dockerconfigjson=<pull_secret_location>
1 - 1
- Provide the path to the new pull secret file.
This update is rolled out to all nodes, which can take some time depending on the size of your cluster. During this time, nodes are drained and pods are rescheduled on the remaining nodes.
3.2. Installing the OpenShift Update Service Operator
To install the OpenShift Update Service, you must first install the OpenShift Update Service Operator by using the OpenShift Container Platform web console or CLI.
For clusters that are installed on restricted networks, also known as disconnected clusters, Operator Lifecycle Manager by default cannot access the Red Hat-provided OperatorHub sources hosted on remote registries because those remote sources require full internet connectivity. For more information, see Using Operator Lifecycle Manager on restricted networks.
3.2.1. Installing the OpenShift Update Service Operator by using the web console
You can use the web console to install the OpenShift Update Service Operator.
Procedure
In the web console, click Operators
OperatorHub. NoteEnter
Update Service
into the Filter by keyword… field to find the Operator faster.Choose OpenShift Update Service from the list of available Operators, and click Install.
-
Channel
v1
is selected as the Update Channel since it is the only channel available in this release. - Select A specific namespace on the cluster under Installation Mode.
-
Select a namespace for Installed Namespace or accept the recommended namespace
openshift-update-service
. Select an Approval Strategy:
- The Automatic strategy allows Operator Lifecycle Manager (OLM) to automatically update the Operator when a new version is available.
- The Manual strategy requires a cluster administrator to approve the Operator update.
- Click Install.
-
Channel
-
Verify that the OpenShift Update Service Operator is installed by switching to the Operators
Installed Operators page. - Ensure that OpenShift Update Service is listed in the selected namespace with a Status of Succeeded.
3.2.2. Installing the OpenShift Update Service Operator by using the CLI
You can use the OpenShift CLI (oc
) to install the OpenShift Update Service Operator.
Procedure
Create a namespace for the OpenShift Update Service Operator:
Create a
Namespace
object YAML file, for example,update-service-namespace.yaml
, for the OpenShift Update Service Operator:Copy to Clipboard Copied! Toggle word wrap Toggle overflow apiVersion: v1 kind: Namespace metadata: name: openshift-update-service annotations: openshift.io/node-selector: "" labels: openshift.io/cluster-monitoring: "true"
apiVersion: v1 kind: Namespace metadata: name: openshift-update-service annotations: openshift.io/node-selector: "" labels: openshift.io/cluster-monitoring: "true"
1 - 1
- Set the
openshift.io/cluster-monitoring
label to enable Operator-recommended cluster monitoring on this namespace.
Create the namespace:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc create -f <filename>.yaml
$ oc create -f <filename>.yaml
For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc create -f update-service-namespace.yaml
$ oc create -f update-service-namespace.yaml
Install the OpenShift Update Service Operator by creating the following objects:
Create an
OperatorGroup
object YAML file, for example,update-service-operator-group.yaml
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: update-service-operator-group spec: targetNamespaces: - openshift-update-service
apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: update-service-operator-group spec: targetNamespaces: - openshift-update-service
Create an
OperatorGroup
object:Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc -n openshift-update-service create -f <filename>.yaml
$ oc -n openshift-update-service create -f <filename>.yaml
For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc -n openshift-update-service create -f update-service-operator-group.yaml
$ oc -n openshift-update-service create -f update-service-operator-group.yaml
Create a
Subscription
object YAML file, for example,update-service-subscription.yaml
:Example Subscription
Copy to Clipboard Copied! Toggle word wrap Toggle overflow apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: update-service-subscription spec: channel: v1 installPlanApproval: "Automatic" source: "redhat-operators" sourceNamespace: "openshift-marketplace" name: "cincinnati-operator"
apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: update-service-subscription spec: channel: v1 installPlanApproval: "Automatic" source: "redhat-operators"
1 sourceNamespace: "openshift-marketplace" name: "cincinnati-operator"
- 1
- Specify the name of the catalog source that provides the Operator. For clusters that do not use a custom Operator Lifecycle Manager (OLM), specify
redhat-operators
. If your OpenShift Container Platform cluster is installed on a restricted network, also known as a disconnected cluster, specify the name of theCatalogSource
object created when you configured Operator Lifecycle Manager (OLM).
Create the
Subscription
object:Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc create -f <filename>.yaml
$ oc create -f <filename>.yaml
For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc -n openshift-update-service create -f update-service-subscription.yaml
$ oc -n openshift-update-service create -f update-service-subscription.yaml
The OpenShift Update Service Operator is installed to the
openshift-update-service
namespace and targets theopenshift-update-service
namespace.
Verify the Operator installation:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc -n openshift-update-service get clusterserviceversions
$ oc -n openshift-update-service get clusterserviceversions
Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NAME DISPLAY VERSION REPLACES PHASE update-service-operator.v4.6.0 OpenShift Update Service 4.6.0 Succeeded ...
NAME DISPLAY VERSION REPLACES PHASE update-service-operator.v4.6.0 OpenShift Update Service 4.6.0 Succeeded ...
If the OpenShift Update Service Operator is listed, the installation was successful. The version number might be different than shown.
3.2.3. Creating the OpenShift Update Service graph data container image
The OpenShift Update Service requires a graph-data container image, from which the OpenShift Update Service retrieves information about channel membership and blocked update edges. Graph data is typically fetched directly from the upgrade graph data repository. In environments where an internet connection is unavailable, loading this information from an init container is another way to make the graph data available to the OpenShift Update Service. The role of the init container is to provide a local copy of the graph data, and during pod initialization, the init container copies the data to a volume that is accessible by the service.
Procedure
Create a Dockerfile, for example,
./Dockerfile
, containing the following:Copy to Clipboard Copied! Toggle word wrap Toggle overflow FROM registry.access.redhat.com/ubi8/ubi:8.1 RUN curl -L -o cincinnati-graph-data.tar.gz https://github.com/openshift/cincinnati-graph-data/archive/master.tar.gz CMD exec /bin/bash -c "tar xvzf cincinnati-graph-data.tar.gz -C /var/lib/cincinnati/graph-data/ --strip-components=1"
FROM registry.access.redhat.com/ubi8/ubi:8.1 RUN curl -L -o cincinnati-graph-data.tar.gz https://github.com/openshift/cincinnati-graph-data/archive/master.tar.gz CMD exec /bin/bash -c "tar xvzf cincinnati-graph-data.tar.gz -C /var/lib/cincinnati/graph-data/ --strip-components=1"
Use the docker file created in the above step to build a graph-data container image, for example,
registry.example.com/openshift/graph-data:latest
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow podman build -f ./Dockerfile -t registry.example.com/openshift/graph-data:latest
$ podman build -f ./Dockerfile -t registry.example.com/openshift/graph-data:latest
Push the graph-data container image created in the previous step to a repository that is accessible to the OpenShift Update Service, for example,
registry.example.com/openshift/graph-data:latest
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow podman push registry.example.com/openshift/graph-data:latest
$ podman push registry.example.com/openshift/graph-data:latest
NoteTo push a graph data image to a local registry in a restricted network, copy the graph-data container image created in the previous step to a repository that is accessible to the OpenShift Update Service. Run
oc image mirror --help
for available options.
3.2.4. Mirroring the OpenShift Container Platform image repository
The OpenShift Update Service requires a locally accessible registry containing update release payloads.
To avoid excessive memory usage by the OpenShift Update Service application, it is recommended that you mirror release images to a separate repository, as described in the following procedure.
Prerequisites
- You reviewed and completed the steps from "Mirroring images for a disconnected installation" up to but not including the section entitled Mirroring the OpenShift Container Platform image repository.
- You configured a mirror registry to use in your restricted network and can access the certificate and credentials that you configured.
- You downloaded the pull secret from the Red Hat OpenShift Cluster Manager and modified it to include authentication to your mirror repository.
If you use self-signed certificates that do not set a Subject Alternative Name, you must precede the
oc
commands in this procedure withGODEBUG=x509ignoreCN=0
. If you do not set this variable, theoc
commands will fail with the following error:Copy to Clipboard Copied! Toggle word wrap Toggle overflow x509: certificate relies on legacy Common Name field, use SANs or temporarily enable Common Name matching with GODEBUG=x509ignoreCN=0
x509: certificate relies on legacy Common Name field, use SANs or temporarily enable Common Name matching with GODEBUG=x509ignoreCN=0
Procedure
Complete the following steps on the mirror host:
- Review the OpenShift Container Platform downloads page to determine the version of OpenShift Container Platform to which you want to update and determine the corresponding tag on the Repository Tags page.
Set the required environment variables:
Export the release version:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow OCP_RELEASE=<release_version>
$ OCP_RELEASE=<release_version>
For
<release_version>
, specify the tag that corresponds to the version of OpenShift Container Platform to install, such as4.6.4
.Export the local registry name and host port:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow LOCAL_REGISTRY='<local_registry_host_name>:<local_registry_host_port>'
$ LOCAL_REGISTRY='<local_registry_host_name>:<local_registry_host_port>'
For
<local_registry_host_name>
, specify the registry domain name for your mirror repository, and for<local_registry_host_port>
, specify the port that it serves content on.Export the local repository name:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow LOCAL_REPOSITORY='<local_repository_name>'
$ LOCAL_REPOSITORY='<local_repository_name>'
For
<local_repository_name>
, specify the name of the repository to create in your registry, such asocp4/openshift4
.Export an additional local repository name to contain the release images:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow LOCAL_RELEASE_IMAGES_REPOSITORY='<local_release_images_repository_name>'
$ LOCAL_RELEASE_IMAGES_REPOSITORY='<local_release_images_repository_name>'
For
<local_release_images_repository_name>
, specify the name of the repository to create in your registry, such asocp4/openshift4-release-images
.Export the name of the repository to mirror:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow PRODUCT_REPO='openshift-release-dev'
$ PRODUCT_REPO='openshift-release-dev'
For a production release, you must specify
openshift-release-dev
.Export the path to your registry pull secret:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow LOCAL_SECRET_JSON='<path_to_pull_secret>'
$ LOCAL_SECRET_JSON='<path_to_pull_secret>'
For
<path_to_pull_secret>
, specify the absolute path to and file name of the pull secret for your mirror registry that you created.Export the release mirror:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow RELEASE_NAME="ocp-release"
$ RELEASE_NAME="ocp-release"
For a production release, you must specify
ocp-release
.Export the type of architecture for your server, such as
x86_64
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow ARCHITECTURE=<server_architecture>
$ ARCHITECTURE=<server_architecture>
Export the path to the directory to host the mirrored images:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow REMOVABLE_MEDIA_PATH=<path>
$ REMOVABLE_MEDIA_PATH=<path>
1 - 1
- Specify the full path, including the initial forward slash (
/
) character.
Mirror the version images to the mirror registry:
If your mirror host does not have internet access, take the following actions:
- Connect the removable media to a system that is connected to the Internet.
Review the images and configuration manifests to mirror:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc adm release mirror -a ${LOCAL_SECRET_JSON} \ --from=quay.io/${PRODUCT_REPO}/${RELEASE_NAME}:${OCP_RELEASE}-${ARCHITECTURE} \ --to=${LOCAL_REGISTRY}/${LOCAL_REPOSITORY} \ --to-release-image=${LOCAL_REGISTRY}/${LOCAL_RELEASE_IMAGES_REPOSITORY}:${OCP_RELEASE}-${ARCHITECTURE} --dry-run
$ oc adm release mirror -a ${LOCAL_SECRET_JSON} \ --from=quay.io/${PRODUCT_REPO}/${RELEASE_NAME}:${OCP_RELEASE}-${ARCHITECTURE} \ --to=${LOCAL_REGISTRY}/${LOCAL_REPOSITORY} \ --to-release-image=${LOCAL_REGISTRY}/${LOCAL_RELEASE_IMAGES_REPOSITORY}:${OCP_RELEASE}-${ARCHITECTURE} --dry-run
Mirror the images to a directory on the removable media:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc adm release mirror -a ${LOCAL_SECRET_JSON} --to-dir=${REMOVABLE_MEDIA_PATH}/mirror quay.io/${PRODUCT_REPO}/${RELEASE_NAME}:${OCP_RELEASE}-${ARCHITECTURE}
$ oc adm release mirror -a ${LOCAL_SECRET_JSON} --to-dir=${REMOVABLE_MEDIA_PATH}/mirror quay.io/${PRODUCT_REPO}/${RELEASE_NAME}:${OCP_RELEASE}-${ARCHITECTURE}
Take the media to the restricted network environment and upload the images to the local container registry:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc image mirror -a ${LOCAL_SECRET_JSON} --from-dir=${REMOVABLE_MEDIA_PATH}/mirror "file://openshift/release:${OCP_RELEASE}*" ${LOCAL_REGISTRY}/${LOCAL_REPOSITORY}
$ oc image mirror -a ${LOCAL_SECRET_JSON} --from-dir=${REMOVABLE_MEDIA_PATH}/mirror "file://openshift/release:${OCP_RELEASE}*" ${LOCAL_REGISTRY}/${LOCAL_REPOSITORY}
1 - 1
- For
REMOVABLE_MEDIA_PATH
, you must use the path where you mounted the removable media.
Mirror the release image to a separate repository:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc image mirror -a ${LOCAL_SECRET_JSON} ${LOCAL_REGISTRY}/${LOCAL_REPOSITORY}:${OCP_RELEASE}-${ARCHITECTURE} ${LOCAL_REGISTRY}/${LOCAL_RELEASE_IMAGES_REPOSITORY}:${OCP_RELEASE}-${ARCHITECTURE}
$ oc image mirror -a ${LOCAL_SECRET_JSON} ${LOCAL_REGISTRY}/${LOCAL_REPOSITORY}:${OCP_RELEASE}-${ARCHITECTURE} ${LOCAL_REGISTRY}/${LOCAL_RELEASE_IMAGES_REPOSITORY}:${OCP_RELEASE}-${ARCHITECTURE}
If the local container registry is connected to the mirror host, push the release images directly to the local registry:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc adm release mirror -a ${LOCAL_SECRET_JSON} \ --from=quay.io/${PRODUCT_REPO}/${RELEASE_NAME}:${OCP_RELEASE}-${ARCHITECTURE} \ --to=${LOCAL_REGISTRY}/${LOCAL_REPOSITORY} \ --to-release-image=${LOCAL_REGISTRY}/${LOCAL_RELEASE_IMAGES_REPOSITORY}:${OCP_RELEASE}-${ARCHITECTURE}
$ oc adm release mirror -a ${LOCAL_SECRET_JSON} \ --from=quay.io/${PRODUCT_REPO}/${RELEASE_NAME}:${OCP_RELEASE}-${ARCHITECTURE} \ --to=${LOCAL_REGISTRY}/${LOCAL_REPOSITORY} \ --to-release-image=${LOCAL_REGISTRY}/${LOCAL_RELEASE_IMAGES_REPOSITORY}:${OCP_RELEASE}-${ARCHITECTURE}
3.3. Creating an OpenShift Update Service application
You can create an OpenShift Update Service application by using the OpenShift Container Platform web console or CLI.
3.3.1. Creating an OpenShift Update Service application by using the web console
You can use the OpenShift Container Platform web console to create an OpenShift Update Service application by using the OpenShift Update Service Operator.
Prerequisites
- The OpenShift Update Service Operator has been installed.
- The OpenShift Update Service graph-data container image has been created and pushed to a repository that is accessible to the OpenShift Update Service.
- The current release and update target releases have been mirrored to a locally accessible registry.
Procedure
-
In the web console, click Operators
Installed Operators. - Choose OpenShift Update Service from the list of installed Operators.
- Click the Update Service tab.
- Click Create UpdateService.
-
Enter a name in the Name field, for example,
service
. -
Enter the local pullspec in the Graph Data Image field to the graph-data container image created in "Creating the OpenShift Update Service graph data container image", for example,
registry.example.com/openshift/graph-data:latest
. -
In the Releases field, enter the local registry and repository created to contain the release images in "Mirroring the OpenShift Container Platform image repository", for example,
registry.example.com/ocp4/openshift4-release-images
. -
Enter
2
in the Replicas field. - Click Create to create the OpenShift Update Service application.
Verify the OpenShift Update Service application:
- From the UpdateServices list in the Update Service tab, click the Update Service application just created.
- Click the Resources tab.
- Verify each application resource has a status of Created.
3.3.2. Creating an OpenShift Update Service application by using the CLI
You can use the OpenShift CLI (oc
) to create an OpenShift Update Service application.
Prerequisites
- The OpenShift Update Service Operator has been installed.
- The OpenShift Update Service graph-data container image has been created and pushed to a repository that is accessible to the OpenShift Update Service.
- The current release and update target releases have been mirrored to a locally accessible registry.
Procedure
Configure the OpenShift Update Service target namespace, for example,
openshift-update-service
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NAMESPACE=openshift-update-service
$ NAMESPACE=openshift-update-service
The namespace must match the
targetNamespaces
value from the operator group.Configure the name of the OpenShift Update Service application, for example,
service
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NAME=service
$ NAME=service
Configure the local registry and repository for the release images as configured in "Mirroring the OpenShift Container Platform image repository", for example,
registry.example.com/ocp4/openshift4-release-images
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow RELEASE_IMAGES=registry.example.com/ocp4/openshift4-release-images
$ RELEASE_IMAGES=registry.example.com/ocp4/openshift4-release-images
Set the local pullspec for the graph-data image to the graph-data container image created in "Creating the OpenShift Update Service graph data container image", for example,
registry.example.com/openshift/graph-data:latest
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow GRAPH_DATA_IMAGE=registry.example.com/openshift/graph-data:latest
$ GRAPH_DATA_IMAGE=registry.example.com/openshift/graph-data:latest
Create an OpenShift Update Service application object:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc -n "${NAMESPACE}" create -f - <<EOF apiVersion: updateservice.operator.openshift.io/v1 kind: UpdateService metadata: name: ${NAME} spec: replicas: 2 releases: ${RELEASE_IMAGES} graphDataImage: ${GRAPH_DATA_IMAGE} EOF
$ oc -n "${NAMESPACE}" create -f - <<EOF apiVersion: updateservice.operator.openshift.io/v1 kind: UpdateService metadata: name: ${NAME} spec: replicas: 2 releases: ${RELEASE_IMAGES} graphDataImage: ${GRAPH_DATA_IMAGE} EOF
Verify the OpenShift Update Service application:
Use the following command to obtain a policy engine route:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow while sleep 1; do POLICY_ENGINE_GRAPH_URI="$(oc -n "${NAMESPACE}" get -o jsonpath='{.status.policyEngineURI}/api/upgrades_info/v1/graph{"\n"}' updateservice "${NAME}")"; SCHEME="${POLICY_ENGINE_GRAPH_URI%%:*}"; if test "${SCHEME}" = http -o "${SCHEME}" = https; then break; fi; done
$ while sleep 1; do POLICY_ENGINE_GRAPH_URI="$(oc -n "${NAMESPACE}" get -o jsonpath='{.status.policyEngineURI}/api/upgrades_info/v1/graph{"\n"}' updateservice "${NAME}")"; SCHEME="${POLICY_ENGINE_GRAPH_URI%%:*}"; if test "${SCHEME}" = http -o "${SCHEME}" = https; then break; fi; done
You might need to poll until the command succeeds.
Retrieve a graph from the policy engine. Be sure to specify a valid version for
channel
. For example, if running in OpenShift Container Platform 4.6, usestable-4.6
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow while sleep 10; do HTTP_CODE="$(curl --header Accept:application/json --output /dev/stderr --write-out "%{http_code}" "${POLICY_ENGINE_GRAPH_URI}?channel=stable-4.6")"; if test "${HTTP_CODE}" -eq 200; then break; fi; echo "${HTTP_CODE}"; done
$ while sleep 10; do HTTP_CODE="$(curl --header Accept:application/json --output /dev/stderr --write-out "%{http_code}" "${POLICY_ENGINE_GRAPH_URI}?channel=stable-4.6")"; if test "${HTTP_CODE}" -eq 200; then break; fi; echo "${HTTP_CODE}"; done
This polls until the graph request succeeds; however, the resulting graph might be empty depending on which release images you have mirrored.
The policy engine route name must not be more than 63 characters based on RFC-1123. If you see ReconcileCompleted
status as false
with the reason CreateRouteFailed
caused by host must conform to DNS 1123 naming convention and must be no more than 63 characters
, try creating the Update Service with a shorter name.
3.3.3. Configuring the Cluster Version Operator (CVO)
After the OpenShift Update Service Operator has been installed and the OpenShift Update Service application has been created, the Cluster Version Operator (CVO) can be updated to pull graph data from the locally installed OpenShift Update Service.
Prerequisites
- The OpenShift Update Service Operator has been installed.
- The OpenShift Update Service graph-data container image has been created and pushed to a repository that is accessible to the OpenShift Update Service.
- The current release and update target releases have been mirrored to a locally accessible registry.
- The OpenShift Update Service application has been created.
Procedure
Set the OpenShift Update Service target namespace, for example,
openshift-update-service
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NAMESPACE=openshift-update-service
$ NAMESPACE=openshift-update-service
Set the name of the OpenShift Update Service application, for example,
service
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NAME=service
$ NAME=service
Obtain the policy engine route:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow POLICY_ENGINE_GRAPH_URI="$(oc -n "${NAMESPACE}" get -o jsonpath='{.status.policyEngineURI}/api/upgrades_info/v1/graph{"\n"}' updateservice "${NAME}")"
$ POLICY_ENGINE_GRAPH_URI="$(oc -n "${NAMESPACE}" get -o jsonpath='{.status.policyEngineURI}/api/upgrades_info/v1/graph{"\n"}' updateservice "${NAME}")"
Set the patch for the pull graph data:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow PATCH="{\"spec\":{\"upstream\":\"${POLICY_ENGINE_GRAPH_URI}\"}}"
$ PATCH="{\"spec\":{\"upstream\":\"${POLICY_ENGINE_GRAPH_URI}\"}}"
Patch the CVO to use the local OpenShift Update Service:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc patch clusterversion version -p $PATCH --type merge
$ oc patch clusterversion version -p $PATCH --type merge
See Enabling the cluster-wide proxy to configure the CA to trust the update server.
3.4. Deleting an OpenShift Update Service application
You can delete an OpenShift Update Service application by using the OpenShift Container Platform web console or CLI.
3.4.1. Deleting an OpenShift Update Service application by using the web console
You can use the OpenShift Container Platform web console to delete an OpenShift Update Service application by using the OpenShift Update Service Operator.
Prerequisites
- The OpenShift Update Service Operator has been installed.
Procedure
-
In the web console, click Operators
Installed Operators. - Choose OpenShift Update Service from the list of installed Operators.
- Click the Update Service tab.
- From the list of installed OpenShift Update Service applications, select the application to be deleted and then click Delete UpdateService.
- From the Delete UpdateService? confirmation dialog, click Delete to confirm the deletion.
3.4.2. Deleting an OpenShift Update Service application by using the CLI
You can use the OpenShift CLI (oc
) to delete an OpenShift Update Service application.
Procedure
Get the OpenShift Update Service application name using the namespace the OpenShift Update Service application was created in, for example,
openshift-update-service
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc get updateservice -n openshift-update-service
$ oc get updateservice -n openshift-update-service
Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NAME AGE service 6s
NAME AGE service 6s
Delete the OpenShift Update Service application using the
NAME
value from the previous step and the namespace the OpenShift Update Service application was created in, for example,openshift-update-service
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc delete updateservice service -n openshift-update-service
$ oc delete updateservice service -n openshift-update-service
Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow updateservice.updateservice.operator.openshift.io "service" deleted
updateservice.updateservice.operator.openshift.io "service" deleted
3.5. Uninstalling the OpenShift Update Service Operator
To uninstall the OpenShift Update Service, you must first delete all OpenShift Update Service applications by using the OpenShift Container Platform web console or CLI.
3.5.1. Uninstalling the OpenShift Update Service Operator by using the web console
You can use the OpenShift Container Platform web console to uninstall the OpenShift Update Service Operator.
Prerequisites
- All OpenShift Update Service applications have been deleted.
Procedure
-
In the web console, click Operators
Installed Operators. - Select OpenShift Update Service from the list of installed Operators and click Uninstall Operator.
- From the Uninstall Operator? confirmation dialog, click Uninstall to confirm the uninstallation.
3.5.2. Uninstalling the OpenShift Update Service Operator by using the CLI
You can use the OpenShift CLI (oc
) to uninstall the OpenShift Update Service Operator.
Prerequisites
- All OpenShift Update Service applications have been deleted.
Procedure
Change to the project containing the OpenShift Update Service Operator, for example,
openshift-update-service
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc project openshift-update-service
$ oc project openshift-update-service
Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Now using project "openshift-update-service" on server "https://example.com:6443".
Now using project "openshift-update-service" on server "https://example.com:6443".
Get the name of the OpenShift Update Service Operator operator group:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc get operatorgroup
$ oc get operatorgroup
Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NAME AGE openshift-update-service-fprx2 4m41s
NAME AGE openshift-update-service-fprx2 4m41s
Delete the operator group, for example,
openshift-update-service-fprx2
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc delete operatorgroup openshift-update-service-fprx2
$ oc delete operatorgroup openshift-update-service-fprx2
Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow operatorgroup.operators.coreos.com "openshift-update-service-fprx2" deleted
operatorgroup.operators.coreos.com "openshift-update-service-fprx2" deleted
Get the name of the OpenShift Update Service Operator subscription:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc get subscription
$ oc get subscription
Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NAME PACKAGE SOURCE CHANNEL update-service-operator update-service-operator updateservice-index-catalog v1
NAME PACKAGE SOURCE CHANNEL update-service-operator update-service-operator updateservice-index-catalog v1
Using the
Name
value from the previous step, check the current version of the subscribed OpenShift Update Service Operator in thecurrentCSV
field:Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc get subscription update-service-operator -o yaml | grep " currentCSV"
$ oc get subscription update-service-operator -o yaml | grep " currentCSV"
Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow currentCSV: update-service-operator.v0.0.1
currentCSV: update-service-operator.v0.0.1
Delete the subscription, for example,
update-service-operator
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc delete subscription update-service-operator
$ oc delete subscription update-service-operator
Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow subscription.operators.coreos.com "update-service-operator" deleted
subscription.operators.coreos.com "update-service-operator" deleted
Delete the CSV for the OpenShift Update Service Operator using the
currentCSV
value from the previous step:Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc delete clusterserviceversion update-service-operator.v0.0.1
$ oc delete clusterserviceversion update-service-operator.v0.0.1
Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow clusterserviceversion.operators.coreos.com "update-service-operator.v0.0.1" deleted
clusterserviceversion.operators.coreos.com "update-service-operator.v0.0.1" deleted