feat: IPv6 support 🚀 (#855)

Co-authored-by: Devin Buhl <onedr0p@users.noreply.github.com>
This commit is contained in:
Skyler MäntysaariandDevin Buhl authored and GitHub committed 2023-07-17 16:42:25 -04:00
1 parent 6c8b9a4755
commit 1d911f6821
6 files changed
+83 -9

No files matched your search

@@ -1,10 +1,15 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
---
# https://rancher.com/docs/k3s/latest/en/installation/install-options/server-config/
# https://github.com/PyratLabs/ansible-role-k3s
k3s_control_node: true
k3s_server:
{% if bootstrap_ipv6_enabled | default(false) %}
node-ip: "{% raw %}{{ ansible_host }},{{ ansible_default_ipv6.address }}{% endraw %}"
{% else %}
node-ip: "{% raw %}{{ ansible_host }}{% endraw %}"
{% endif %}
tls-san:
- "{% raw %}{{ kube_vip_addr }}{% endraw %}"
docker: false
@@ -1,7 +1,12 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
---
# https://rancher.com/docs/k3s/latest/en/installation/install-options/agent-config/
# https://github.com/PyratLabs/ansible-role-k3s
k3s_control_node: false
k3s_agent:
{% if bootstrap_ipv6_enabled | default(false) %}
node-ip: "{% raw %}{{ ansible_host }},{{ ansible_default_ipv6.address }}{% endraw %}"
{% else %}
node-ip: "{% raw %}{{ ansible_host }}{% endraw %}"
{% endif %}
@@ -1,3 +1,4 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
---
# https://docs.k3s.io/helm
apiVersion: helm.cattle.io/v1
@@ -30,17 +31,29 @@ spec:
enabled: false
ipam:
mode: kubernetes
{% if bootstrap_ipv6_enabled | default(false) %}
ipv4NativeRoutingCIDR: "{% raw %}{{ k3s_server['cluster-cidr'].split(',')[0] }}{% endraw %}"
ipv6NativeRoutingCIDR: "{% raw %}{{ k3s_server['cluster-cidr'].split(',')[1] }}{% endraw %}"
ipv6:
enabled: true
{% else %}
ipv4NativeRoutingCIDR: "{% raw %}{{ k3s_server['cluster-cidr'] }}{% endraw %}"
{% endif %}
k8sServiceHost: "{% raw %}{{ kube_vip_addr }}{% endraw %}"
k8sServicePort: 6443
kubeProxyReplacement: strict
kubeProxyReplacementHealthzBindAddr: 0.0.0.0:10256
{% if bootstrap_ipv6_enabled | default(false) %}
l2announcements:
enabled: false
{% else %}
# https://github.com/cilium/cilium/issues/26586
l2announcements:
enabled: true
leaseDuration: 120s
leaseRenewDeadline: 60s
leaseRetryPeriod: 1s
{% endif %}
loadBalancer:
algorithm: maglev
mode: dsr
@@ -19,7 +19,11 @@ spec:
service:
name: kube-dns
# Choose the 10th IP address from the start of the service-cidr
{% if bootstrap_ipv6_enabled | default(false) %}
clusterIP: "{% raw %}{{ k3s_server['service-cidr'].split(',')[0] | ansible.utils.nthhost(10) }}{% endraw %}"
{% else %}
clusterIP: "{% raw %}{{ k3s_server['service-cidr'] | ansible.utils.nthhost(10) }}{% endraw %}"
{% endif %}
serviceAccount:
create: true
deployment: