-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.tf
60 lines (52 loc) · 1.6 KB
/
main.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
resource "kubernetes_namespace" "linkerd" {
count = var.create_namespace ? 1 : 0
depends_on = [var.module_depends_on]
metadata {
name = var.namespace_name
labels = merge(local.linkerd_label_control_plane_ns, {
"config.linkerd.io/admission-webhooks" = "disabled",
"linkerd.io/is-control-plane" = "true"
})
annotations = {
"linkerd.io/inject" = "disabled"
}
}
}
data "template_file" "trust_anchor" {
template = file("${path.module}/configs/global")
vars = {
scheme = local.scheme
trustAnchorsPEM = trimspace(replace(local.trustAnchorsPEM, "\n", "\\n"))
}
}
resource "kubernetes_config_map" "linkerd_config" {
depends_on = [
kubernetes_namespace.linkerd[0]
]
metadata {
name = "linkerd-config"
namespace = local.linkerd_namespace
labels = {
"linkerd.io/control-plane-component" = local.linkerd_component_controller_name,
"linkerd.io/control-plane-ns" = "linkerd"
}
annotations = local.linkerd_annotation_created_by
}
data = {
global = trimspace(data.template_file.trust_anchor.rendered)
install = file("${path.module}/configs/install")
proxy = file("${path.module}/configs/proxy")
}
}
resource "kubernetes_config_map" "linkerd_config_addons" {
depends_on = [kubernetes_namespace.linkerd[0]]
metadata {
name = "linkerd-config-addons"
namespace = local.linkerd_namespace
labels = local.linkerd_label_control_plane_ns
annotations = local.linkerd_annotation_created_by
}
data = {
values = file("${path.module}/configs/addon_values")
}
}