Skip to content

Commit ed059d2

Browse files
committed
TELCODOCS-597: Adding new files to assembly
1 parent 514ec2c commit ed059d2

File tree

4 files changed

+184
-0
lines changed

4 files changed

+184
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Module included in the following assemblies:
2+
//
3+
// scalability_and_performance/ztp-advanced-policy-config.adoc
4+
5+
:_module-type: CONCEPT
6+
[id="ztp-add-local-reg-for-sno-duprofile_{context}"]
7+
= Configuring the Image Registry Operator for local caching of images
8+
9+
{product-title} manages image caching using a local registry. In edge computing use cases, clusters are often subject to bandwidth restrictions when communicating with centralized image registries, which might result in long image download times.
10+
11+
Long download times are unavoidable during initial deployment. Over time, there is a risk that CRI-O will erase the `/var/lib/containers/storage` directory in the case of an unexpected shutdown.
12+
13+
To address long image download times, you can create a local image registry on the remote managed cluster using GitOps ZTP. This is useful in Edge computing scenarios where clusters are deployed on the far edge of the network.
14+
15+
[NOTE]
16+
====
17+
The local image registry can only be used for user application images and cannot be used for the {product-title} or Operator Lifecycle Manager operator images. For information about working with these, see Topology Aware Lifecycle Manager (TALM) in Additional resources.
18+
====
19+
20+
The first phase of setting up a local image registry is configuring disk partitioning using a `SiteConfig` CR. You can use the `SiteConfig` CR to generate the `MachineConfig` CR used for disk partitioning.
21+
The next phase is to configure the image registry using `PolicyGenTemplate` CRs. The ZTP pipeline uses `PolicyGenTemplate` CRs to create Persistent Volumes (PV) and Persistent Volume Claim (PVC) CRs and patch the `imageregistry` configuration.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Module included in the following assemblies:
2+
//
3+
// scalability_and_performance/ztp-deploying-disconnected.adoc
4+
5+
:_module-type: PROCEDURE
6+
[id="ztp-configuring-disk-partitioning_{context}"]
7+
= Configuring disk partitioning with SiteConfig
8+
9+
Use a `SiteConfig` CR to generate the `MachineConfig` CR used for disk partitioning. Prior to installation, you need to modify values in the `SiteConfig` CR to reflect dependencies on the underlying disk.
10+
11+
[NOTE]
12+
====
13+
You must use persistent naming for devices to avoid device names such as `/dev/sda` and `/dev/sdb` being switched at every reboot. You can use `rootDeviceHints` to choose the bootable device and then use same device for further partitioning: in this case, for Image registry.
14+
====
15+
16+
.Prerequisites
17+
18+
* You have installed and configured Zero Touch Provisioning (ZTP). For information about this, see the topic on ZTP in Additional resources.
19+
20+
.Procedure
21+
22+
. Add the following YAML to the `SiteConfig` CR that you use to generate the `MachineConfig` CR for disk partitioning:
23+
+
24+
[source,yaml]
25+
----
26+
nodes:
27+
- rootDeviceHints:
28+
wwn: "0x62cea7f05c98c2002708a0a22ff480ea"
29+
diskPartition:
30+
- device: /dev/disk/by-id/wwn-0x62cea7f05c98c2002708a0a22ff480ea <1>
31+
partitions:
32+
- mount_point: /var/imageregistry
33+
size: 102500 <2>
34+
start: 344844 <3>
35+
----
36+
<1> This setting depends on the hardware. The setting can be a serial number or device name. The value must match the entry for `rootDeviceHint`.
37+
<2> The minimum value for `size` is 102500 MiB.
38+
<3> The minimum value for `start` is 25000 MiB. The total value of `size` and `start` must not exceed the disk size, or the installation will fail.
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
// Module included in the following assemblies:
2+
//
3+
// scalability_and_performance/ztp-advanced-policy-config.adoc
4+
5+
:_module-type: PROCEDURE
6+
[id="ztp-configuring-pgt-image-registry_{context}"]
7+
= Configuring the image registry using PolicyGenTemplate CRs
8+
9+
You can use `PolicyGenTemplate` to apply to create the PV and PVC and patch `imageregistry` configuration. Select the appropriate `PolicyGenTemplate` for each `source-cr`. See Additional Resources for more help.
10+
11+
.Prerequisites
12+
13+
* You have installed and configured Zero Touch Provisioning (ZTP). For information about this, see the topic on ZTP in Additional resources.
14+
15+
.Procedure
16+
17+
. Configure the storage class, persistent volume claim, persistent volume, and image registry configuration in the appropriate `PolicyGenTemplate` CR. For example, to configure an individual site, use the following YAML:
18+
+
19+
[source,yaml]
20+
----
21+
sourceFiles:
22+
# storage class
23+
- fileName: StorageClass.yaml
24+
policyName: "sc-for-image-registry"
25+
metadata:
26+
name: image-registry-sc
27+
annotations:
28+
ran.openshift.io/ztp-deploy-wave: "100" <1>
29+
# persistent volume claim
30+
- fileName: StoragePVC.yaml
31+
policyName: "pvc-for-image-registry"
32+
metadata:
33+
name: image-registry-pvc
34+
namespace: openshift-image-registry
35+
annotations:
36+
ran.openshift.io/ztp-deploy-wave: "100" <2>
37+
spec:
38+
accessModes:
39+
ReadWriteMany
40+
resources:
41+
requests:
42+
storage: 100Gi
43+
storageClassName: image-registry-sc
44+
volumeMode: Filesystem
45+
# persistent volume
46+
- fileName: ImageRegistryPV.yaml <3>
47+
policyName: "pv-for-image-registry"
48+
metadata:
49+
annotations:
50+
ran.openshift.io/ztp-deploy-wave: "100" <4>
51+
# image registry config
52+
- fileName: ImageRegistryConfig.yaml <5>
53+
policyName: "config-for-image-registry"
54+
complianceType: musthave <5>
55+
metadata:
56+
annotations:
57+
ran.openshift.io/ztp-deploy-wave: "100" <6>
58+
spec:
59+
storage:
60+
pvc:
61+
claim: "image-registry-pvc"
62+
----
63+
<1> Set the appropriate value for `ztp-deploy-wave` depending on whether you are configuring image registries at the site, common, or group level. `ztp-deploy-wave: "100"` is appropriate for an individual site. ZTP deploy waves are used to order how policies are applied to the spoke cluster. All policies created by `PolicyGen` have a ztp deploy wave by default.
64+
<2> Set the appropriate value for `ztp-deploy-wave` as in note 1.
65+
<3> This assumes that `mount_point` is set to `/var/imageregistry` in `SiteConfig` using StorageClass `image-registry-sc` (see the topic on configuring disk partitioning with `SiteConfig`).
66+
<4> Set the appropriate value for `ztp-deploy-wave` as in note 1.
67+
<5> Configure registry to point to the PVC created above.
68+
<6> Set the appropriate value for `ztp-deploy-wave` as in note 1.
69+
70+
.Verification
71+
72+
. Check that the `Config` CRD of the group `imageregistry.operator.openshift.io` instance is not reporting errors. Run the following command:
73+
74+
. Check that the `PersistentVolumeClaim` on the managed cluster is populated with data. Run the following command:
75+
76+
. Check that the `registry*` pod is up correctly located under the `openshift-image-registry` namespace.
77+
78+
. Verify successful login to the registry with `podman`:
79+
+
80+
[source,terminal]
81+
----
82+
$ oc login -u kubeadmin -p <password_from_install_log> https://api-int.<cluster_name>.<base_domain>:6443
83+
----
84+
+
85+
[source,terminal]
86+
----
87+
$ podman login -u kubeadmin -p $(oc whoami -t) image-registry.openshift-image-registry.svc:5000
88+
----
89+
90+
. Check for disk partitioning using `lsblk` to list your blocks:
91+
+
92+
[source,terminal]
93+
----
94+
$ oc debug node/sno-1.example.com
95+
----
96+
97+
. When you enter the node, run the following command:
98+
99+
[source,terminal]
100+
----
101+
sh-4.4# lsblk
102+
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
103+
sda 8:0 0 446.6G 0 disk
104+
|-sda1 8:1 0 1M 0 part
105+
|-sda2 8:2 0 127M 0 part
106+
|-sda3 8:3 0 384M 0 part /boot
107+
|-sda4 8:4 0 336.3G 0 part /sysroot
108+
`-sda5 8:5 0 100.1G 0 part /var/imageregistry <1>
109+
sdb 8:16 0 446.6G 0 disk
110+
sr0 11:0 1 104M 0 rom
111+
----
112+
<1> This setting will appear if you have successfully listed your block.

scalability_and_performance/ztp_far_edge/ztp-advanced-policy-config.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@ include::modules/ztp-configuring-ptp-fast-events.adoc[leveloffset=+1]
4040

4141
* For more information about how to install the AMQ Interconnect Operator, see xref:../../monitoring/using-rfhe.adoc#hw-installing-amq-interconnect-messaging-bus_using-rfhe[Installing the AMQ messaging bus].
4242
43+
include::modules/ztp-add-local-reg-for-sno-duprofile.adoc[leveloffset=+1]
44+
45+
include::modules/ztp-configuring-disk-partitioning.adoc[leveloffset=+2]
46+
47+
include::modules/ztp-configuring-pgt-image-registry.adoc[leveloffset=+2]
48+
49+
[role="_additional-resources"]
50+
.Additional resources
51+
52+
* For more information about configuring GitOps ZTP on the hub cluster, see xref:../../scalability_and_performance/ztp_far_edge/ztp-preparing-the-hub-cluster.adoc#ztp-preparing-the-hub-cluster[Preparing the hub cluster for ZTP]
53+
54+
* For more information about container image registries, see xref:../../registry/index.adoc#registry-overview[{product-title} registry overview].
55+
4356
include::modules/ztp-configuring-hwevents-using-pgt.adoc[leveloffset=+1]
4457

4558
[role="_additional-resources"]

0 commit comments

Comments
 (0)