Skip to content

Commit 40e7f94

Browse files
authored
Merge pull request #102217 from dfitzmau/OSDOCS-16868
OSDOCS-16868: CQA 2.0 for REG-3
2 parents 45d543f + 1489407 commit 40e7f94

21 files changed

+181
-313
lines changed

modules/images-configuration-cas.adoc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,17 @@
77
[id="images-configuration-cas_{context}"]
88
= Configuring additional trust stores for image registry access
99

10-
The `image.config.openshift.io/cluster` custom resource can contain a reference to a config map that contains additional certificate authorities to be trusted during image registry access.
10+
[role="_abstract"]
11+
You can update an `image.config.openshift.io/cluster` custom resource (CR) to include a reference to a config map that includes additional certificate authorities (CAs). You must ensure that these CAs are trusted during image registry access. The config map key is the hostname of a registry with the port for which this CA is to be trusted. The Privacy-Enhanced Mail (PEM) certificate content is the value, for each additional registry CA to trust.
1112

1213
.Prerequisites
13-
* The certificate authorities (CA) must be PEM-encoded.
1414

15-
.Procedure
16-
17-
You can create a config map in the `openshift-config` namespace and use its name in `AdditionalTrustedCA` in the `image.config.openshift.io` custom resource to provide additional CAs that should be trusted when contacting external registries.
15+
* Ensure that a CA is PEM-encoded.
1816
19-
The config map key is the hostname of a registry with the port for which this CA is to be trusted, and the PEM certificate content is the value, for each additional registry CA to trust.
17+
.Procedure
2018

21-
.Image registry CA config map example
19+
. Create a config map in the `openshift-config` namespace. The following example configurations show defined image registry CA that exists in a config map:
20+
+
2221
[source,yaml]
2322
----
2423
apiVersion: v1
@@ -30,16 +29,17 @@ data:
3029
-----BEGIN CERTIFICATE-----
3130
...
3231
-----END CERTIFICATE-----
33-
registry-with-port.example.com..5000: | <1>
32+
registry-with-port.example.com..5000: |
3433
-----BEGIN CERTIFICATE-----
3534
...
3635
-----END CERTIFICATE-----
3736
----
38-
<1> If the registry has the port, such as `registry-with-port.example.com:5000`, `:` should be replaced with `..`.
39-
40-
You can configure additional CAs with the following procedure.
37+
+
38+
where:
39+
+
40+
`registry-with-port.example.com..5000`:: If the registry has the port, `:` should be replaced with `..`.
4141
42-
* To configure an additional CA:
42+
. Configure an additional CA. Ensure that you specify the name of the CA in the AdditionalTrustedCA` parameter of the `image.config.openshift.io` CR. You can then provide additional CAs that must be trusted when contacting external registries.
4343
+
4444
[source,terminal]
4545
----

modules/pruning-images.adoc

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
[id="pruning-images_{context}"]
77
= Automatically pruning images
88

9-
Images from the {product-registry} that are no longer required by the system due to age, status, or exceed limits are automatically pruned. Cluster administrators can configure the Pruning Custom Resource, or suspend it.
9+
[role="_abstract"]
10+
Images from the {product-registry} that are no longer required by the system because of age, status, or exceed limits being automatically pruned. As a cluster administrator, can configure or suspend the pruning Custom Resource (CR).
1011

1112
.Prerequisites
1213

@@ -18,27 +19,37 @@ ifdef::openshift-rosa,openshift-dedicated,openshift-rosa-hcp[]
1819
endif::openshift-rosa,openshift-dedicated,openshift-rosa-hcp[]
1920
* Install the `oc` CLI.
2021

22+
[IMPORTANT]
23+
====
24+
The behavior of the Image Registry Operator for managing the pruner is independent to the `managementState` specified on the `ClusterOperator` object of the Image Registry Operator. If the Image Registry Operator is not in the `Managed` state, the image pruner can still be configured and managed by the Pruning Custom Resource.
25+
26+
However, the `managementState` of the Image Registry Operator alters the behavior of the deployed image pruner job:
27+
28+
* `Managed`: the `--prune-registry` flag for the image pruner is set to `true`.
29+
* `Removed`: the `--prune-registry` flag for the image pruner is set to `false`, meaning it only prunes image metadata in etcd.
30+
====
31+
2132
.Procedure
2233

2334
* Verify that the object named `imagepruners.imageregistry.operator.openshift.io/cluster` contains the following `spec` and `status` fields:
24-
35+
+
2536
[source,yaml]
2637
----
2738
spec:
28-
schedule: 0 0 * * * <1>
29-
suspend: false <2>
30-
keepTagRevisions: 3 <3>
31-
keepYoungerThanDuration: 60m <4>
32-
keepYoungerThan: 3600000000000 <5>
33-
resources: {} <6>
34-
affinity: {} <7>
35-
nodeSelector: {} <8>
36-
tolerations: [] <9>
37-
successfulJobsHistoryLimit: 3 <10>
38-
failedJobsHistoryLimit: 3 <11>
39+
schedule: 0 0 * * *
40+
suspend: false
41+
keepTagRevisions: 3
42+
keepYoungerThanDuration: 60m
43+
keepYoungerThan: 3600000000000
44+
resources: {}
45+
affinity: {}
46+
nodeSelector: {}
47+
tolerations: []
48+
successfulJobsHistoryLimit: 3
49+
failedJobsHistoryLimit: 3
3950
status:
40-
observedGeneration: 2 <12>
41-
conditions: <13>
51+
observedGeneration: 2
52+
conditions:
4253
- type: Available
4354
status: "True"
4455
lastTransitionTime: 2019-10-09T03:13:45
@@ -55,30 +66,20 @@ status:
5566
reason: Succeeded
5667
message: "Most recent image pruning job succeeded."
5768
----
58-
<1> `schedule`: `CronJob` formatted schedule. This is an optional field, default is daily at midnight.
59-
<2> `suspend`: If set to `true`, the `CronJob` running pruning is suspended. This is an optional field, default is `false`. The initial value on new clusters is `false`.
60-
<3> `keepTagRevisions`: The number of revisions per tag to keep. This is an optional field, default is `3`. The initial value is `3`.
61-
<4> `keepYoungerThanDuration`: Retain images younger than this duration. This is an optional field. If a value is not specified, either `keepYoungerThan` or the default value `60m` (60 minutes) is used.
62-
<5> `keepYoungerThan`: Deprecated. The same as `keepYoungerThanDuration`, but the duration is specified as an integer in nanoseconds. This is an optional field. When `keepYoungerThanDuration` is set, this field is ignored.
63-
<6> `resources`: Standard pod resource requests and limits. This is an optional field.
64-
<7> `affinity`: Standard pod affinity. This is an optional field.
65-
<8> `nodeSelector`: Standard pod node selector. This is an optional field.
66-
<9> `tolerations`: Standard pod tolerations. This is an optional field.
67-
<10> `successfulJobsHistoryLimit`: The maximum number of successful jobs to retain. Must be `>= 1` to ensure metrics are reported. This is an optional field, default is `3`. The initial value is `3`.
68-
<11> `failedJobsHistoryLimit`: The maximum number of failed jobs to retain. Must be `>= 1` to ensure metrics are reported. This is an optional field, default is `3`. The initial value is `3`.
69-
<12> `observedGeneration`: The generation observed by the Operator.
70-
<13> `conditions`: The standard condition objects with the following types:
71-
* `Available`: Indicates if the pruning job has been created. Reasons can be Ready or Error.
72-
* `Scheduled`: Indicates if the next pruning job has been scheduled. Reasons can be Scheduled, Suspended, or Error.
73-
* `Failed`: Indicates if the most recent pruning job failed.
69+
* `schedule`: `CronJob` formatted schedule. This is an optional field, default is daily at midnight.
70+
* `suspend`: If set to `true`, the `CronJob` running pruning is suspended. This is an optional field, default is `false`. The initial value on new clusters is `false`.
71+
* `keepTagRevisions`: The number of revisions per tag to keep. This is an optional field, default is `3`. The initial value is `3`.
72+
* `keepYoungerThanDuration`: Retain images younger than this duration. This is an optional field. If a value is not specified, either `keepYoungerThan` or the default value `60m` (60 minutes) is used.
73+
* `keepYoungerThan`: Deprecated. The same as `keepYoungerThanDuration`, but the duration is specified as an integer in nanoseconds. This is an optional field. When `keepYoungerThanDuration` is set, this field is ignored.
74+
* `resources`: Standard pod resource requests and limits. This is an optional field.
75+
* `affinity`: Standard pod affinity. This is an optional field.
76+
* `nodeSelector`: Standard pod node selector. This is an optional field.
77+
* `tolerations`: Standard pod tolerations. This is an optional field.
78+
* `successfulJobsHistoryLimit`: The maximum number of successful jobs to retain. Must be greater than or equal to `1` to ensure metrics are reported. This is an optional field, default is `3`. The initial value is `3`.
79+
* `failedJobsHistoryLimit`: The maximum number of failed jobs to retain. Must be greater than or equal `1` to ensure metrics are reported. This is an optional field, default is `3`. The initial value is `3`.
80+
* `observedGeneration`: The generation observed by the Operator.
81+
* `conditions`: The standard condition objects with the following types:
82+
** `Available`: Indicates if the pruning job has been created. Reasons can be `Ready` or `Error`.
83+
** `Scheduled`: Indicates if the next pruning job has been scheduled. Reasons can be `Scheduled`, `Suspended`, or `Error`.
84+
** `Failed`: Indicates if the most recent pruning job failed.
7485
75-
76-
[IMPORTANT]
77-
====
78-
The Image Registry Operator's behavior for managing the pruner is orthogonal to the `managementState` specified on the Image Registry Operator's `ClusterOperator` object. If the Image Registry Operator is not in the `Managed` state, the image pruner can still be configured and managed by the Pruning Custom Resource.
79-
80-
However, the `managementState` of the Image Registry Operator alters the behavior of the deployed image pruner job:
81-
82-
* `Managed`: the `--prune-registry` flag for the image pruner is set to `true`.
83-
* `Removed`: the `--prune-registry` flag for the image pruner is set to `false`, meaning it only prunes image metadata in etcd.
84-
====

modules/registry-accessing-directly.adoc

Lines changed: 19 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
[id="registry-accessing-directly_{context}"]
77
= Accessing the registry directly from the cluster
88

9-
You can access the registry from inside the cluster.
9+
[role="_abstract"]
10+
You can access the registry from inside the cluster by using internal routes.
1011

1112
.Procedure
1213

13-
Access the registry from the cluster by using internal routes:
14-
15-
. Access the node by getting the node's name:
14+
. Access the node by getting its name:
1615
+
1716
[source,terminal]
1817
----
@@ -24,13 +23,13 @@ $ oc get nodes
2423
$ oc debug nodes/<node_name>
2524
----
2625

27-
. To enable access to tools such as `oc` and `podman` on the node, change your root directory to `/host`:
26+
. To enable access to tools such as `oc` and `podman` on the node, change your root directory to `/host`. Successful output on running the commands states `Login Succeeded!`.
2827
+
2928
[source,terminal]
3029
----
3130
sh-4.2# chroot /host
3231
----
33-
+
32+
3433
. Log in to the container image registry by using your access token:
3534
+
3635
[source,terminal]
@@ -43,62 +42,28 @@ sh-4.2# oc login -u kubeadmin -p <password_from_install_log> https://api-int.<cl
4342
sh-4.2# podman login -u kubeadmin -p $(oc whoami -t) image-registry.openshift-image-registry.svc:5000
4443
----
4544
+
46-
You should see a message confirming login, such as:
47-
+
48-
[source,terminal]
49-
----
50-
Login Succeeded!
51-
----
52-
+
5345
[NOTE]
5446
====
55-
You can pass any value for the user name; the token contains all necessary
56-
information. Passing a user name that contains colons will result in a login
57-
failure.
47+
You can pass almost any value for the user name. The token contains all necessary information. Passing a user name that contains colons results in a login failure.
5848
59-
Since the Image Registry Operator creates the route, it will likely be similar to
60-
`default-route-openshift-image-registry.<cluster_name>`.
49+
The Image Registry Operator creates the route, such as `default-route-openshift-image-registry.<cluster_name>`.
6150
====
62-
+
63-
. Perform `podman pull` and `podman push` operations against your registry:
64-
+
65-
[IMPORTANT]
66-
====
67-
You can pull arbitrary images, but if you have the *system:registry* role
68-
added, you can only push images to the registry in your project.
69-
====
70-
+
71-
In the following examples, use:
72-
+
73-
|====
74-
|Component |Value
75-
76-
|*<registry_ip>*
77-
|`172.30.124.220`
78-
79-
|*<port>*
80-
|`5000`
81-
82-
|*<project>*
83-
|`openshift`
84-
85-
|*<image>*
86-
|`image`
87-
88-
|*<tag>*
89-
| omitted (defaults to `latest`)
90-
|====
9151

52+
. Perform `podman pull` and `podman push` operations against your registry. The following example commands demonstrate these operations.
53+
+
9254
.. Pull an arbitrary image:
9355
+
9456
[source,terminal]
9557
----
9658
sh-4.2# podman pull <name.io>/<image>
9759
----
98-
99-
.. Tag the new image with the form `<registry_ip>:<port>/<project>/<image>`.
100-
The project name must appear in this pull specification for {product-title} to
101-
correctly place and later access the image in the registry:
60+
+
61+
[IMPORTANT]
62+
====
63+
You can pull arbitrary images, but if you have the *system:registry* role added, you can only push images to the registry in your project.
64+
====
65+
+
66+
.. Tag the new image with the form `<registry_ip>:<port>/<project>/<image>`. For example, `172.30.124.220:5000/openshift/image`. The project name must show in the pull specification for {product-title} to correctly place and later access the image in the registry.
10267
+
10368
[source,terminal]
10469
----
@@ -107,12 +72,9 @@ sh-4.2# podman tag <name.io>/<image> image-registry.openshift-image-registry.svc
10772
+
10873
[NOTE]
10974
====
110-
You must have the `system:image-builder` role for the specified
111-
project, which allows the user to write or push an image. Otherwise, the
112-
`podman push` in the next step will fail. To test, you can create a new project
113-
to push the image.
75+
You must have the `system:image-builder` role for the specified project, which allows the user to write or push an image. Otherwise, the `podman push` in the next step will fail. To test, you can create a new project to push the image.
11476
====
115-
77+
+
11678
.. Push the newly tagged image to your registry:
11779
+
11880
[source,terminal]
@@ -123,4 +85,4 @@ sh-4.2# podman push image-registry.openshift-image-registry.svc:5000/openshift/<
12385
[NOTE]
12486
====
12587
When pushing images to the internal registry, the repository name must use the `<project>/<name>` format. Using multiple project levels in the repository name results in an authentication error.
126-
====
88+
====

modules/registry-accessing-metrics.adoc

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,11 @@
66
[id="registry-accessing-metrics_{context}"]
77
= Accessing registry metrics
88

9-
The OpenShift Container Registry provides an endpoint for
10-
link:https://prometheus.io/docs/introduction/overview/[Prometheus metrics].
11-
Prometheus is a stand-alone, open source systems monitoring and alerting
12-
toolkit.
13-
14-
The metrics are exposed at the *_/extensions/v2/metrics_* path of the registry
15-
endpoint.
16-
17-
// Recommended link to extended registry configuration assembly.
9+
[role="_abstract"]
10+
The OpenShift Container Registry provides an endpoint for link:https://prometheus.io/docs/introduction/overview/[Prometheus metrics]. Prometheus is a stand-alone, open source systems monitoring and alerting toolkit. The metrics get exposed at the *_/extensions/v2/metrics_* path of the registry endpoint. You can access the metrics by running a metrics query that includes a cluster role.
1811

1912
.Procedure
2013

21-
You can access the metrics by running a metrics query using a cluster role.
22-
23-
*Cluster role*
24-
2514
. Create a cluster role if you do not already have one to access the metrics:
2615
+
2716
[source,terminal]
@@ -41,32 +30,30 @@ rules:
4130
EOF
4231
----
4332

44-
. Add this role to a user, run the following command:
33+
. Add the cluster role to a user account by entering the following command:
4534
+
4635
[source,terminal]
4736
----
4837
$ oc adm policy add-cluster-role-to-user prometheus-scraper <username>
4938
----
5039

51-
*Metrics query*
52-
53-
. Get the user token.
40+
. For the metrics query, get the user token.
5441
+
5542
[source,terminal]
5643
----
5744
openshift:
5845
$ oc whoami -t
5946
----
6047

61-
. Run a metrics query in node or inside a pod, for example:
48+
. Run a metrics query in node or inside a pod. The following example command and output demonstrate this task.
6249
+
6350
[source,terminal]
6451
----
6552
$ curl --insecure -s -u <user>:<secret> \ <1>
6653
https://image-registry.openshift-image-registry.svc:5000/extensions/v2/metrics | grep imageregistry | head -n 20
6754
----
55+
* `<user>:<secret>`: The `<user>` object can be arbitrary, but `<secret>` tag must use the user token.
6856
+
69-
.Example output
7057
[source,terminal]
7158
----
7259
# HELP imageregistry_build_info A metric with a constant '1' value labeled by major, minor, git commit & git version from which the image registry was built.
@@ -90,4 +77,4 @@ imageregistry_http_request_duration_seconds{method="get",quantile="0.9"} 0.01484
9077
imageregistry_http_request_duration_seconds{method="get",quantile="0.99"} 0.015981195
9178
imageregistry_http_request_duration_seconds_sum{method="get"} 12.260727916000022
9279
----
93-
<1> The `<user>` object can be arbitrary, but `<secret>` tag must use the user token.
80+

0 commit comments

Comments
 (0)