From 567a8268b13d8c01e879e6afe6771680becd423a Mon Sep 17 00:00:00 2001 From: jonny Date: Sun, 13 Mar 2022 21:42:07 +0100 Subject: [PATCH] fix terraform fmt, enable traefik by default & return null if no lb --- README.md | 2 +- kubeconfig.tf | 6 +++--- output.tf | 2 +- variables.tf | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6cc23fc..34581ac 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ _Please note that we are not affiliated to Hetzner, this is just an open source - Proper use of the underlying Hetzner private network to remove the need for encryption and minimize latency. - Automatic HA with the default setting of three control-plane and two agents nodes. - Ability to add or remove as many nodes as you want while the cluster stays running. -- (Optional) Traefik ingress controller attached to a Hetzner load balancer with proxy protocol turned on. +- Automatic Traefik ingress controller attached to a Hetzner load balancer with proxy protocol turned on. - (Optional) Out of the box config of Traefik with SSL certficate auto-generation. _It uses Terraform to deploy as it's easy to use, and Hetzner provides a great [Hetzner Terraform Provider](https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs)._ diff --git a/kubeconfig.tf b/kubeconfig.tf index 67832b3..1c5cee5 100644 --- a/kubeconfig.tf +++ b/kubeconfig.tf @@ -24,7 +24,7 @@ locals { } resource "local_sensitive_file" "kubeconfig" { - content = local.kubeconfig_external - filename = "kubeconfig.yaml" - file_permission = "600" + content = local.kubeconfig_external + filename = "kubeconfig.yaml" + file_permission = "600" } diff --git a/output.tf b/output.tf index b84c324..89514ef 100644 --- a/output.tf +++ b/output.tf @@ -17,7 +17,7 @@ output "agents_public_ipv4" { output "load_balancer_public_ipv4" { description = "The public IPv4 address of the Hetzner load balancer" - value = local.is_single_node_cluster || var.traefik_enabled == false ? module.control_planes[0].ipv4_address : data.hcloud_load_balancer.traefik[0].ipv4 + value = local.is_single_node_cluster ? module.control_planes[0].ipv4_address : var.traefik_enabled == false ? null : data.hcloud_load_balancer.traefik[0].ipv4 } output "kubeconfig_file" { diff --git a/variables.tf b/variables.tf index f975e8f..a5f6b22 100644 --- a/variables.tf +++ b/variables.tf @@ -71,7 +71,7 @@ variable "hetzner_csi_version" { variable "traefik_enabled" { type = bool - default = false + default = true description = "Whether to enable or disbale k3s traefik installation" }