Skip to content

Commit a6dfe0e

Browse files
committed
TELCODOCS-1707: Add Preparing/Configuring shared container dir
1 parent ba243ea commit a6dfe0e

File tree

9 files changed

+105
-92
lines changed

9 files changed

+105
-92
lines changed

_topic_maps/_topic_map.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3072,12 +3072,12 @@ Topics:
30723072
Topics:
30733073
- Name: Understanding the image-based upgrade for single-node OpenShift clusters
30743074
File: cnf-understanding-image-based-upgrade
3075-
# - Name: Preparing for an image-based upgrade for single-node OpenShift clusters
3076-
# Dir: preparing_for_image_based_upgrade
3077-
# Distros: openshift-origin,openshift-enterprise
3078-
# Topics:
3079-
# - Name: Configuring a shared container directory for the image-based upgrade
3080-
# File: cnf-image-based-upgrade-shared-container-image
3075+
- Name: Preparing for an image-based upgrade for single-node OpenShift clusters
3076+
Dir: preparing_for_image_based_upgrade
3077+
Distros: openshift-origin,openshift-enterprise
3078+
Topics:
3079+
- Name: Configuring a shared container directory for the image-based upgrade
3080+
File: cnf-image-based-upgrade-shared-container-image
30813081
# - Name: Installing Operators for the image-based upgrade
30823082
# File: cnf-image-based-upgrade-install-operators
30833083
# - Name: Generating a seed image for the image-based upgrade with Lifecycle Agent

edge_computing/image_based_upgrade/cnf-understanding-image-based-upgrade.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,4 @@ include::modules/ztp-image-based-upgrade-extra-manifests-guide.adoc[leveloffset=
127127
* xref:../../edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/ztp-image-based-upgrade-prep-resources.adoc#ztp-image-based-upgrade-creating-backup-resources-with-ztp_ztp-gitops[Creating ConfigMap objects for the image-based upgrade with GitOps ZTP]
128128
129129
* xref:../../backup_and_restore/application_backup_and_restore/installing/about-installing-oadp.adoc#about-installing-oadp[About installing OADP]
130-
////
130+
////
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../_attributes/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="cnf-image-based-upgrade-shared-varlibcontainers"]
3+
= Configuring a shared container directory for the image-based upgrade
4+
include::_attributes/common-attributes.adoc[]
5+
:context: shared-container-directory
6+
7+
toc::[]
8+
9+
Your {sno} clusters need to have a shared `var/lib/containers` partition for the image-based upgrade.
10+
You can do this at install time.
11+
12+
:FeatureName: The Lifecycle Agent
13+
14+
include::modules/cnf-image-based-upgrade-share-container-directory.adoc[leveloffset=+1]
15+
16+
include::modules/ztp-image-based-upgrade-share-container-directory.adoc[leveloffset=+1]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../images/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../modules/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../snippets/
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// Module included in the following assemblies:
2+
// * edge_computing/image-based-upgrade/cnf-preparing-for-image-based-upgrade.adoc
3+
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="cnf-image-based-upgrade-shared-container-directory_{context}"]
6+
= Configuring a shared container directory between ostree stateroots
7+
8+
Apply a `MachineConfig` to both the seed and the target clusters during installation time to create a separate partition and share the `/var/lib/containers` directory between the two `ostree` stateroots that will be used during the upgrade process.
9+
10+
[IMPORTANT]
11+
====
12+
You must complete this procedure at installation time.
13+
====
14+
15+
.Procedure
16+
17+
* Apply a `MachineConfig` to create a separate partition:
18+
+
19+
[source,yaml]
20+
----
21+
apiVersion: machineconfiguration.openshift.io/v1
22+
kind: MachineConfig
23+
metadata:
24+
labels:
25+
machineconfiguration.openshift.io/role: master
26+
name: 98-var-lib-containers-partitioned
27+
spec:
28+
config:
29+
ignition:
30+
version: 3.2.0
31+
storage:
32+
disks:
33+
- device: /dev/disk/by-id/wwn-<root_disk> <1>
34+
partitions:
35+
- label: varlibcontainers
36+
startMiB: <start_of_partition> <2>
37+
sizeMiB: <partition_size> <3>
38+
filesystems:
39+
- device: /dev/disk/by-partlabel/varlibcontainers
40+
format: xfs
41+
mountOptions:
42+
- defaults
43+
- prjquota
44+
path: /var/lib/containers
45+
wipeFilesystem: true
46+
systemd:
47+
units:
48+
- contents: |-
49+
# Generated by Butane
50+
[Unit]
51+
Before=local-fs.target
52+
Requires=systemd-fsck@dev-disk-by\x2dpartlabel-varlibcontainers.service
53+
After=systemd-fsck@dev-disk-by\x2dpartlabel-varlibcontainers.service
54+
55+
[Mount]
56+
Where=/var/lib/containers
57+
What=/dev/disk/by-partlabel/varlibcontainers
58+
Type=xfs
59+
Options=defaults,prjquota
60+
61+
[Install]
62+
RequiredBy=local-fs.target
63+
enabled: true
64+
name: var-lib-containers.mount
65+
----
66+
<1> Specify the root disk.
67+
<2> Specify the start of the partition in MiB. If the value is too small, the installation will fail.
68+
<3> Specify a minimum size for the partition of 500 GB to ensure adequate disk space for precached images. If the value is too small, the deployments after installation will fail.

modules/ztp-image-based-upgrade-share-container-directory.adoc

Lines changed: 10 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,11 @@
11
// Module included in the following assemblies:
2-
// * scalability_and_performance/ztp-image-based-upgrade.adoc
2+
// * edge_computing/image-based-upgrade/cnf-preparing-for-image-based-upgrade.adoc
33

44
:_mod-docs-content-type: PROCEDURE
55
[id="ztp-image-based-upgrade-shared-container-directory_{context}"]
6-
= Sharing the container directory between `ostree` stateroots
6+
= Configuring a shared container directory between ostree stateroots when using {ztp}
77

8-
You must apply a `MachineConfig` to both the seed and the target clusters during installation time to create a separate partition and share the `/var/lib/containers` directory between the two `ostree` stateroots that will be used during the upgrade process.
9-
10-
[id="ztp-image-based-upgrade-shared-container-directory-acm_{context}"]
11-
== Sharing the container directory between `ostree` stateroots when using {rh-rhacm}
12-
13-
When you are using {rh-rhacm}, you must apply a `MachineConfig` to both the seed and target clusters.
14-
15-
[IMPORTANT]
16-
====
17-
You must complete this procedure at installation time.
18-
====
19-
20-
.Prerequisites
21-
22-
* Log in as a user with `cluster-admin` privileges.
23-
24-
.Procedure
25-
26-
. Apply a `MachineConfig` to create a separate partition.
27-
+
28-
[source,yaml]
29-
----
30-
apiVersion: machineconfiguration.openshift.io/v1
31-
kind: MachineConfig
32-
metadata:
33-
labels:
34-
machineconfiguration.openshift.io/role: master
35-
name: 98-var-lib-containers-partitioned
36-
spec:
37-
config:
38-
ignition:
39-
version: 3.2.0
40-
storage:
41-
disks:
42-
- device: /dev/disk/by-id/wwn-<root_disk> <1>
43-
partitions:
44-
- label: varlibcontainers
45-
startMiB: <start_of_parition> <2>
46-
sizeMiB: <parition_size> <3>
47-
filesystems:
48-
- device: /dev/disk/by-partlabel/varlibcontainers
49-
format: xfs
50-
mountOptions:
51-
- defaults
52-
- prjquota
53-
path: /var/lib/containers
54-
wipeFilesystem: true
55-
systemd:
56-
units:
57-
- contents: |-
58-
# Generated by Butane
59-
[Unit]
60-
Before=local-fs.target
61-
Requires=systemd-fsck@dev-disk-by\x2dpartlabel-varlibcontainers.service
62-
After=systemd-fsck@dev-disk-by\x2dpartlabel-varlibcontainers.service
63-
64-
[Mount]
65-
Where=/var/lib/containers
66-
What=/dev/disk/by-partlabel/varlibcontainers
67-
Type=xfs
68-
Options=defaults,prjquota
69-
70-
[Install]
71-
RequiredBy=local-fs.target
72-
enabled: true
73-
name: var-lib-containers.mount
74-
----
75-
<1> Specify the root disk.
76-
<2> Specify the start of the partition in MiB. If the value is too small, the installation will fail.
77-
<3> Specify the size of the partition. If the value is too small, the deployments after installation will fail.
78-
79-
[id="ztp-image-based-upgrade-shared-container-directory-ztp_{context}"]
80-
== Sharing the container directory between `ostree` stateroots when using GitOps ZTP
81-
82-
When you are using the GitOps ZTP workflow, you can do the following procedure to create a separate disk partition on both the seed and target cluster and to share the `/var/lib/containers` directory.
8+
When you are using the {ztp-first} workflow, you do the following procedure to create a separate disk partition on both the seed and target cluster and to share the `/var/lib/containers` directory.
839

8410
[IMPORTANT]
8511
====
@@ -88,12 +14,11 @@ You must complete this procedure at installation time.
8814

8915
.Prerequisites
9016

91-
* Log in as a user with `cluster-admin` privileges.
9217
* Install Butane.
9318
9419
.Procedure
9520

96-
. Create the `storage.bu` file.
21+
. Create the `storage.bu` file:
9722
+
9823
[source,yaml]
9924
----
@@ -105,8 +30,8 @@ storage:
10530
wipe_table: false
10631
partitions:
10732
- label: var-lib-containers
108-
start_mib: <start_of_parition> <2>
109-
size_mib: <parition_size> <3>
33+
start_mib: <start_of_partition> <2>
34+
size_mib: <partition_size> <3>
11035
filesystems:
11136
- path: /var/lib/containers
11237
device: /dev/disk/by-partlabel/var-lib-containers
@@ -119,9 +44,9 @@ storage:
11944
----
12045
<1> Specify the root disk.
12146
<2> Specify the start of the partition in MiB. If the value is too small, the installation will fail.
122-
<3> Specify the size of the partition. If the value is too small, the deployments after installation will fail.
47+
<3> Specify a minimum size for the partition of 500 GB to ensure adequate disk space for precached images. If the value is too small, the deployments after installation will fail.
12348

124-
. Convert the `storage.bu` to an Ignition file.
49+
. Convert the `storage.bu` to an Ignition file:
12550
+
12651
--
12752
[source,terminal]
@@ -136,7 +61,7 @@ $ butane storage.bu
13661
----
13762
--
13863

139-
. Copy the output into the `.spec.clusters.nodes.ignitionConfigOverride` field in the `SiteConfig` CR.
64+
. Copy the output into the `.spec.clusters.nodes.ignitionConfigOverride` field in the `SiteConfig` CR:
14065
+
14166
[source,yaml]
14267
----
@@ -150,7 +75,7 @@ spec:
15075

15176
.Verification
15277

153-
. During or after installation, verify on the hub cluster that the `BareMetalHost` object shows the annotation.
78+
. During or after installation, verify on the hub cluster that the `BareMetalHost` object shows the annotation:
15479
+
15580
--
15681
[source,terminal]

0 commit comments

Comments
 (0)