From 677003ed9a065fe13a626aea8c471792fa019137 Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Wed, 25 Nov 2020 14:08:45 -0800 Subject: [PATCH] Update Matchbox profile to use initramfs and rootfs images * Fedora CoreOS stable (after Oct 6) ships separate initramfs and rootfs images, used as initrd's * Update profiles to match the Matchbox examples, which have already switched to the new profile and to remove the unused kernel args * Requires Fedora CoreOS version which ships rootfs images (e.g. stable 32.20200923.3.0 or later) Rel: * https://github.com/coreos/fedora-coreos-tracker/issues/390#issuecomment-661986987 * https://github.com/poseidon/matchbox/commit/da0df01763693b6391b3f6f9b7a267818075cef8#diff-4541f7b7c174f6ae6270135942c1c65ed9e09ebe81239709f5a9fb34e858ddcf Supercedes https://github.com/poseidon/typhoon/pull/888 --- fedora-coreos/kubernetes/profiles.tf | 30 +++++++++++++++------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/fedora-coreos/kubernetes/profiles.tf b/fedora-coreos/kubernetes/profiles.tf index 0ad5bd86a..a961a9458 100644 --- a/fedora-coreos/kubernetes/profiles.tf +++ b/fedora-coreos/kubernetes/profiles.tf @@ -1,26 +1,32 @@ locals { remote_kernel = "https://builds.coreos.fedoraproject.org/prod/streams/${var.os_stream}/builds/${var.os_version}/x86_64/fedora-coreos-${var.os_version}-live-kernel-x86_64" - remote_initrd = "https://builds.coreos.fedoraproject.org/prod/streams/${var.os_stream}/builds/${var.os_version}/x86_64/fedora-coreos-${var.os_version}-live-initramfs.x86_64.img" + remote_initrd = [ + "https://builds.coreos.fedoraproject.org/prod/streams/${var.os_stream}/builds/${var.os_version}/x86_64/fedora-coreos-${var.os_version}-live-initramfs.x86_64.img", + "https://builds.coreos.fedoraproject.org/prod/streams/${var.os_stream}/builds/${var.os_version}/x86_64/fedora-coreos-${var.os_version}-live-rootfs.x86_64.img" + ] + remote_args = [ "ip=dhcp", "rd.neednet=1", - "initrd=fedora-coreos-${var.os_version}-live-initramfs.x86_64.img", - "coreos.inst.image_url=https://builds.coreos.fedoraproject.org/prod/streams/${var.os_stream}/builds/${var.os_version}/x86_64/fedora-coreos-${var.os_version}-metal.x86_64.raw.xz", - "coreos.inst.ignition_url=${var.matchbox_http_endpoint}/ignition?uuid=$${uuid}&mac=$${mac:hexhyp}", "coreos.inst.install_dev=${var.install_disk}", + "coreos.inst.ignition_url=${var.matchbox_http_endpoint}/ignition?uuid=$${uuid}&mac=$${mac:hexhyp}", + "coreos.inst.image_url=https://builds.coreos.fedoraproject.org/prod/streams/${var.os_stream}/builds/${var.os_version}/x86_64/fedora-coreos-${var.os_version}-metal.x86_64.raw.xz", "console=tty0", "console=ttyS0", ] cached_kernel = "/assets/fedora-coreos/fedora-coreos-${var.os_version}-live-kernel-x86_64" - cached_initrd = "/assets/fedora-coreos/fedora-coreos-${var.os_version}-live-initramfs.x86_64.img" + cached_initrd = [ + "/assets/fedora-coreos/fedora-coreos-${var.os_version}-live-initramfs.x86_64.img", + "/assets/fedora-coreos/fedora-coreos-${var.os_version}-live-rootfs.x86_64.img" + ] + cached_args = [ "ip=dhcp", "rd.neednet=1", - "initrd=fedora-coreos-${var.os_version}-live-initramfs.x86_64.img", - "coreos.inst.image_url=${var.matchbox_http_endpoint}/assets/fedora-coreos/fedora-coreos-${var.os_version}-metal.x86_64.raw.xz", - "coreos.inst.ignition_url=${var.matchbox_http_endpoint}/ignition?uuid=$${uuid}&mac=$${mac:hexhyp}", "coreos.inst.install_dev=${var.install_disk}", + "coreos.inst.ignition_url=${var.matchbox_http_endpoint}/ignition?uuid=$${uuid}&mac=$${mac:hexhyp}", + "coreos.inst.image_url=${var.matchbox_http_endpoint}/assets/fedora-coreos/fedora-coreos-${var.os_version}-metal.x86_64.raw.xz", "console=tty0", "console=ttyS0", ] @@ -37,9 +43,7 @@ resource "matchbox_profile" "controllers" { name = format("%s-controller-%s", var.cluster_name, var.controllers.*.name[count.index]) kernel = local.kernel - initrd = [ - local.initrd - ] + initrd = local.initrd args = concat(local.args, var.kernel_args) raw_ignition = data.ct_config.controller-ignitions.*.rendered[count.index] @@ -73,9 +77,7 @@ resource "matchbox_profile" "workers" { name = format("%s-worker-%s", var.cluster_name, var.workers.*.name[count.index]) kernel = local.kernel - initrd = [ - local.initrd - ] + initrd = local.initrd args = concat(local.args, var.kernel_args) raw_ignition = data.ct_config.worker-ignitions.*.rendered[count.index]