From 5fa7c0d4f62831463bca46bba250a8fc84107195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roy?= Date: Wed, 20 Mar 2024 02:51:15 -0700 Subject: [PATCH] feat: Make the cluster name configurable (#1379) --- .../templates/kubernetes/bootstrap/talos/talconfig.yaml.j2 | 2 +- .../templates/partials/cilium-values-full.partial.yaml.j2 | 2 +- .../templates/partials/cilium-values-init.partial.yaml.j2 | 2 +- config.sample.yaml | 3 +++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bootstrap/templates/kubernetes/bootstrap/talos/talconfig.yaml.j2 b/bootstrap/templates/kubernetes/bootstrap/talos/talconfig.yaml.j2 index 372d2c8e..24a94883 100644 --- a/bootstrap/templates/kubernetes/bootstrap/talos/talconfig.yaml.j2 +++ b/bootstrap/templates/kubernetes/bootstrap/talos/talconfig.yaml.j2 @@ -5,7 +5,7 @@ talosVersion: v1.6.6 # renovate: datasource=docker depName=ghcr.io/siderolabs/kubelet kubernetesVersion: v1.29.3 -clusterName: &cluster home-kubernetes +clusterName: &cluster #{ bootstrap_cluster_name|default('home-kubernetes', true) }# endpoint: https://#{ bootstrap_controllers_vip }#:6443 clusterPodNets: - "#{ bootstrap_pod_network.split(',')[0] }#" diff --git a/bootstrap/templates/partials/cilium-values-full.partial.yaml.j2 b/bootstrap/templates/partials/cilium-values-full.partial.yaml.j2 index 3a17c8c8..37c4f7c4 100644 --- a/bootstrap/templates/partials/cilium-values-full.partial.yaml.j2 +++ b/bootstrap/templates/partials/cilium-values-full.partial.yaml.j2 @@ -9,7 +9,7 @@ cgroup: hostRoot: /sys/fs/cgroup cluster: id: 1 - name: home-kubernetes + name: #{ bootstrap_cluster_name|default('home-kubernetes', true) }# containerRuntime: integration: containerd #% if bootstrap_distribution in ["k3s"] %# diff --git a/bootstrap/templates/partials/cilium-values-init.partial.yaml.j2 b/bootstrap/templates/partials/cilium-values-init.partial.yaml.j2 index 9dae5d5a..d7c9875c 100644 --- a/bootstrap/templates/partials/cilium-values-init.partial.yaml.j2 +++ b/bootstrap/templates/partials/cilium-values-init.partial.yaml.j2 @@ -9,7 +9,7 @@ cgroup: hostRoot: /sys/fs/cgroup cluster: id: 1 - name: home-kubernetes + name: #{ bootstrap_cluster_name|default('home-kubernetes', true) }# containerRuntime: integration: containerd #% if bootstrap_distribution in ["k3s"] %# diff --git a/config.sample.yaml b/config.sample.yaml index ef071dae..7a63975e 100644 --- a/config.sample.yaml +++ b/config.sample.yaml @@ -10,6 +10,9 @@ bootstrap_timezone: "" # (Required) Distribution can either be k3s or talos bootstrap_distribution: k3s +# (Optional) Cluster name; affects Cilium and Talos +bootstrap_cluster_name: "" + # (Required: Talos) Talos Specific Options bootstrap_talos: # (Required: Talos) If you need any additional System Extensions, and/or add kernel arguments generate a schematic ID.