Add support for ipv6 only cluster via "enable_ipv6only_stack_networks" (#11831)

This commit is contained in:
Boris
2025-01-27 15:15:22 +03:00
committed by GitHub
parent e107022b4b
commit 76c0a3aa75
37 changed files with 216 additions and 104 deletions

View File

@@ -0,0 +1,9 @@
$os = "ubuntu2404"
$vm_cpus = 2
$libvirt_volume_cache = "unsafe"
# Checking for box update can trigger API rate limiting
# https://www.vagrantup.com/docs/vagrant-cloud/request-limits.html
$box_check_update = false
$network_plugin = "calico"

View File

@@ -0,0 +1,11 @@
---
# Instance settings
cloud_image: ubuntu-2404
mode: default
# Kubespray settings
enable_ipv6only_stack_networks: true
kube_network_plugin: calico
etcd_deployment_type: kubeadm
kube_proxy_mode: iptables
enable_nodelocaldns: false

View File

@@ -7,7 +7,7 @@
# TODO: source those from kubespray-defaults instead.
# Needs kubespray-defaults to be decoupled from no-proxy stuff
bin_dir: "/usr/local/bin"
kube_pods_subnet: 10.233.64.0/18
kube_pods_subnet: "{{ 'fd85:ee78:d8a6:8607::1:0000/112' if (enable_ipv6only_stack_networks | default(false)) else '10.233.64.0/18' }}"
tasks:
@@ -115,7 +115,7 @@
| length == 2
- name: Curl between pods is working
command: "{{ bin_dir }}/kubectl -n test exec {{ item[0].metadata.name }} -- curl {{ item[1].status.podIP }}:8080"
command: "{{ bin_dir }}/kubectl -n test exec {{ item[0].metadata.name }} -- curl {{ item[1].status.podIP | ansible.utils.ipwrap}}:8080"
with_nested:
- "{{ pods }}"
- "{{ pods }}"

View File

@@ -51,7 +51,7 @@
block:
- name: Get netchecker agents
uri:
url: "http://{{ ansible_default_ipv4.address }}:{{ netchecker_port }}/api/v1/agents/"
url: "http://{{ (ansible_default_ipv6.address if (enable_ipv6only_stack_networks | default(false)) else ansible_default_ipv4.address) | ansible.utils.ipwrap }}:{{ netchecker_port }}/api/v1/agents/"
return_content: true
headers:
Accept: application/json
@@ -64,7 +64,7 @@
- name: Check netchecker status
uri:
url: "http://{{ ansible_default_ipv4.address }}:{{ netchecker_port }}/api/v1/connectivity_check"
url: "http://{{ (ansible_default_ipv6.address if (enable_ipv6only_stack_networks | default(false)) else ansible_default_ipv4.address) | ansible.utils.ipwrap }}:{{ netchecker_port }}/api/v1/connectivity_check"
return_content: true
headers:
Accept: application/json