-
Notifications
You must be signed in to change notification settings - Fork 50
/
outputs.tf
80 lines (76 loc) · 2.29 KB
/
outputs.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
79
80
output "kubernetes" {
description = "Authentication credentials of Kubernetes (full administrator)."
value = {
cluster_ca_certificate = local.cluster_ca_certificate
client_certificate = local.client_certificate
client_key = local.client_key
api_endpoint = "https://${local.root_server_connection.host}:6443"
password = null
username = null
}
sensitive = true
}
output "kube_config" {
description = "Genereated kubeconfig."
value = var.generate_ca_certificates == false ? null : yamlencode({
apiVersion = "v1"
clusters = [{
cluster = {
certificate-authority-data = base64encode(local.cluster_ca_certificate)
server = "https://${local.root_server_connection.host}:6443"
}
name = var.cluster_domain
}]
contexts = [{
context = {
cluster = var.cluster_domain
user : "master-user"
}
name = var.cluster_domain
}]
current-context = var.cluster_domain
kind = "Config"
preferences = {}
users = [{
user = {
client-certificate-data : base64encode(local.client_certificate)
client-key-data : base64encode(local.client_key)
}
name : "master-user"
}]
})
sensitive = true
}
output "summary" {
description = "Current state of k3s (version & nodes)."
value = {
version : local.k3s_version
servers : [
for key, server in var.servers :
{
name = local.servers_metadata[key].name
annotations = try(server.annotations, [])
labels = try(server.labels, [])
taints = try(server.taints, [])
}
]
agents : [
for key, agent in var.agents :
{
name = local.agents_metadata[key].name
annotations = try(agent.annotations, [])
labels = try(agent.labels, [])
taints = try(agent.taints, [])
}
]
}
}
output "kubernetes_ready" {
description = "Dependency endpoint to synchronize k3s installation and provisioning."
value = null_resource.kubernetes_ready
}
output "kubernetes_cluster_secret" {
description = "Secret token used to join nodes to the cluster"
value = random_password.k3s_cluster_secret.result
sensitive = true
}