From dd5c1a01d15a54a5ab28f21c38a90ff1b50c6c32 Mon Sep 17 00:00:00 2001 From: "K. N." <518555+mysticaltech@users.noreply.github.com> Date: Fri, 9 Aug 2024 03:34:58 +0200 Subject: [PATCH] Revert "Allows specifying k3s version" --- init.tf | 2 -- kube.tf.example | 4 ---- locals.tf | 12 ++---------- templates/plans.yaml.tpl | 8 -------- variables.tf | 6 ------ 5 files changed, 2 insertions(+), 30 deletions(-) diff --git a/init.tf b/init.tf index 483ecda7..0e9fb513 100644 --- a/init.tf +++ b/init.tf @@ -128,7 +128,6 @@ resource "null_resource" "kustomization" { # Redeploy when versions of addons need to be updated versions = join("\n", [ coalesce(var.initial_k3s_channel, "N/A"), - coalesce(var.install_k3s_version, "N/A"), coalesce(var.cluster_autoscaler_version, "N/A"), coalesce(var.hetzner_ccm_version, "N/A"), coalesce(var.hetzner_csi_version, "N/A"), @@ -234,7 +233,6 @@ resource "null_resource" "kustomization" { "${path.module}/templates/plans.yaml.tpl", { channel = var.initial_k3s_channel - version = var.install_k3s_version disable_eviction = !var.system_upgrade_enable_eviction drain = var.system_upgrade_use_drain }) diff --git a/kube.tf.example b/kube.tf.example index 657ac887..d22f10b7 100644 --- a/kube.tf.example +++ b/kube.tf.example @@ -597,10 +597,6 @@ module "kube-hetzner" { # The default is "v1.29". # initial_k3s_channel = "stable" - # Allows you to specify the k3s version. If defined, supersedes initial_k3s_channel. - # See https://github.com/k3s-io/k3s/releases - # install_k3s_version = "v1.30.2+k3s2" - # The cluster name, by default "k3s" # cluster_name = "" diff --git a/locals.tf b/locals.tf index 1c32fdca..ce6090c7 100644 --- a/locals.tf +++ b/locals.tf @@ -125,18 +125,10 @@ locals { swap_node_label = ["node.kubernetes.io/server-swap=enabled"] install_k3s_server = concat(local.common_pre_install_k3s_commands, [ - var.install_k3s_version == "" ? ( - "curl -sfL https://get.k3s.io | INSTALL_K3S_SKIP_START=true INSTALL_K3S_SKIP_SELINUX_RPM=true INSTALL_K3S_CHANNEL=${var.initial_k3s_channel} INSTALL_K3S_EXEC='server ${var.k3s_exec_server_args}' sh -" - ) : ( - "curl -sfL https://get.k3s.io | INSTALL_K3S_SKIP_START=true INSTALL_K3S_SKIP_SELINUX_RPM=true INSTALL_K3S_VERSION=${var.install_k3s_version} INSTALL_K3S_EXEC='server ${var.k3s_exec_server_args}' sh -" - ) + "curl -sfL https://get.k3s.io | INSTALL_K3S_SKIP_START=true INSTALL_K3S_SKIP_SELINUX_RPM=true INSTALL_K3S_CHANNEL=${var.initial_k3s_channel} INSTALL_K3S_EXEC='server ${var.k3s_exec_server_args}' sh -" ], (var.disable_selinux ? [] : local.apply_k3s_selinux), local.common_post_install_k3s_commands) install_k3s_agent = concat(local.common_pre_install_k3s_commands, [ - var.install_k3s_version == "" ? ( - "curl -sfL https://get.k3s.io | INSTALL_K3S_SKIP_START=true INSTALL_K3S_SKIP_SELINUX_RPM=true INSTALL_K3S_CHANNEL=${var.initial_k3s_channel} INSTALL_K3S_EXEC='agent ${var.k3s_exec_agent_args}' sh -" - ) : ( - "curl -sfL https://get.k3s.io | INSTALL_K3S_SKIP_START=true INSTALL_K3S_SKIP_SELINUX_RPM=true INSTALL_K3S_VERSION=${var.install_k3s_version} INSTALL_K3S_EXEC='agent ${var.k3s_exec_agent_args}' sh -" - ) + "curl -sfL https://get.k3s.io | INSTALL_K3S_SKIP_START=true INSTALL_K3S_SKIP_SELINUX_RPM=true INSTALL_K3S_CHANNEL=${var.initial_k3s_channel} INSTALL_K3S_EXEC='agent ${var.k3s_exec_agent_args}' sh -" ], (var.disable_selinux ? [] : local.apply_k3s_selinux), local.common_post_install_k3s_commands) control_plane_nodes = merge([ diff --git a/templates/plans.yaml.tpl b/templates/plans.yaml.tpl index 8ed05303..6312db07 100644 --- a/templates/plans.yaml.tpl +++ b/templates/plans.yaml.tpl @@ -10,11 +10,7 @@ metadata: k3s_upgrade: agent spec: concurrency: 1 - %{~ if version == "" ~} channel: https://update.k3s.io/v1-release/channels/${channel} - %{~ else ~} - version: ${version} - %{~ endif ~} serviceAccountName: system-upgrade nodeSelector: matchExpressions: @@ -46,11 +42,7 @@ metadata: k3s_upgrade: server spec: concurrency: 1 - %{~ if version == "" ~} channel: https://update.k3s.io/v1-release/channels/${channel} - %{~ else ~} - version: ${version} - %{~ endif ~} serviceAccountName: system-upgrade nodeSelector: matchExpressions: diff --git a/variables.tf b/variables.tf index c9f0de6e..671c5228 100644 --- a/variables.tf +++ b/variables.tf @@ -545,12 +545,6 @@ variable "initial_k3s_channel" { } } -variable "install_k3s_version" { - type = string - default = "" - description = "Allows you to specify the k3s version (Example: v1.29.6+k3s2). Supersedes initial_k3s_channel." -} - variable "system_upgrade_enable_eviction" { type = bool default = true