This repository was archived by the owner on Jun 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathconditional.tf
More file actions
28 lines (27 loc) · 1.46 KB
/
conditional.tf
File metadata and controls
28 lines (27 loc) · 1.46 KB
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
# Assets generated only when certain options are chosen
# Populate calico chart values file named calico.yaml.
resource "local_file" "calico" {
content = templatefile("${path.module}/resources/charts/calico.yaml", {
calico_image = var.container_images["calico"]
calico_cni_image = var.container_images["calico_cni"]
calico_controllers_image = var.container_images["calico_controllers"]
flexvol_driver_image = var.container_images["flexvol_driver_image"]
network_mtu = var.network_mtu
network_encapsulation = indent(2, var.network_encapsulation == "vxlan" ? "vxlanMode: Always" : "ipipMode: Always")
ipip_enabled = var.network_encapsulation == "ipip" ? true : false
vxlan_enabled = var.network_encapsulation == "vxlan" ? true : false
network_ip_autodetection_method = var.network_ip_autodetection_method
pod_cidr = var.pod_cidr
enable_reporting = var.enable_reporting
blocked_metadata_cidrs = var.blocked_metadata_cidrs
failsafe_inbound_host_ports = var.failsafe_inbound_host_ports != null ? [
for protoport in var.failsafe_inbound_host_ports :
{
protocol = protoport.protocol
port = protoport.port
}
] : null
encrypt_pod_traffic = var.encrypt_pod_traffic
})
filename = "${var.asset_dir}/charts/kube-system/calico.yaml"
}