Skip to content

Commit

Permalink
MTL-2364 Change /var/lib/containerd from an OverlayFS to a Conventi…
Browse files Browse the repository at this point in the history
…onal Partition (#36)

remove overlayfs

mount CONLIB at /var/lib/containerd

update README
  • Loading branch information
jpdavis-prof authored Mar 28, 2024
1 parent 1179b48 commit 7428d91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
9 changes: 3 additions & 6 deletions 93metaldmk8s/metal-dmk8s-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,14 @@ make_ephemeral() {
_trip_udev
mkfs.xfs -f -L ${metal_k8slet#*=} "/dev/${target}${nvme:+p}3" || metal_dmk8s_die "Failed to create ${metal_k8slet#*=}"

mkdir -p /run/containerd /var/lib/kubelet /var/lib/containerd /run/lib-containerd
mkdir -p /run/containerd /var/lib/kubelet /var/lib/containerd
{
printf '% -18s\t% -18s\t%s\t%s 0 0\n' "${metal_conrun}" /run/containerd xfs "$metal_fsopts_xfs"
printf '% -18s\t% -18s\t%s\t%s 0 0\n' "${metal_conlib}" /run/lib-containerd xfs "$metal_fsopts_xfs"
printf '% -18s\t% -18s\t%s\t%s 0 0\n' "${metal_conlib}" /var/lib/containerd xfs "$metal_fsopts_xfs"
printf '% -18s\t% -18s\t%s\t%s 0 0\n' "${metal_k8slet}" /var/lib/kubelet xfs "$metal_fsopts_xfs"
} >>$metal_fstab

# Mount FS to allow creation of necessary overlayFS directories; might as well mount everything with -a.
mount -a -v -T $metal_fstab && mkdir -p /run/lib-containerd/ovlwork /run/lib-containerd/overlayfs
printf '% -18s\t% -18s\t%s\t%s 0 0\n' containerd_overlayfs /var/lib/containerd overlay lowerdir=/var/lib/containerd,upperdir=/run/lib-containerd/overlayfs,workdir=/run/lib-containerd/ovlwork >>$metal_fstab
# Mount FS again, catching our new overlayFS. Failure to mount here is fatal.
# Mount filesystems. Failure to mount here is fatal.
mount -a -v -T $metal_fstab

# echo 1 to signal that this module create a disk.
Expand Down
22 changes: 3 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ This module deploys an ephemeral disk to be used by kubernetes containers:

- `/run/containerd` partition
- `/var/lib/kubelet` partition
- `/run/lib-containerd` partition
- `/var/lib/containerd` partition

## Table of Contents

- [OverlayFS](README.md#overlayfs)
- [Parameters](README.md#parameters)
- [Customizable Parameters](README.md#customizable-parameters)
- [FSLabel Parameters](README.md#fslabel-parameters)
Expand All @@ -22,21 +21,6 @@ This module deploys an ephemeral disk to be used by kubernetes containers:
- [Required Parameters](README.md#required-parameters)
- [`metal.server`](README.md#metalserver)

## OverlayFS

In order to allow reading of the original material in `/var/lib/containerd` residing in the SquashFS image while offering persistent storage, an overlayFS is created.

Only `/var/lib/containerd` is an OverlayFS.
- Lower Directory (Read-Only): `/var/lib/containerd`
- Upper Directory (Writeable): `/run/lib-containerd`

> Existing data from the root OverlayFS and the squashFS will be read-only at that location once the `containerd_overlayfs` is mounted.
For more information on the OverlayFS, see:
- [90metalmdsquash](https://github.com/Cray-HPE/dracut-metal-mdsquash#rootfs-and-the-persistent-overlayfs)
- [CSM Usage of OverlayFS](https://github.com/Cray-HPE/docs-csm/blob/main/background/ncn_mounts_and_file_systems.md)
- [Kernel Documentation on OverlayFS](https://www.kernel.org/doc/html/latest/filesystems/overlayfs.html)

## Parameters

The `unit` of size varies per-parameter; pay attention to avoid undesirable partition tables
Expand All @@ -55,7 +39,7 @@ This may be desirable for cases when another LVM is being re-used.
##### `metal.disk.conlib`

> FSLabel for the `/run/lib-containerd`.
> FSLabel for the `/var/lib/containerd`.
> - `Default: CONLIB`
##### `metal.disk.k8slet`
Expand All @@ -74,7 +58,7 @@ This may be desirable for cases when another LVM is being re-used.
##### `metal.disk.conlib.size`

> Size of the `/run/lib-containerd` partition, measured in percentage (`%`):
> Size of the `/var/lib/containerd` partition, measured in percentage (`%`):
> - `Default: 40`
> - `Min: 10`
> - `Max: 45`
Expand Down

0 comments on commit 7428d91

Please sign in to comment.