-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1-ingress.tf
50 lines (44 loc) · 1.58 KB
/
1-ingress.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
#
# https://doc.traefik.io/traefik/routing/providers/kubernetes-crd/#kind-ingressroute
#
resource "kubernetes_manifest" "traefik-router" {
manifest = {
apiVersion = "traefik.containo.us/v1alpha1"
kind = "IngressRoute"
metadata = {
namespace = var.settings.namespace
name = var.settings.name
}
spec = {
entryPoints = [
"https"
]
routes = [
{
kind = "Rule"
match = "Host(`${var.settings.networking.ingress.hostname }`) && PathPrefix(`${var.settings.networking.ingress.path }`)"
# middlewares = [
# {
# name = "api-strip-prefix"
# namespace =var.settings.namespace
# }
# ]
services = [
{
name = var.settings.name
namespace = var.settings.namespace
port = var.settings.networking.ports[ 0 ].port
}
]
}
]
tls = {
secretName = "tls-traefik"
options = {
name = "traefik-tls-options"
namespace = "default"
}
}
}
}
}