Merge pull request #69 from kube-hetzner/expose-load-balancer-ip

Expose load balancer ip
This commit is contained in:
Karim Naufal 2022-02-14 19:00:51 +01:00 committed by GitHub
commit 037f03c50b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -152,3 +152,9 @@ resource "hcloud_placement_group" "k3s" {
"engine" = "k3s"
}
}
data "hcloud_load_balancer" "traefik" {
name = "traefik"
depends_on = [hcloud_server.first_control_plane]
}

View File

@ -8,6 +8,11 @@ output "agents_public_ip" {
description = "The public IP addresses of the agent server."
}
output "load_balancer_public_ip" {
description = "The public IPv4 address of the Hetzner load balancer"
value = data.hcloud_load_balancer.traefik.ipv4
}
output "kubeconfig_file" {
value = local.kubeconfig_external
description = "Kubeconfig file content with external IP address"