diff --git a/bootstrap/templates/kubernetes/talos/talconfig.yaml.j2 b/bootstrap/templates/kubernetes/talos/talconfig.yaml.j2 index 5354cf09..1e17fb79 100644 --- a/bootstrap/templates/kubernetes/talos/talconfig.yaml.j2 +++ b/bootstrap/templates/kubernetes/talos/talconfig.yaml.j2 @@ -35,6 +35,20 @@ nodes: networkInterfaces: - interface: eth0 dhcp: false + {% if cluster.nodes.talos.vlan %} + vlans: + - vlanId: {{ cluster.nodes.talos.vlan }} + addresses: + - "{{ item.address }}/{{ cluster.nodes.host_network.split('/') | last }}" + mtu: 1500 + routes: + - network: 0.0.0.0/0 + gateway: "{{ cluster.nodes.host_network | nthhost(1) }}" + {% if item.controller %} + vip: + ip: "{{ cluster.endpoint_vip }}" + {% endif %} + {% else %} addresses: - "{{ item.address }}/{{ cluster.nodes.host_network.split('/') | last }}" mtu: 1500 @@ -45,6 +59,7 @@ nodes: vip: ip: "{{ cluster.endpoint_vip }}" {% endif %} + {% endif %} {% endfor %} controlPlane: diff --git a/config.sample.yaml b/config.sample.yaml index c3482b4d..b2c612fb 100644 --- a/config.sample.yaml +++ b/config.sample.yaml @@ -51,6 +51,9 @@ cluster: # officialExtensions: # - siderolabs/intel-ucode # - siderolabs/i915-ucode + # # (Optional) Add vlan tag to network master device + # # See: https://www.talos.dev/latest/advanced/advanced-networking/#vlans + # vlan: 1 # (Required) The pod CIDR for the cluster, this must NOT overlap with any # existing networks and is usually a /16 (64K IPs). # If you want to use IPv6 check the advanced flags below