feat: support external cilium networking
This commit is contained in:
parent
58aec37af2
commit
477a954716
|
|
@ -2,6 +2,8 @@ clusterName: ${cluster_name}
|
||||||
endpoint: ${cluster_endpoint}
|
endpoint: ${cluster_endpoint}
|
||||||
domain: ${cluster_domain}
|
domain: ${cluster_domain}
|
||||||
talosVersion: ${talos_version}
|
talosVersion: ${talos_version}
|
||||||
|
cniConfig:
|
||||||
|
name: ${cni_name}
|
||||||
allowSchedulingOnMasters: ${length(control_plane_nodes) == 1 ? "true" : "false"}
|
allowSchedulingOnMasters: ${length(control_plane_nodes) == 1 ? "true" : "false"}
|
||||||
|
|
||||||
# Network configuration
|
# Network configuration
|
||||||
|
|
@ -42,14 +44,18 @@ nodes:
|
||||||
networkInterfaces:
|
networkInterfaces:
|
||||||
%{ for i, net in node.networks ~}
|
%{ for i, net in node.networks ~}
|
||||||
- interface: eth${i}
|
- interface: eth${i}
|
||||||
%{ if i == 0 ~}
|
%{ if net.ip != null ~}
|
||||||
addresses:
|
addresses:
|
||||||
- "${net.ip}/${split("/", net.cidr)[1]}"
|
- "${net.ip}/${split("/", net.cidr)[1]}"
|
||||||
|
%{ if net.gateway != null ~}
|
||||||
routes:
|
routes:
|
||||||
- network: 0.0.0.0/0
|
- network: 0.0.0.0/0
|
||||||
gateway: ${net.gateway}
|
gateway: ${net.gateway}
|
||||||
|
%{ endif ~}
|
||||||
|
%{ if i == 0 ~}
|
||||||
vip:
|
vip:
|
||||||
ip: ${control_plane_vip}
|
ip: ${control_plane_vip}
|
||||||
|
%{ endif ~}
|
||||||
%{ else ~}
|
%{ else ~}
|
||||||
dhcp: true
|
dhcp: true
|
||||||
%{ endif ~}
|
%{ endif ~}
|
||||||
|
|
@ -83,12 +89,14 @@ nodes:
|
||||||
networkInterfaces:
|
networkInterfaces:
|
||||||
%{ for i, net in node.networks ~}
|
%{ for i, net in node.networks ~}
|
||||||
- interface: eth${i}
|
- interface: eth${i}
|
||||||
%{ if i == 0 ~}
|
%{ if net.ip != null ~}
|
||||||
addresses:
|
addresses:
|
||||||
- "${net.ip}/${split("/", net.cidr)[1]}"
|
- "${net.ip}/${split("/", net.cidr)[1]}"
|
||||||
|
%{ if net.gateway != null ~}
|
||||||
routes:
|
routes:
|
||||||
- network: 0.0.0.0/0
|
- network: 0.0.0.0/0
|
||||||
gateway: ${net.gateway}
|
gateway: ${net.gateway}
|
||||||
|
%{ endif ~}
|
||||||
%{ else ~}
|
%{ else ~}
|
||||||
dhcp: true
|
dhcp: true
|
||||||
%{ endif ~}
|
%{ endif ~}
|
||||||
|
|
@ -122,12 +130,14 @@ nodes:
|
||||||
networkInterfaces:
|
networkInterfaces:
|
||||||
%{ for i, net in node.networks ~}
|
%{ for i, net in node.networks ~}
|
||||||
- interface: eth${i}
|
- interface: eth${i}
|
||||||
%{ if i == 0 ~}
|
%{ if net.ip != null ~}
|
||||||
addresses:
|
addresses:
|
||||||
- "${net.ip}/${split("/", net.cidr)[1]}"
|
- "${net.ip}/${split("/", net.cidr)[1]}"
|
||||||
|
%{ if net.gateway != null ~}
|
||||||
routes:
|
routes:
|
||||||
- network: 0.0.0.0/0
|
- network: 0.0.0.0/0
|
||||||
gateway: ${net.gateway}
|
gateway: ${net.gateway}
|
||||||
|
%{ endif ~}
|
||||||
%{ else ~}
|
%{ else ~}
|
||||||
dhcp: true
|
dhcp: true
|
||||||
%{ endif ~}
|
%{ endif ~}
|
||||||
|
|
@ -161,12 +171,14 @@ nodes:
|
||||||
networkInterfaces:
|
networkInterfaces:
|
||||||
%{ for i, net in node.networks ~}
|
%{ for i, net in node.networks ~}
|
||||||
- interface: eth${i}
|
- interface: eth${i}
|
||||||
%{ if i == 0 ~}
|
%{ if net.ip != null ~}
|
||||||
addresses:
|
addresses:
|
||||||
- "${net.ip}/${split("/", net.cidr)[1]}"
|
- "${net.ip}/${split("/", net.cidr)[1]}"
|
||||||
|
%{ if net.gateway != null ~}
|
||||||
routes:
|
routes:
|
||||||
- network: 0.0.0.0/0
|
- network: 0.0.0.0/0
|
||||||
gateway: ${net.gateway}
|
gateway: ${net.gateway}
|
||||||
|
%{ endif ~}
|
||||||
%{ else ~}
|
%{ else ~}
|
||||||
dhcp: true
|
dhcp: true
|
||||||
%{ endif ~}
|
%{ endif ~}
|
||||||
|
|
|
||||||
|
|
@ -45,9 +45,9 @@ variable "talos_factory_schematic_id" {
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "cni_name" {
|
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
|
type = string
|
||||||
default = "flannel"
|
default = "none"
|
||||||
}
|
}
|
||||||
|
|
||||||
# --- Global Network Configuration ---
|
# --- Global Network Configuration ---
|
||||||
|
|
@ -193,4 +193,4 @@ variable "image_cache_proxy" {
|
||||||
ip = ""
|
ip = ""
|
||||||
port = 3128
|
port = 3128
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue