Skip to content

Commit

Permalink
Merge pull request #1448 from kube-hetzner/revert-1436-master
Browse files Browse the repository at this point in the history
Revert "Allows specifying k3s version"
  • Loading branch information
mysticaltech authored Aug 9, 2024
2 parents f5b69bc + dd5c1a0 commit 94d1f0e
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 30 deletions.
2 changes: 0 additions & 2 deletions init.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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
})
Expand Down
4 changes: 0 additions & 4 deletions kube.tf.example
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""

Expand Down
12 changes: 2 additions & 10 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
8 changes: 0 additions & 8 deletions templates/plans.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 0 additions & 6 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 94d1f0e

Please sign in to comment.