Skip to content

Commit 05c581a

Browse files
Merge pull request #1083 from pixelsoccupied/update-partitioning-doc-rootDeviceHints
ztp: update disk partitioning docs to include use of rootDeviceHint
2 parents 48754d7 + 1ef9d26 commit 05c581a

File tree

3 files changed

+74
-9
lines changed

3 files changed

+74
-9
lines changed

ztp/gitops-subscriptions/argocd/ImageRegistry.md

+37-8
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,42 @@
11
Installation
22
-
3-
1. Use SiteConfig to generate MachineConfig for disk partitioning. Make sure to modify values in the mc appropriately as it is dependent on the underlying disk.
3+
1. Use SiteConfig to generate MachineConfig for disk partitioning. Make sure to modify values in the mc appropriately as it is dependent on the underlying disk.
4+
5+
It is important use persistent naming for device, especially if you have more than one disk as names like `/dev/sda` and `/dev/sdb` may switch at every reboot. You can use `rootDeviceHints` to choose the bootable device and then use same the device for further partitioning, in this case, for Image registry. More info on persistent naming [here](https://wiki.archlinux.org/title/persistent_block_device_naming#Persistent_naming_methods).
6+
7+
wwn is used below.
8+
9+
410
```yaml
511
nodes:
6-
- diskPartition:
7-
- device: /dev/sda
12+
- rootDeviceHints:
13+
wwn: "0x62cea7f05c98c2002708a0a22ff480ea"
14+
diskPartition:
15+
- device: /dev/disk/by-id/wwn-0x62cea7f05c98c2002708a0a22ff480ea # depends on the hardware. can also serial num or device name. recommend using wwn. match with the rootDeviceHint above
816
partitions:
917
- mount_point: /var/imageregistry
10-
size: 102500
11-
start: 344844
18+
size: 102500 # min value 100gig for image registry
19+
start: 344844 # 25000 min value, otherwise root partition is too small. Recommended startMiB (Disk - sizeMiB - some buffer), if startMiB + sizeMiB exceeds disk size, installation will fail
1220
```
1321
14-
3. Use PGT, to apply the following to create the pv and pvc and patch imageregistry config as part of normal day-2 operation
22+
3. Use PGT, to apply the following to create the pv and pvc and patch imageregistry config as part of normal day-2 operation. Select the appropriate PGT for each source-cr and refer to `wave` doc for more help. Below is as example if you would like to test it at the site level.
1523
```yaml
1624
sourceFiles:
25+
# storage class
26+
- fileName: StorageClass.yaml
27+
policyName: "sc-for-image-registry"
28+
metadata:
29+
name: image-registry-sc
30+
annotations:
31+
ran.openshift.io/ztp-deploy-wave: "100" # remove this when moved to the right PGT (site/group/common)
32+
# persistent volume claim
1733
- fileName: StoragePVC.yaml
1834
policyName: "pvc-for-image-registry"
1935
metadata:
2036
name: image-registry-pvc
2137
namespace: openshift-image-registry
38+
annotations:
39+
ran.openshift.io/ztp-deploy-wave: "100" # remove this when moved to the right PGT (site/group/common)
2240
spec:
2341
accessModes:
2442
- ReadWriteMany
@@ -27,10 +45,20 @@ nodes:
2745
storage: 100Gi
2846
storageClassName: image-registry-sc
2947
volumeMode: Filesystem
30-
- fileName: ImageRegistryPV.yaml
31-
policyName: "pv-for-image-registry"
48+
# persistent volume
49+
- fileName: ImageRegistryPV.yaml # this is assuming that mount_point is set to `/var/imageregistry` in SiteConfig
50+
# using StorageClass `image-registry-sc` (see the first sc-file)
51+
policyName: "pv-for-image-registry"
52+
metadata:
53+
annotations:
54+
ran.openshift.io/ztp-deploy-wave: "100" # remove this when moved to the right PGT (site/group/common)
55+
# configure registry to point to the pvc created above
3256
- fileName: ImageRegistryConfig.yaml
3357
policyName: "config-for-image-registry"
58+
complianceType: musthave # do not use `mustlyonlyhave` as it will cause deployment failure of registry pod.
59+
metadata:
60+
annotations:
61+
ran.openshift.io/ztp-deploy-wave: "100" # remove this when moved to the right PGT (site/group/common)
3462
spec:
3563
storage:
3664
pvc:
@@ -41,6 +69,7 @@ Verify/Debug
4169
-
4270
- Check the CRD `Config` of group `imageregistry.operator.openshift.io`'s instance `cluster` is not reporting any error
4371
- Within a few minutes after the installation process is complete you should see the pvc filling up.
72+
- Check "registry*" pod is up correctly under `openshift-image-registry` namespace
4473
- From inside the node:
4574
- Successful login to the registry with podman:
4675
```

ztp/gitops-subscriptions/argocd/example/policygentemplates/group-du-sno-ranGen.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,32 @@ spec:
107107
group.ice-ptp=0:f:10:*:ice-ptp.*
108108
[service]
109109
service.stalld=start,enable
110+
# --- sources needed for image registry (check ImageRegistry.md for more details)----
111+
# - fileName: StorageClass.yaml
112+
# policyName: "config-policy"
113+
# metadata:
114+
# name: image-registry-sc
115+
# - fileName: StoragePVC.yaml
116+
# policyName: "config-policy"
117+
# metadata:
118+
# name: image-registry-pvc
119+
# namespace: openshift-image-registry
120+
# spec:
121+
# accessModes:
122+
# - ReadWriteMany
123+
# resources:
124+
# requests:
125+
# storage: 100Gi
126+
# storageClassName: image-registry-sc
127+
# volumeMode: Filesystem
128+
# - fileName: ImageRegistryPV.yaml # this is assuming that mount_point is set to `/var/imageregistry` in SiteConfig
129+
# using StorageClass `image-registry-sc` (see the first sc-file)
130+
# policyName: "config-policy"
131+
# - fileName: ImageRegistryConfig.yaml
132+
# policyName: "config-policy"
133+
# spec:
134+
# storage:
135+
# pvc:
136+
# claim: "image-registry-pvc"
137+
# ---- sources needed for image registry ends here ----
138+

ztp/gitops-subscriptions/argocd/example/siteconfig/example-sno.yaml

+8-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,14 @@ spec:
4848
# Use UEFISecureBoot to enable secure boot
4949
bootMode: "UEFI"
5050
rootDeviceHints:
51-
hctl: '0:1:0'
51+
wwn: "0x11111000000asd123"
52+
# example of diskPartition below is used for image registry (check ImageRegistry.md for more details), but it's not limited to this use case
53+
# diskPartition:
54+
# - device: /dev/disk/by-id/wwn-0x11111000000asd123 # match rootDeviceHints
55+
# partitions:
56+
# - mount_point: /var/imageregistry
57+
# size: 102500
58+
# start: 344844
5259
cpuset: "0-1,52-53"
5360
nodeNetwork:
5461
interfaces:

0 commit comments

Comments
 (0)