Skip to content

Commit 00f8832

Browse files
author
Bob Furu
authored
Merge pull request #29630 from jottofar/update-service-doc
2 parents 598d279 + 5558a0e commit 00f8832

18 files changed

+805
-34
lines changed

_topic_map.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,10 @@ Name: Updating clusters
393393
Dir: updating
394394
Distros: openshift-origin,openshift-enterprise
395395
Topics:
396-
- Name: Understanding the update service
396+
- Name: Understanding the OpenShift Update Service
397397
File: understanding-the-update-service
398+
- Name: Installing and configuring the OpenShift Update Service
399+
File: installing-update-service
398400
- Name: Updating a cluster between minor versions
399401
File: updating-cluster-between-minor
400402
- Name: Updating a cluster within a minor version from the web console

modules/update-restricted.adoc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77

88
Update the restricted network cluster to the {product-title} version that you downloaded the release images for.
99

10+
//TODO: Add xrefs in the following note when functionality is enabled.
11+
12+
[NOTE]
13+
====
14+
If you have a local OpenShift Update Service, you can update by using the connected web console or CLI instructions instead of this procedure.
15+
====
16+
1017
.Prerequisites
1118

1219
* You mirrored the images for the new release to your registry.
@@ -28,5 +35,5 @@ If you use an `ImageContentSourcePolicy` for the mirror registry, you can use th
2835
+
2936
[NOTE]
3037
====
31-
You can only configure global pull secrets for clusters that have an `ImageContentSourcePolicy` object. You cannot add a pull secret to a project.
38+
You can only configure global pull secrets for clusters that have an `ImageContentSourcePolicy` object. You cannot add a pull secret to a project.
3239
====
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[id="update-service-configure-cvo"]
2+
= Configuring the Cluster Version Operator (CVO)
3+
4+
After the OpenShift Update Service Operator has been installed and the OpenShift Update Service application created CVO can be updated to pull graph data from the locally installed OpenShift Update Service.
5+
6+
.Prerequisites
7+
8+
* The OpenShift Update Service Operator has been installed.
9+
* The Openshift Update Service graph-data container image has been created and pushed to a repository accessible to the OpenShift Update Service.
10+
* The current release and update target releases have been mirrored to a locally accessible registry.
11+
* The OpenShift Update Service application has been created.
12+
13+
.Procedure
14+
15+
. Set the OpenShift Update Service target namespace, for example, `openshift-update-service`:
16+
+
17+
[source,terminal]
18+
----
19+
$ NAMESPACE=openshift-update-service
20+
----
21+
22+
. Set the name of the OpenShift Update Service application, for example, `service`:
23+
+
24+
[source,terminal]
25+
----
26+
$ NAME=service
27+
----
28+
29+
. Obtain the policy engine route:
30+
+
31+
[source,terminal]
32+
----
33+
$ POLICY_ENGINE_GRAPH_URI="$(oc -n "${NAMESPACE}" get -o jsonpath='{.status.policyEngineURI}/api/upgrades_info/v1/graph{"\n"}' updateservice "${NAME}")"
34+
----
35+
36+
. Patch the CVO ClusterVersion to use the local OpenShift Update Service:
37+
+
38+
[source,terminal]
39+
----
40+
$ PATCH="{\"spec\":{\"upstream\":\"${POLICY_ENGINE_GRAPH_URI}\"}}"
41+
$ oc patch clusterversion version -p $PATCH --type merge
42+
----
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
[id="update-service-create-service-cli_{context}"]
2+
= Creating an OpenShift Update Service application by using the CLI
3+
4+
You can use the {product-title} CLI to create an OpenShift Update Service application.
5+
6+
.Prerequisites
7+
8+
* The OpenShift Update Service Operator has already been installed.
9+
* The Openshift Update Service graph-data container image has already been created and pushed to a repository accessible to the OpenShift Update Service.
10+
* The current release and update target releases have already been mirrored to a locally accessible registry.
11+
12+
.Procedure
13+
14+
To create an OpenShift Update Service application by using the {product-title} CLI:
15+
16+
. Configure the OpenShift Update Service target namespace, for example, `openshift-update-service`:
17+
+
18+
[source,terminal]
19+
----
20+
$ NAMESPACE=openshift-update-service
21+
----
22+
+
23+
The namespace must match the `targetNamespaces` value from the OperatorGroup.
24+
25+
. Configure the name of the OpenShift Update Service application, for example, `service`:
26+
+
27+
[source,terminal]
28+
----
29+
$ NAME=service
30+
----
31+
32+
. Configure the local registry and repository for the release images as configured in "Mirroring the {product-title} image repository", for example, `registry.example.com/ocp4/openshift4-release-images`:
33+
//TODO: Add xref to the preceding step when allowed.
34+
+
35+
[source,terminal]
36+
----
37+
$ RELEASE_IMAGES=registry.example.com/ocp4/openshift4-release-images
38+
----
39+
40+
. 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`:
41+
//TODO: Add xref to the preceding step when allowed.
42+
+
43+
[source,terminal]
44+
----
45+
$ GRAPH_DATA_IMAGE=registry.example.com/openshift/graph-data:latest
46+
----
47+
48+
. Create an OpenShift Update Service application object:
49+
+
50+
[source,terminal]
51+
----
52+
$ oc -n "${NAMESPACE}" create -f - <<EOF
53+
apiVersion: updateservice.operator.openshift.io/v1
54+
kind: UpdateService
55+
metadata:
56+
name: ${NAME}
57+
spec:
58+
replicas: 2
59+
releases: ${RELEASE_IMAGES}
60+
graphDataImage: ${GRAPH_DATA_IMAGE}
61+
EOF
62+
----
63+
64+
. Verify the OpenShift Update Service application:
65+
66+
.. Use the following command to obtain a policy engine route:
67+
+
68+
[source,terminal]
69+
----
70+
$ 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
71+
----
72+
+
73+
You might need to poll until the command succeeds.
74+
75+
.. Retrieve a graph from the policy engine. Be sure to specify a valid version for *channel*. For example, if running in {product-title} {product-version} use version {product-version}, e.g. *stable-{product-version}*:
76+
+
77+
[source,terminal]
78+
----
79+
$ 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
80+
----
81+
+
82+
This polls until the graph request succeeds, although depending on which release images you have mirrored, the resulting graph might be empty.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[id="update-service-create-service-web-console_{context}"]
2+
= Creating an OpenShift Update Service application by using the web console
3+
4+
You can use the {product-title} web console to create an Update Service application by using the OpenShift Update Service Operator.
5+
6+
.Prerequisites
7+
8+
* The OpenShift Update Service Operator has already been installed.
9+
* The Openshift Update Service graph-data container image has already been created and pushed to a repository accessible to the OpenShift Update Service.
10+
* The current release and update target releases have already been mirrored to a locally accessible registry.
11+
12+
.Procedure
13+
14+
To create an OpenShift Update Service application by using the {product-title} web console:
15+
16+
. In the {product-title} web console, click *Operators* -> *Installed Operators*.
17+
18+
. Choose *OpenShift Update Service* from the list of installed Operators.
19+
20+
. Click the *Update Service* tab.
21+
22+
. Click *Create UpdateService*.
23+
24+
. Enter a name in the *Name* field, for example, `service`.
25+
26+
. 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`.
27+
//TODO: Add xref to preceding step when allowed.
28+
29+
. 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`.
30+
//TODO: Add xref to preceding step when allowed.
31+
32+
. Enter `2` in the *Replicas* field.
33+
34+
. Click *Create* to create the OpenShift Update Service application.
35+
36+
. Verify the OpenShift Update Service application:
37+
38+
** From the *UpdateServices* list in the *Update Service* tab, click the Update Service application just created.
39+
40+
** Click the *Resources* tab.
41+
42+
** Verify each application resource has status *Created*.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[id="update-service-delete-service-cli_{context}"]
2+
= Deleting an OpenShift Update Service application by using the CLI
3+
4+
You can use the {product-title} CLI to delete an OpenShift Update Service application.
5+
6+
.Procedure
7+
8+
To delete an OpenShift Update Service application by using the {product-title} CLI:
9+
10+
. Get the OpenShift Update Service application name using the namespace the OpenShift Update Service application was created in, for example, `openshift-update-service`:
11+
+
12+
[source,terminal]
13+
----
14+
$ oc get updateservice -n openshift-update-service
15+
----
16+
+
17+
.Example output
18+
[source,terminal]
19+
----
20+
NAME AGE
21+
service 6s
22+
----
23+
24+
. 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`:
25+
+
26+
[source,terminal]
27+
----
28+
$ oc delete updateservice service -n openshift-update-service
29+
----
30+
+
31+
.Example output
32+
[source,terminal]
33+
----
34+
updateservice.updateservice.operator.openshift.io "service" deleted
35+
----
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[id="update-service-delete-service-web-console_{context}"]
2+
= Deleting an OpenShift Update Service application by using the web console
3+
4+
You can use the {product-title} web console to delete an OpenShift Update Service application by using the OpenShift Update Service Operator.
5+
6+
.Prerequisites
7+
8+
* The OpenShift Update Service Operator has already been installed.
9+
10+
.Procedure
11+
12+
To delete an OpenShift Update Service application by using the {product-title} web console:
13+
14+
. In the {product-title} web console, click *Operators* -> *Installed Operators*.
15+
16+
. Choose *OpenShift Update Service* from the list of installed Operators.
17+
18+
. Click the *Update Service* tab.
19+
20+
. From the list of installed OpenShift Update Service applications, select the menu icon at the far right of the application to be deleted and then click *Delete UpdateService*.
21+
22+
. From the *Delete UpdateService?* pop up click the *Delete* button to confirm the deletion.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[id="update-service-graph-data_{context}"]
2+
= Creating the OpenShift Update Service graph data container image
3+
4+
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 accessible by the service.
5+
6+
.Procedure
7+
8+
. Create a Dockerfile, for example, `./Dockerfile`, containing the following:
9+
+
10+
[source,terminal]
11+
----
12+
FROM registry.access.redhat.com/ubi8/ubi:8.1
13+
14+
RUN curl -L -o cincinnati-graph-data.tar.gz https://github.com/openshift/cincinnati-graph-data/archive/master.tar.gz
15+
16+
CMD exec /bin/bash -c "tar xvzf cincinnati-graph-data.tar.gz -C /var/lib/cincinnati/graph-data/ --strip-components=1"
17+
----
18+
19+
. 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`:
20+
+
21+
[source,terminal]
22+
----
23+
$ podman build -f ./Dockerfile -t registry.example.com/openshift/graph-data:latest
24+
----
25+
26+
. Push the graph-data container image created in the above step to a repository accessible to the OpenShift Update Service, for example, `registry.example.com/openshift/graph-data:latest`:
27+
+
28+
[source,terminal]
29+
----
30+
$ podman push registry.example.com/openshift/graph-data:latest
31+
----

0 commit comments

Comments
 (0)