|
16 | 16 |
|
17 | 17 | // This file was automatically generated from a template in ./autogen/main |
18 | 18 |
|
19 | | -/****************************************** |
20 | | - Manage kube-dns configmaps |
21 | | - *****************************************/ |
22 | | - |
23 | | -resource "kubernetes_config_map_v1_data" "kube-dns" { |
24 | | - count = local.custom_kube_dns_config && !local.upstream_nameservers_config ? 1 : 0 |
25 | | - |
26 | | - metadata { |
27 | | - name = "kube-dns" |
28 | | - namespace = "kube-system" |
29 | | - } |
30 | | - |
31 | | - data = { |
32 | | - stubDomains = <<EOF |
33 | | -${jsonencode(var.stub_domains)} |
34 | | -EOF |
35 | | - } |
36 | | - |
37 | | - force = true |
38 | | - |
39 | | - depends_on = [ |
40 | | - google_container_cluster.primary, |
41 | | - ] |
42 | | -} |
43 | | - |
44 | | -resource "kubernetes_config_map_v1_data" "kube-dns-upstream-nameservers" { |
45 | | - count = !local.custom_kube_dns_config && local.upstream_nameservers_config ? 1 : 0 |
46 | | - |
47 | | - metadata { |
48 | | - name = "kube-dns" |
49 | | - namespace = "kube-system" |
50 | | - } |
51 | | - |
52 | | - data = { |
53 | | - upstreamNameservers = <<EOF |
54 | | -${jsonencode(var.upstream_nameservers)} |
55 | | -EOF |
56 | | - } |
57 | | - |
58 | | - force = true |
59 | | - |
60 | | - depends_on = [ |
61 | | - google_container_cluster.primary, |
62 | | - ] |
63 | | -} |
64 | | - |
65 | | -# Fix the name typo in the previous ConfigMap creation call |
66 | | -moved { |
67 | | - from = kubernetes_config_map_v1_data.kube-dns-upstream-namservers |
68 | | - to = kubernetes_config_map_v1_data.kube-dns-upstream-nameservers |
69 | | -} |
70 | | - |
71 | | -resource "kubernetes_config_map_v1_data" "kube-dns-upstream-nameservers-and-stub-domains" { |
72 | | - count = local.custom_kube_dns_config && local.upstream_nameservers_config ? 1 : 0 |
73 | | - |
74 | | - metadata { |
75 | | - name = "kube-dns" |
76 | | - namespace = "kube-system" |
77 | | - } |
78 | | - |
79 | | - data = { |
80 | | - upstreamNameservers = <<EOF |
81 | | -${jsonencode(var.upstream_nameservers)} |
82 | | -EOF |
83 | | - |
84 | | - stubDomains = <<EOF |
85 | | -${jsonencode(var.stub_domains)} |
86 | | -EOF |
87 | | - } |
88 | | - |
89 | | - force = true |
90 | | - |
91 | | - depends_on = [ |
92 | | - google_container_cluster.primary, |
93 | | - ] |
94 | | -} |
0 commit comments