forked from tibordp/terraform-hcloud-dualstack-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathha_load_balancer.tf
50 lines (39 loc) · 966 Bytes
/
ha_load_balancer.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
# A dual-stack cluster with a highly-available control plane using a
# Hetzner Cloud load balancer.
terraform {
required_providers {
hcloud = {
source = "hetznercloud/hcloud"
version = "1.26.0"
}
}
}
variable "hetzner_token" {}
provider "hcloud" {
token = var.hetzner_token
}
resource "hcloud_ssh_key" "key" {
name = "key"
public_key = file("~/.ssh/id_rsa.pub")
}
module "ha_cluster" {
source = "tibordp/dualstack-k8s/hcloud"
name = "k8s"
hcloud_ssh_key = hcloud_ssh_key.key.id
hcloud_token = var.hetzner_token
location = "hel1"
master_server_type = "cx31"
worker_server_type = "cx31"
worker_count = 3
master_count = 3
control_plane_lb_type = "lb11"
}
output "load_balancer_ipv4" {
value = module.k8s.load_balancer.ipv4
}
output "load_balancer_ipv6" {
value = module.k8s.load_balancer.ipv6
}
output "ha_cluster_kubeconfig" {
value = module.k8s.kubeconfig
}