From 919e1087f8f24f4195aab28ff0e3a9fcc7378637 Mon Sep 17 00:00:00 2001 From: Karim Naufal Date: Mon, 7 Feb 2022 09:36:21 +0100 Subject: [PATCH] added kured and fixed initial ignition disk partitioning --- kured/kustomization.yaml | 2 +- kured/patch_latest.yaml | 22 ---------------------- locals.tf | 2 +- main.tf | 3 +-- templates/kured.yaml.tpl | 2 +- terraform.tfvars.example | 3 --- variables.tf | 6 ------ 7 files changed, 4 insertions(+), 36 deletions(-) delete mode 100644 kured/patch_latest.yaml diff --git a/kured/kustomization.yaml b/kured/kustomization.yaml index 3ab65d4..f02b074 100644 --- a/kured/kustomization.yaml +++ b/kured/kustomization.yaml @@ -5,4 +5,4 @@ resources: - "https://github.com/weaveworks/kured/releases/download/1.9.1/kured-1.9.1-dockerhub.yaml" patchesStrategicMerge: -- patch_latest.yaml \ No newline at end of file +- patch.yaml \ No newline at end of file diff --git a/kured/patch_latest.yaml b/kured/patch_latest.yaml deleted file mode 100644 index 9607628..0000000 --- a/kured/patch_latest.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: kured - namespace: kube-system -spec: - selector: - matchLabels: - name: kured - template: - metadata: - labels: - name: kured - spec: - serviceAccountName: kured - containers: - - name: kured - image: docker.io/weaveworks/kured:latest - imagePullPolicy: Always - command: - - /usr/bin/kured - - --reboot-command="/usr/bin/systemctl reboot" \ No newline at end of file diff --git a/locals.tf b/locals.tf index d9a48e0..d81f8a7 100644 --- a/locals.tf +++ b/locals.tf @@ -20,7 +20,7 @@ locals { "partprobe /dev/sda", "parted -s /dev/sda resizepart 4 99%", "parted -s /dev/sda mkpart primary ext2 99% 100%", - "sleep 5 && fdisk -l /dev/sda", + "udevadm settle", "mount /dev/sda4 /mnt/ && btrfs filesystem resize max /mnt && umount /mnt", "mke2fs -L ignition /dev/sda5", "mount /dev/sda5 /mnt", diff --git a/main.tf b/main.tf index edddd3a..cf453a2 100644 --- a/main.tf +++ b/main.tf @@ -166,8 +166,7 @@ resource "local_file" "hetzner_csi_config" { resource "local_file" "kured_config" { content = templatefile("${path.module}/templates/kured.yaml.tpl", { - version = data.github_release.kured.release_tag - patch_name = var.kured_container_latest ? "patch_latest" : "patch" + version = data.github_release.kured.release_tag }) filename = "${path.module}/kured/kustomization.yaml" file_permission = "0644" diff --git a/templates/kured.yaml.tpl b/templates/kured.yaml.tpl index de01771..6d18068 100644 --- a/templates/kured.yaml.tpl +++ b/templates/kured.yaml.tpl @@ -5,4 +5,4 @@ resources: - "https://github.com/weaveworks/kured/releases/download/${version}/kured-${version}-dockerhub.yaml" patchesStrategicMerge: -- ${patch_name}.yaml \ No newline at end of file +- patch.yaml \ No newline at end of file diff --git a/terraform.tfvars.example b/terraform.tfvars.example index a46c3c4..15d500b 100644 --- a/terraform.tfvars.example +++ b/terraform.tfvars.example @@ -26,9 +26,6 @@ agents_num = 2 # hetzner_ccm_containers_latest = true # hetzner_csi_containers_latest = true -# If you want to kustomize the kured container with the latest image tag and imagePullPolicy Always, set this to true, by default it's false -# kured_container_latest = true - # If you want to use letsencrypt with tls Challenge, the email address is used to send you certificates expiration notices # traefik_acme_tls = true # traefik_acme_email = "mail@example.com" diff --git a/variables.tf b/variables.tf index d1035ea..7852470 100644 --- a/variables.tf +++ b/variables.tf @@ -79,12 +79,6 @@ variable "hetzner_csi_containers_latest" { description = "Whether to kustomize the Hetzner CSI manifest with the latest or canary tags for containers and imagePullPolicy of Always" } -variable "kured_container_latest" { - type = bool - default = false - description = "Whether to kustomize the Kured container with the latest tag and imagePullPolicy of Always" -} - variable "traefik_acme_tls" { type = bool default = false