forked from demeter-run/ext-cardano-ogmios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservice.tf
69 lines (59 loc) · 1.84 KB
/
service.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
resource "kubernetes_service_v1" "proxy_service_aws" {
for_each = toset([for n in toset(["loadbalancer"]) : n if var.cloud_provider == "aws"])
metadata {
name = local.name
namespace = var.namespace
annotations = {
"service.beta.kubernetes.io/aws-load-balancer-nlb-target-type" : "instance"
"service.beta.kubernetes.io/aws-load-balancer-scheme" : "internet-facing"
"service.beta.kubernetes.io/aws-load-balancer-type" : "external"
"service.beta.kubernetes.io/aws-load-balancer-healthcheck-protocol" : "HTTPS"
"service.beta.kubernetes.io/aws-load-balancer-healthcheck-path" : "/healthz"
"service.beta.kubernetes.io/aws-load-balancer-healthcheck-port" : var.healthcheck_port != null ? var.healthcheck_port : "traffic-port"
}
}
spec {
load_balancer_class = "service.k8s.aws/nlb"
selector = local.proxy_labels
port {
name = "proxy"
port = 443
target_port = local.proxy_port
protocol = "TCP"
}
port {
name = "health"
port = 80
target_port = local.prometheus_port
protocol = "TCP"
}
type = "LoadBalancer"
}
}
resource "kubernetes_service_v1" "proxy_service_gcp" {
for_each = toset([for n in toset(["loadbalancer"]) : n if var.cloud_provider == "gcp"])
metadata {
name = local.name
namespace = var.namespace
annotations = {
"cloud.google.com/l4-rbs" : "enabled"
}
}
spec {
external_traffic_policy = "Local"
selector = local.proxy_labels
port {
name = "proxy"
port = 443
target_port = local.proxy_port
protocol = "TCP"
}
port {
name = "health"
port = 80
target_port = local.prometheus_port
protocol = "TCP"
}
type = "LoadBalancer"
}
}