forked from getamis/terraform-ignition-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddons.tf
59 lines (53 loc) · 1.78 KB
/
addons.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
locals {
kube_proxy_cm_v1alpha1 = {
data = {
"config.conf" = merge(local.kube_proxy_config, {
apiVersion = "kubeproxy.config.k8s.io/v1alpha1"
kind = "KubeProxyConfiguration"
clientConnection = {
kubeconfig = "/var/lib/kube-proxy/kubeconfig.conf"
}
})
}
}
}
data "ignition_file" "kube_proxy" {
mode = 420
path = "${local.etc_path}/addons/kube-proxy.yaml"
overwrite = true
content {
content = templatefile("${path.module}/templates/addons/kube-proxy.yaml.tpl", {
image = "${local.containers["kube_proxy"].repo}:${local.containers["kube_proxy"].tag}"
})
mime = "text/yaml"
}
}
data "ignition_file" "kube_proxy_cm" {
mode = 420
path = "${local.etc_path}/addons/kube-proxy-cm.yaml"
overwrite = true
content {
content = templatefile("${path.module}/templates/addons/kube-proxy-cm.yaml.tpl", {
endpoint = var.internal_endpoint
content = local.kube_proxy_cm_v1alpha1
})
mime = "text/yaml"
}
}
// TODO(kairen): add support for stub-domains
data "ignition_file" "coredns" {
mode = 420
path = "${local.etc_path}/addons/coredns.yaml"
overwrite = true
content {
content = templatefile("${path.module}/templates/addons/coredns.yaml.tpl", {
image = "${local.containers["coredns"].repo}:${local.containers["coredns"].tag}"
replicas = local.coredns_config["replicas"]
cluster_dns_ip = local.coredns_config["cluster_dns_ip"]
cluster_domain = local.coredns_config["cluster_domain"]
upstream_nameservers = local.coredns_config["upstream_nameservers"]
located_on_the_same_host = local.coredns_config["located_on_the_same_host"]
})
mime = "text/yaml"
}
}