Skip to content

Instantly share code, notes, and snippets.

@dmc5179
Created June 6, 2024 13:27
Show Gist options
  • Save dmc5179/cc975188c43d0e581e551f3960014b45 to your computer and use it in GitHub Desktop.
Save dmc5179/cc975188c43d0e581e551f3960014b45 to your computer and use it in GitHub Desktop.
OpenShift agent single node custom partitions
variant: openshift
version: 4.15.0
metadata:
labels:
machineconfiguration.openshift.io/role: master
name: 98-lso-partition
storage:
disks:
- device: /dev/sda # This can also be written as /dev/sda or /dev/nvme0n1 if you know the name of the disk device itself. It's recommended to use by-id in case the device changes names but not required. Make sure this matches what is in the install-config.yaml device
partitions:
- label: lso
start_mib: 150000 # let CoreOS use the first 150GB (minimum 25000 MiB, recommend 120000 MiB or more)
size_mib: 0 # any size, or "0" to use the rest of the disk
number: 5
filesystems:
- device: /dev/disk/by-partlabel/lso
path: /lso
format: xfs
mount_options: [defaults, prjquota]
with_mount_unit: true
# Generated by Butane; do not edit
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: master
name: 98-lso-partition
spec:
config:
ignition:
version: 3.4.0
storage:
disks:
- device: /dev/sda
partitions:
- label: lso
number: 5
sizeMiB: 0
startMiB: 150000
filesystems:
- device: /dev/disk/by-partlabel/lso
format: xfs
mountOptions:
- defaults
- prjquota
path: /lso
systemd:
units:
- contents: |-
# Generated by Butane
[Unit]
Requires=systemd-fsck@dev-disk-by\x2dpartlabel-lso.service
After=systemd-fsck@dev-disk-by\x2dpartlabel-lso.service
[Mount]
Where=/lso
What=/dev/disk/by-partlabel/lso
Type=xfs
Options=defaults,prjquota
[Install]
RequiredBy=local-fs.target
enabled: true
name: lso.mount
#!/bin/bash
# This can also be written as /dev/sda or /dev/nvme0n1 if you know the name of the disk device itself.
# It's recommended to use by-id in case the device changes names but not required.
DEVICE="/dev/sda"
rm -rf ocp4
mkdir ocp4
cp install-config.yaml ocp4/
cp agent-config.yaml ocp4/
openshift-install-4.15.8 agent create cluster-manifests --dir=./ocp4 --log-level=debug
# with the agent installer we have to create this subdirectory for custom manifests manually
mkdir ocp4/openshift || true
# Create the custom disk partition manifest
butane 98-lso-partition.bu -o ocp4/openshift/98-lso-partition.yaml
# Create the agent installer ISO image
openshift-install-4.15.8 agent create image --dir=./ocp4 --log-level=debug
#isohybrid --uefi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment