This repository has been archived by the owner on Apr 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
output.tf
103 lines (93 loc) · 4 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
Copyright 2019 The KubeOne Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
output "kubeone_api" {
description = "kube-apiserver LB endpoint"
value = {
endpoint = local.kubeapi_endpoint
apiserver_alternative_names = var.apiserver_alternative_names
}
}
output "ssh_commands" {
value = formatlist("ssh ${local.ssh_username}@%s", hcloud_server.control_plane.*.ipv4_address)
}
output "kubeone_hosts" {
description = "Control plane endpoints to SSH to"
value = {
control_plane = {
hostnames = hcloud_server.control_plane.*.name
cluster_name = var.cluster_name
cloud_provider = "hetzner"
private_address = hcloud_server_network.control_plane.*.ip
public_address = hcloud_server.control_plane.*.ipv4_address
network_id = hcloud_network.net.id
ssh_agent_socket = var.ssh_agent_socket
ssh_port = var.ssh_port
ssh_private_key_file = var.ssh_private_key_file
ssh_user = local.ssh_username
ssh_hosts_keys = var.ssh_hosts_keys
bastion_host_key = var.bastion_host_key
}
}
}
output "kubeone_workers" {
description = "Workers definitions, that will be transformed into MachineDeployment object"
value = {
# following outputs will be parsed by kubeone and automatically merged into
# corresponding (by name) worker definition
"${var.cluster_name}-pool1" = {
replicas = var.initial_machinedeployment_replicas
providerSpec = {
annotations = {
"k8c.io/operating-system-profile" = var.initial_machinedeployment_operating_system_profile
"cluster.k8s.io/cluster-api-autoscaler-node-group-min-size" = tostring(local.cluster_autoscaler_min_replicas)
"cluster.k8s.io/cluster-api-autoscaler-node-group-max-size" = tostring(local.cluster_autoscaler_max_replicas)
}
sshPublicKeys = [file(var.ssh_public_key_file)]
operatingSystem = local.worker_os
operatingSystemSpec = {
distUpgradeOnBoot = false
}
# nodeAnnotations are applied on resulting Node objects
# nodeAnnotations = {
# "key" = "value"
# }
# machineObjectAnnotations are applied on resulting Machine objects
# uncomment to following to set those kubelet parameters. More into at:
# https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/
# machineObjectAnnotations = {
# "v1.kubelet-config.machine-controller.kubermatic.io/SystemReserved" = "cpu=200m,memory=200Mi"
# "v1.kubelet-config.machine-controller.kubermatic.io/KubeReserved" = "cpu=200m,memory=300Mi"
# "v1.kubelet-config.machine-controller.kubermatic.io/EvictionHard" = ""
# "v1.kubelet-config.machine-controller.kubermatic.io/MaxPods" = "110"
# }
cloudProviderSpec = {
# provider specific fields:
# see example under `cloudProviderSpec` section at:
# https://github.com/kubermatic/machine-controller/blob/main/examples/hetzner-machinedeployment.yaml
serverType = var.worker_type
location = var.datacenter
image = local.image
networks = [
hcloud_network.net.id
]
# Datacenter (optional)
# datacenter = ""
labels = {
"kubeone_cluster_name" = var.cluster_name
"${var.cluster_name}-workers" = "pool1"
}
}
}
}
}
}