diff --git a/terraform/templates/talconfig.yaml.tpl b/terraform/templates/talconfig.yaml.tpl index 3140895..d291c2c 100644 --- a/terraform/templates/talconfig.yaml.tpl +++ b/terraform/templates/talconfig.yaml.tpl @@ -2,6 +2,8 @@ clusterName: ${cluster_name} endpoint: ${cluster_endpoint} domain: ${cluster_domain} talosVersion: ${talos_version} +cniConfig: + name: ${cni_name} allowSchedulingOnMasters: ${length(control_plane_nodes) == 1 ? "true" : "false"} # Network configuration @@ -42,14 +44,18 @@ nodes: networkInterfaces: %{ for i, net in node.networks ~} - interface: eth${i} -%{ if i == 0 ~} +%{ if net.ip != null ~} addresses: - "${net.ip}/${split("/", net.cidr)[1]}" +%{ if net.gateway != null ~} routes: - network: 0.0.0.0/0 gateway: ${net.gateway} +%{ endif ~} +%{ if i == 0 ~} vip: ip: ${control_plane_vip} +%{ endif ~} %{ else ~} dhcp: true %{ endif ~} @@ -83,12 +89,14 @@ nodes: networkInterfaces: %{ for i, net in node.networks ~} - interface: eth${i} -%{ if i == 0 ~} +%{ if net.ip != null ~} addresses: - "${net.ip}/${split("/", net.cidr)[1]}" +%{ if net.gateway != null ~} routes: - network: 0.0.0.0/0 gateway: ${net.gateway} +%{ endif ~} %{ else ~} dhcp: true %{ endif ~} @@ -122,12 +130,14 @@ nodes: networkInterfaces: %{ for i, net in node.networks ~} - interface: eth${i} -%{ if i == 0 ~} +%{ if net.ip != null ~} addresses: - "${net.ip}/${split("/", net.cidr)[1]}" +%{ if net.gateway != null ~} routes: - network: 0.0.0.0/0 gateway: ${net.gateway} +%{ endif ~} %{ else ~} dhcp: true %{ endif ~} @@ -161,12 +171,14 @@ nodes: networkInterfaces: %{ for i, net in node.networks ~} - interface: eth${i} -%{ if i == 0 ~} +%{ if net.ip != null ~} addresses: - "${net.ip}/${split("/", net.cidr)[1]}" +%{ if net.gateway != null ~} routes: - network: 0.0.0.0/0 gateway: ${net.gateway} +%{ endif ~} %{ else ~} dhcp: true %{ endif ~} diff --git a/terraform/variables.tf b/terraform/variables.tf index f4fb66e..74f1f6c 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -45,9 +45,9 @@ variable "talos_factory_schematic_id" { } variable "cni_name" { - description = "The name of the CNI to configure (e.g., 'flannel', 'cilium')." + description = "The built-in Talos CNI to configure; use 'none' when Flux installs Cilium." type = string - default = "flannel" + default = "none" } # --- Global Network Configuration --- @@ -193,4 +193,4 @@ variable "image_cache_proxy" { ip = "" port = 3128 } -} \ No newline at end of file +}