From effe242f1b6de4bf30acf8f00cd4a3b28b0da41b Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Tue, 2 Aug 2022 18:12:37 -0700 Subject: [PATCH] Migrate Flatcar Linux from Ignition spec v2.3.0 to v3.3.0 * Requires poseidon v0.11+ and Flatcar Linux 3185.0.0+ (action required) * Previously, Flatcar Linux configs have been parsed as Container Linux Configs to Ignition v2.2.0 specs by poseidon/ct * Flatcar Linux starting in 3185.0.0 now supports Ignition v3.x specs (which are rendered from Butane Configs, like Fedora CoreOS) * poseidon/ct v0.11.0 adds support for the flatcar Butane Config variant so that Flatcar Linux can use Ignition v3.x Rel: * [Flatcar Support](https://flatcar-linux.org/docs/latest/provisioning/ignition/specification/#ignition-v3) * [poseidon/ct support](https://github.com/poseidon/terraform-provider-ct/pull/131) --- {cl => butane}/controller.yaml | 9 ++------- {cl => butane}/worker.yaml | 5 ++--- controllers.tf | 2 +- versions.tf | 2 +- workers.tf | 2 +- 5 files changed, 7 insertions(+), 13 deletions(-) rename {cl => butane}/controller.yaml (98%) rename {cl => butane}/worker.yaml (98%) diff --git a/cl/controller.yaml b/butane/controller.yaml similarity index 98% rename from cl/controller.yaml rename to butane/controller.yaml index 6abbeca..aa49d00 100644 --- a/cl/controller.yaml +++ b/butane/controller.yaml @@ -1,4 +1,5 @@ ---- +variant: flatcar +version: 1.0.0 systemd: units: - name: etcd-member.service @@ -142,15 +143,12 @@ systemd: storage: directories: - path: /var/lib/etcd - filesystem: root mode: 0700 overwrite: true - path: /etc/kubernetes - filesystem: root mode: 0755 files: - path: /opt/bootstrap/layout - filesystem: root mode: 0544 contents: inline: | @@ -173,7 +171,6 @@ storage: mv manifests-networking/* /opt/bootstrap/assets/manifests/ rm -rf assets auth static-manifests tls manifests-networking - path: /opt/bootstrap/apply - filesystem: root mode: 0544 contents: inline: | @@ -188,13 +185,11 @@ storage: sleep 5 done - path: /etc/sysctl.d/max-user-watches.conf - filesystem: root mode: 0644 contents: inline: | fs.inotify.max_user_watches=16184 - path: /etc/etcd/etcd.env - filesystem: root mode: 0644 contents: inline: | diff --git a/cl/worker.yaml b/butane/worker.yaml similarity index 98% rename from cl/worker.yaml rename to butane/worker.yaml index bf5db4e..7fc9f4d 100644 --- a/cl/worker.yaml +++ b/butane/worker.yaml @@ -1,4 +1,5 @@ ---- +variant: flatcar +version: 1.0.0 systemd: units: - name: docker.service @@ -108,11 +109,9 @@ systemd: storage: directories: - path: /etc/kubernetes - filesystem: root mode: 0755 files: - path: /etc/sysctl.d/max-user-watches.conf - filesystem: root mode: 0644 contents: inline: | diff --git a/controllers.tf b/controllers.tf index 1de068c..8432ff7 100644 --- a/controllers.tf +++ b/controllers.tf @@ -70,7 +70,7 @@ resource "digitalocean_tag" "controllers" { # Flatcar Linux controllers data "ct_config" "controllers" { count = var.controller_count - content = templatefile("${path.module}/cl/controller.yaml", { + content = templatefile("${path.module}/butane/controller.yaml", { # Cannot use cyclic dependencies on controllers or their DNS records etcd_name = "etcd${count.index}" etcd_domain = "${var.cluster_name}-etcd${count.index}.${var.dns_zone}" diff --git a/versions.tf b/versions.tf index 0e6823f..3c8aa2f 100644 --- a/versions.tf +++ b/versions.tf @@ -6,7 +6,7 @@ terraform { null = ">= 2.1" ct = { source = "poseidon/ct" - version = "~> 0.9" + version = "~> 0.11" } digitalocean = { source = "digitalocean/digitalocean" diff --git a/workers.tf b/workers.tf index cdf2919..863248a 100644 --- a/workers.tf +++ b/workers.tf @@ -58,7 +58,7 @@ resource "digitalocean_tag" "workers" { # Flatcar Linux worker data "ct_config" "worker" { - content = templatefile("${path.module}/cl/worker.yaml", { + content = templatefile("${path.module}/butane/worker.yaml", { cluster_dns_service_ip = cidrhost(var.service_cidr, 10) cluster_domain_suffix = var.cluster_domain_suffix })