Open mateuszlewko opened 8 months ago
I think the initial config created with null_resources.first_control_plane is overridden by null_resource.control_plane_config. Is this intended? Perhaps in locals.k3s-config we should add something like cluster-init: k == 0
?
@mateuszlewko Yes, indeed we override it as to not make the first control-plane special. Could you please explain your proposed solution for the restore flow, not sure I follow.
Hey,
I was referring to "Backup and restore a cluster" guide in https://github.com/kube-hetzner/terraform-hcloud-kube-hetzner?tab=readme-ov-file#examples.
The postinstall_exec script there contains:
export CLUSTERINIT=$(cat /etc/rancher/k3s/config.yaml | grep -i '"cluster-init": true')
if [ -n "$CLUSTERINIT" ]; then
echo indeed this is the first control plane node > /tmp/restorenotes
which kind of assumes the first control plane node is special.
@mateuszlewko Ah yes, so that needs to change, PR welcome to correct this example, please.
Description
According to steps for restoring the cluster, one of the control plane nodes should have "cluster-init: true" set in /etc/rancher/k3s/config.yaml. I have a cluster with 1 c-p node and inspecting the config.yaml file shows there is no such option set there.
Do you perhaps have an idea why is that? It's a freshly created cluster with the config below.
Kube.tf file
Screenshots
No response
Platform
Mac