fix terraform fmt, enable traefik by default & return null if no lb

This commit is contained in:
jonny 2022-03-13 21:42:07 +01:00
parent 3fd610a9d8
commit 567a8268b1
4 changed files with 6 additions and 6 deletions

View File

@ -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)._

View File

@ -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"
}

View File

@ -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" {

View File

@ -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"
}