File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -19,3 +19,39 @@ module "lb" {
19
19
internal_vip = cidrhost (var. privnet_cidr , 100 )
20
20
enable_proxy_protocol = var. lb_enable_proxy_protocol
21
21
}
22
+
23
+ resource "cloudscale_load_balancer" "api" {
24
+ name = " ${ var . cluster_id } _api"
25
+ flavor_slug = " lb-standard"
26
+ zone_slug = " ${ var . region } 1"
27
+ }
28
+
29
+ resource "cloudscale_load_balancer_pool" "api" {
30
+ name = " ${ var . cluster_id } _api"
31
+ algorithm = " round_robin"
32
+ protocol = " tcp"
33
+ load_balancer_uuid = cloudscale_load_balancer. api . id
34
+ }
35
+
36
+ resource "cloudscale_load_balancer_listener" "api_k8s" {
37
+ name = " ${ var . cluster_id } _api-k8s"
38
+ pool_uuid = cloudscale_load_balancer_pool. api . id
39
+ protocol = " tcp"
40
+ protocol_port = 6443
41
+ }
42
+
43
+ resource "cloudscale_load_balancer_pool_member" "api" {
44
+ count = length (module. master . ip_addresses )
45
+ name = " ${ var . cluster_id } _api-member-${ count . index } "
46
+ pool_uuid = cloudscale_load_balancer_pool. api . id
47
+ protocol_port = 6443
48
+ address = module. master . ip_addresses [count . index ]
49
+ subnet_uuid = local. subnet_uuid
50
+ }
51
+
52
+ resource "cloudscale_load_balancer_health_monitor" "api" {
53
+ pool_uuid = cloudscale_load_balancer_pool. api . id
54
+ type = " https"
55
+ http_url_path = " /readyz"
56
+ http_host = " api.${ var . cluster_id } .${ var . base_domain } "
57
+ }
You can’t perform that action at this time.
0 commit comments