Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions config_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,16 @@ set -x
#export WORKER_DISK=60
#export WORKER_VCPU=4

# WORKER_COREOS_STREAM -
# Override the CoreOS stream label on worker BareMetalHost manifests and the
# worker MachineSet hostSelector. This controls which IPA (kernel/initrd/rootfs)
# is used during PXE boot for worker nodes. For example, set to "rhel-10" to
# boot workers with the RHEL 10 IPA while masters remain on the default stream.
# Requires matching stream-prefixed images in the machine-os-images container.
# Default: unset (use the installer's default, typically "rhel-9").
#
#export WORKER_COREOS_STREAM=rhel-10

# NUM_EXTRA_WORKERS - Indicate number of extra VMs to create but not deploy.
# Default: 0
#
Expand Down
35 changes: 35 additions & 0 deletions utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,41 @@ function create_cluster() {
sed -i s/"watchAllNamespaces: false"/"watchAllNamespaces: true"/ "${assets_dir}/openshift/99_baremetal-provisioning-config.yaml"
fi

if [[ -n "${WORKER_COREOS_STREAM:-}" ]]; then
# Patch worker BMH manifests to use the specified CoreOS stream.
# This controls which IPA (kernel/initrd/rootfs) version is used
# during PXE boot for worker nodes.
for bmh_file in "${assets_dir}"/openshift/99_openshift-cluster-api_hosts-*.yaml; do
if ! grep -q 'installer.openshift.io/role: control-plane' "${bmh_file}"; then
sed -i "s/coreos.openshift.io\/stream: .*/coreos.openshift.io\/stream: ${WORKER_COREOS_STREAM}/" "${bmh_file}"
fi
done
# Patch worker MachineSet hostSelector to match the new stream
for ms_file in "${assets_dir}"/openshift/99_openshift-cluster-api_worker-machineset-*.yaml; do
sed -i "s/coreos.openshift.io\/stream: .*/coreos.openshift.io\/stream: ${WORKER_COREOS_STREAM}/" "${ms_file}"
done
# Set the worker MachineConfigPool to use the specified stream for
# the on-disk OS. Requires the OSStreams feature gate (TechPreviewNoUpgrade).
cat > "${assets_dir}/openshift/99_worker-osimagestream.yaml" <<EOF
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfigPool
metadata:
labels:
machineconfiguration.openshift.io/mco-built-in: ""
pools.operator.machineconfiguration.openshift.io/worker: ""
name: worker
spec:
machineConfigSelector:
matchLabels:
machineconfiguration.openshift.io/role: worker
nodeSelector:
matchLabels:
node-role.kubernetes.io/worker: ""
osImageStream:
name: ${WORKER_COREOS_STREAM}
EOF
fi

if override_openshift_sdn_deprecation; then
# We had to put `networkType: OVNKubernetes` in the install-config to make the
# installer happy, so fix that now.
Expand Down