1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00

TELCODOCS-1707: Add Preparing/Configuring shared container dir

This commit is contained in:
Alexandra Molnar
2024-06-05 09:53:31 +01:00
committed by openshift-cherrypick-robot
parent 3d7dbb3e11
commit b104c3f9fa
9 changed files with 105 additions and 92 deletions

View File

@@ -3077,12 +3077,12 @@ Topics:
Topics:
- Name: Understanding the image-based upgrade for single-node OpenShift clusters
File: cnf-understanding-image-based-upgrade
# - Name: Preparing for an image-based upgrade for single-node OpenShift clusters
# Dir: preparing_for_image_based_upgrade
# Distros: openshift-origin,openshift-enterprise
# Topics:
# - Name: Configuring a shared container directory for the image-based upgrade
# File: cnf-image-based-upgrade-shared-container-image
- Name: Preparing for an image-based upgrade for single-node OpenShift clusters
Dir: preparing_for_image_based_upgrade
Distros: openshift-origin,openshift-enterprise
Topics:
- Name: Configuring a shared container directory for the image-based upgrade
File: cnf-image-based-upgrade-shared-container-image
# - Name: Installing Operators for the image-based upgrade
# File: cnf-image-based-upgrade-install-operators
# - Name: Generating a seed image for the image-based upgrade with Lifecycle Agent

View File

@@ -127,4 +127,4 @@ include::modules/ztp-image-based-upgrade-extra-manifests-guide.adoc[leveloffset=
* 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]
* xref:../../backup_and_restore/application_backup_and_restore/installing/about-installing-oadp.adoc#about-installing-oadp[About installing OADP]
////
////

View File

@@ -0,0 +1 @@
../../../_attributes/

View File

@@ -0,0 +1,16 @@
:_mod-docs-content-type: ASSEMBLY
[id="cnf-image-based-upgrade-shared-varlibcontainers"]
= Configuring a shared container directory for the image-based upgrade
include::_attributes/common-attributes.adoc[]
:context: shared-container-directory
toc::[]
Your {sno} clusters need to have a shared `var/lib/containers` partition for the image-based upgrade.
You can do this at install time.
:FeatureName: The Lifecycle Agent
include::modules/cnf-image-based-upgrade-share-container-directory.adoc[leveloffset=+1]
include::modules/ztp-image-based-upgrade-share-container-directory.adoc[leveloffset=+1]

View File

@@ -0,0 +1 @@
../../../images/

View File

@@ -0,0 +1 @@
../../../modules/

View File

@@ -0,0 +1 @@
../../../snippets/

View File

@@ -0,0 +1,68 @@
// Module included in the following assemblies:
// * edge_computing/image-based-upgrade/cnf-preparing-for-image-based-upgrade.adoc
:_mod-docs-content-type: PROCEDURE
[id="cnf-image-based-upgrade-shared-container-directory_{context}"]
= Configuring a shared container directory between ostree stateroots
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.
[IMPORTANT]
====
You must complete this procedure at installation time.
====
.Procedure
* Apply a `MachineConfig` to create a separate partition:
+
[source,yaml]
----
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: master
name: 98-var-lib-containers-partitioned
spec:
config:
ignition:
version: 3.2.0
storage:
disks:
- device: /dev/disk/by-id/wwn-<root_disk> <1>
partitions:
- label: varlibcontainers
startMiB: <start_of_partition> <2>
sizeMiB: <partition_size> <3>
filesystems:
- device: /dev/disk/by-partlabel/varlibcontainers
format: xfs
mountOptions:
- defaults
- prjquota
path: /var/lib/containers
wipeFilesystem: true
systemd:
units:
- contents: |-
# Generated by Butane
[Unit]
Before=local-fs.target
Requires=systemd-fsck@dev-disk-by\x2dpartlabel-varlibcontainers.service
After=systemd-fsck@dev-disk-by\x2dpartlabel-varlibcontainers.service
[Mount]
Where=/var/lib/containers
What=/dev/disk/by-partlabel/varlibcontainers
Type=xfs
Options=defaults,prjquota
[Install]
RequiredBy=local-fs.target
enabled: true
name: var-lib-containers.mount
----
<1> Specify the root disk.
<2> Specify the start of the partition in MiB. If the value is too small, the installation will fail.
<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.

View File

@@ -1,16 +1,11 @@
// Module included in the following assemblies:
// * scalability_and_performance/ztp-image-based-upgrade.adoc
// * edge_computing/image-based-upgrade/cnf-preparing-for-image-based-upgrade.adoc
:_mod-docs-content-type: PROCEDURE
[id="ztp-image-based-upgrade-shared-container-directory_{context}"]
= Sharing the container directory between `ostree` stateroots
= Configuring a shared container directory between ostree stateroots when using {ztp}
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.
[id="ztp-image-based-upgrade-shared-container-directory-acm_{context}"]
== Sharing the container directory between `ostree` stateroots when using {rh-rhacm}
When you are using {rh-rhacm}, you must apply a `MachineConfig` to both the seed and target clusters.
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.
[IMPORTANT]
====
@@ -19,81 +14,11 @@ You must complete this procedure at installation time.
.Prerequisites
* Log in as a user with `cluster-admin` privileges.
.Procedure
. Apply a `MachineConfig` to create a separate partition.
+
[source,yaml]
----
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: master
name: 98-var-lib-containers-partitioned
spec:
config:
ignition:
version: 3.2.0
storage:
disks:
- device: /dev/disk/by-id/wwn-<root_disk> <1>
partitions:
- label: varlibcontainers
startMiB: <start_of_parition> <2>
sizeMiB: <parition_size> <3>
filesystems:
- device: /dev/disk/by-partlabel/varlibcontainers
format: xfs
mountOptions:
- defaults
- prjquota
path: /var/lib/containers
wipeFilesystem: true
systemd:
units:
- contents: |-
# Generated by Butane
[Unit]
Before=local-fs.target
Requires=systemd-fsck@dev-disk-by\x2dpartlabel-varlibcontainers.service
After=systemd-fsck@dev-disk-by\x2dpartlabel-varlibcontainers.service
[Mount]
Where=/var/lib/containers
What=/dev/disk/by-partlabel/varlibcontainers
Type=xfs
Options=defaults,prjquota
[Install]
RequiredBy=local-fs.target
enabled: true
name: var-lib-containers.mount
----
<1> Specify the root disk.
<2> Specify the start of the partition in MiB. If the value is too small, the installation will fail.
<3> Specify the size of the partition. If the value is too small, the deployments after installation will fail.
[id="ztp-image-based-upgrade-shared-container-directory-ztp_{context}"]
== Sharing the container directory between `ostree` stateroots when using GitOps ZTP
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.
[IMPORTANT]
====
You must complete this procedure at installation time.
====
.Prerequisites
* Log in as a user with `cluster-admin` privileges.
* Install Butane.
.Procedure
. Create the `storage.bu` file.
. Create the `storage.bu` file:
+
[source,yaml]
----
@@ -105,8 +30,8 @@ storage:
wipe_table: false
partitions:
- label: var-lib-containers
start_mib: <start_of_parition> <2>
size_mib: <parition_size> <3>
start_mib: <start_of_partition> <2>
size_mib: <partition_size> <3>
filesystems:
- path: /var/lib/containers
device: /dev/disk/by-partlabel/var-lib-containers
@@ -119,9 +44,9 @@ storage:
----
<1> Specify the root disk.
<2> Specify the start of the partition in MiB. If the value is too small, the installation will fail.
<3> Specify the size of the partition. If the value is too small, the deployments after installation will fail.
<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.
. Convert the `storage.bu` to an Ignition file.
. Convert the `storage.bu` to an Ignition file:
+
--
[source,terminal]
@@ -136,7 +61,7 @@ $ butane storage.bu
----
--
. Copy the output into the `.spec.clusters.nodes.ignitionConfigOverride` field in the `SiteConfig` CR.
. Copy the output into the `.spec.clusters.nodes.ignitionConfigOverride` field in the `SiteConfig` CR:
+
[source,yaml]
----
@@ -150,7 +75,7 @@ spec:
.Verification
. During or after installation, verify on the hub cluster that the `BareMetalHost` object shows the annotation.
. During or after installation, verify on the hub cluster that the `BareMetalHost` object shows the annotation:
+
--
[source,terminal]