Files
terraform-modules/kubernetes/flannel/configmap.tf

40 lines
802 B
HCL

resource "kubernetes_config_map" "this" {
metadata {
namespace = var.namespace
name = "kube-flannel-cfg"
labels = {
app = "flannel"
"k8s-app" = "cni"
}
}
data = {
"cni-conf.json" = jsonencode({
name = "cbr0",
cniVersion = "0.3.1",
plugins = [
{
type = "flannel",
delegate = {
hairpinMode = true,
isDefaultGateway = true,
}
},
{
type = "portmap",
capabilities = {
portMappings = true,
}
},
]
})
"net-conf.json" = jsonencode({
Network = var.cluster_cidr,
Backend = {
Type = "vxlan",
VNI = var.vxlan_id,
Port = var.vxlan_port,
}
})
}
}