-
-
Notifications
You must be signed in to change notification settings - Fork 370
/
output.tf
78 lines (65 loc) · 2.48 KB
/
output.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
output "cluster_name" {
value = var.cluster_name
description = "Shared suffix for all resources belonging to this cluster."
}
output "network_id" {
value = data.hcloud_network.k3s.id
description = "The ID of the HCloud network."
}
output "ssh_key_id" {
value = local.hcloud_ssh_key_id
description = "The ID of the HCloud SSH key."
}
output "control_planes_public_ipv4" {
value = [
for obj in module.control_planes : obj.ipv4_address
]
description = "The public IPv4 addresses of the controlplane servers."
}
output "agents_public_ipv4" {
value = [
for obj in module.agents : obj.ipv4_address
]
description = "The public IPv4 addresses of the agent servers."
}
output "ingress_public_ipv4" {
description = "The public IPv4 address of the Hetzner load balancer (with fallback to first control plane node)"
value = local.has_external_load_balancer ? module.control_planes[keys(module.control_planes)[0]].ipv4_address : hcloud_load_balancer.cluster[0].ipv4
}
output "ingress_public_ipv6" {
description = "The public IPv6 address of the Hetzner load balancer (with fallback to first control plane node)"
value = local.has_external_load_balancer ? module.control_planes[keys(module.control_planes)[0]].ipv6_address : (var.load_balancer_disable_ipv6 ? null : hcloud_load_balancer.cluster[0].ipv6)
}
output "k3s_endpoint" {
description = "A controller endpoint to register new nodes"
value = "https://${var.use_control_plane_lb ? hcloud_load_balancer_network.control_plane.*.ip[0] : module.control_planes[keys(module.control_planes)[0]].private_ipv4_address}:6443"
}
output "k3s_token" {
description = "The k3s token to register new nodes"
value = local.k3s_token
sensitive = true
}
output "control_plane_nodes" {
description = "The control plane nodes"
value = [for node in module.control_planes : node]
}
output "agent_nodes" {
description = "The agent nodes"
value = [for node in module.agents : node]
}
# Keeping for backward compatibility
output "kubeconfig_file" {
value = local.kubeconfig_external
description = "Kubeconfig file content with external IP address"
sensitive = true
}
output "kubeconfig" {
value = local.kubeconfig_external
description = "Kubeconfig file content with external IP address"
sensitive = true
}
output "kubeconfig_data" {
description = "Structured kubeconfig data to supply to other providers"
value = local.kubeconfig_data
sensitive = true
}