Merge pull request #86 from kube-hetzner/expose-load-balancer-ip
Expose load balancer ip
This commit is contained in:
commit
cb42c0bf77
4
main.tf
4
main.tf
@ -153,10 +153,8 @@ resource "hcloud_placement_group" "k3s" {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
data "hcloud_load_balancer" "traefik" {
|
||||
name = "traefik"
|
||||
|
||||
depends_on = [hcloud_server.agents[0]]
|
||||
depends_on = [null_resource.first_control_plane]
|
||||
}
|
||||
*/
|
||||
|
10
master.tf
10
master.tf
@ -157,7 +157,15 @@ resource "null_resource" "first_control_plane" {
|
||||
"kubectl apply -k /tmp/post_install",
|
||||
"echo 'Waiting for the system-upgrade-controller deployment to become available...'",
|
||||
"kubectl -n system-upgrade wait --for=condition=available --timeout=120s deployment/system-upgrade-controller",
|
||||
"kubectl -n system-upgrade apply -f /tmp/post_install/plans.yaml"
|
||||
"kubectl -n system-upgrade apply -f /tmp/post_install/plans.yaml",
|
||||
<<-EOT
|
||||
timeout 120 bash <<EOF
|
||||
until [ -n "\$(kubectl get -n kube-system service/traefik --output=jsonpath='{.status.loadBalancer.ingress[0].ip}' 2> /dev/null)" ]; do
|
||||
echo "Waiting for load-balancer to get an IP..."
|
||||
sleep 2
|
||||
done
|
||||
EOF
|
||||
EOT
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -8,12 +8,10 @@ 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
|
||||
|
Loading…
Reference in New Issue
Block a user