Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(talos): Add option to specify other gateway #1316

Merged
merged 3 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ spec:
peerASN: {{ distribution.talos.bgp.peer_asn }}
{% endfor %}
{% else %}
{% if nodes.default_gateway %}
- peerAddress: "{{ nodes.default_gateway }}/32"
{% else %}
- peerAddress: "{{ nodes.host_network | nthhost(1) }}/32"
{% endif %}
peerASN: {{ distribution.talos.bgp.peer_asn }}
{% endif %}
serviceSelector:
Expand Down
8 changes: 8 additions & 0 deletions bootstrap/templates/kubernetes/talos/talconfig.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ nodes:
mtu: 1500
routes:
- network: 0.0.0.0/0
{% if nodes.default_gateway %}
gateway: "{{ nodes.default_gateway }}"
{% else %}
gateway: "{{ nodes.host_network | nthhost(1) }}"
{% endif %}
{% if item.controller %}
vip:
ip: "{{ cluster.endpoint_vip }}"
Expand All @@ -61,7 +65,11 @@ nodes:
mtu: 1500
routes:
- network: 0.0.0.0/0
{% if nodes.default_gateway %}
gateway: "{{ nodes.default_gateway }}"
{% else %}
gateway: "{{ nodes.host_network | nthhost(1) }}"
{% endif %}
{% if item.controller %}
vip:
ip: "{{ cluster.endpoint_vip }}"
Expand Down
3 changes: 3 additions & 0 deletions config.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ distribution:
# loadbalancer_network: 10.123.0.0/16
# secureboot:
# # (Optional) Enable secureboot on UEFI systems. Not supported on x86 platforms in BIOS mode.
# # If you want to use this. Please make sure to boot from secureboot ISO and enroll keys first.
# # See: https://www.talos.dev/latest/talos-guides/install/bare-metal-platforms/secureboot
# enabled: true
# # (Optional) Enable TPM-based disk encryption. Requires TPM 2.0
Expand All @@ -53,6 +54,8 @@ timezone: ""
nodes:
# (Required) CIDR your nodes are on (e.g. 192.168.1.0/24)
host_network: ""
# (Optional) Talos only: If your gateway is not on the .1 address of above CIDR you can set it here (e.g. 192.168.1.254)
default_gateway: ""
# (Optional) The DNS server to use for the cluster, this can be an existing
# local DNS server or a public one.
# Default is ["1.1.1.1", "1.0.0.1"]
Expand Down
Loading