mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-02 01:58:12 -03:30
Add support for ipv6 only cluster via "enable_ipv6only_stack_networks" (#11831)
This commit is contained in:
@@ -192,6 +192,6 @@
|
||||
- "calico_ipip_mode_ipv6 in ['Never']"
|
||||
msg: "Calico doesn't support ipip tunneling for the IPv6"
|
||||
when:
|
||||
- enable_dual_stack_networks
|
||||
- (enable_dual_stack_networks or enable_ipv6only_stack_networks)
|
||||
run_once: true
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
changed_when: false
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- enable_dual_stack_networks
|
||||
- (enable_dual_stack_networks or enable_ipv6only_stack_networks)
|
||||
|
||||
- name: Calico | Ensure that calico_pool_cidr_ipv6 is within kube_pods_subnet_ipv6 when defined
|
||||
assert:
|
||||
@@ -117,7 +117,7 @@
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- calico_conf_ipv6.stdout is defined and calico_conf_ipv6.stdout == "0"
|
||||
- calico_pool_cidr_ipv6 is defined
|
||||
- enable_dual_stack_networks
|
||||
- (enable_dual_stack_networks or enable_ipv6only_stack_networks)
|
||||
|
||||
- name: Calico | kdd specific configuration
|
||||
when:
|
||||
@@ -256,7 +256,7 @@
|
||||
- name: Calico | Configure Calico IPv6 Pool
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- enable_dual_stack_networks | bool
|
||||
- (enable_dual_stack_networks or enable_ipv6only_stack_networks) | bool
|
||||
block:
|
||||
- name: Calico | Get existing calico ipv6 network pool
|
||||
command: "{{ bin_dir }}/calicoctl.sh get ippool {{ calico_pool_name }}-ipv6 -o json"
|
||||
@@ -350,7 +350,7 @@
|
||||
{% if not calico_no_global_as_num | default(false) %}"asNumber": {{ global_as_num }},{% endif %}
|
||||
"nodeToNodeMeshEnabled": {{ nodeToNodeMeshEnabled | default('true') }} ,
|
||||
{% if calico_advertise_cluster_ips | default(false) %}
|
||||
"serviceClusterIPs": [{"cidr": "{{ kube_service_addresses }}" } {{ ',{"cidr":"' + kube_service_addresses_ipv6 + '"}' if enable_dual_stack_networks else '' }}],{% endif %}
|
||||
"serviceClusterIPs": [{% for cidr in kube_service_addresses_range.split(",") %}{{ "," if not loop.first }}{"cidr": "{{ cidr }}"}{% endfor %}],{% endif %}
|
||||
{% if calico_advertise_service_loadbalancer_ips | length > 0 %}"serviceLoadBalancerIPs": {{ _service_loadbalancer_ips }},{% endif %}
|
||||
"serviceExternalIPs": {{ _service_external_ips | default([]) }}
|
||||
}
|
||||
|
||||
@@ -56,10 +56,14 @@ data:
|
||||
{% else %}
|
||||
"ipam": {
|
||||
"type": "calico-ipam",
|
||||
{% if enable_dual_stack_networks %}
|
||||
{% if enable_ipv6only_stack_networks %}
|
||||
"assign_ipv6": "true"
|
||||
{% elif enable_dual_stack_networks %}
|
||||
"assign_ipv6": "true",
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if not enable_ipv6only_stack_networks %}
|
||||
"assign_ipv4": "true"
|
||||
{% endif %}
|
||||
},
|
||||
{% endif %}
|
||||
{% if calico_allow_ip_forwarding %}
|
||||
|
||||
@@ -259,13 +259,15 @@ spec:
|
||||
# no effect. This should fall within `--cluster-cidr`.
|
||||
# - name: CALICO_IPV4POOL_CIDR
|
||||
# value: "192.168.0.0/16"
|
||||
{% if not enable_ipv6only_stack_networks %}
|
||||
- name: CALICO_IPV4POOL_IPIP
|
||||
value: "{{ calico_ipv4pool_ipip }}"
|
||||
{% endif %}
|
||||
# Enable or Disable VXLAN on the default IP pool.
|
||||
- name: CALICO_IPV4POOL_VXLAN
|
||||
value: "Never"
|
||||
- name: FELIX_IPV6SUPPORT
|
||||
value: "{{ enable_dual_stack_networks | default(false) }}"
|
||||
value: "{{ (enable_dual_stack_networks or enable_ipv6only_stack_networks) | default(false) }}"
|
||||
# Set Felix logging to "info"
|
||||
- name: FELIX_LOGSEVERITYSCREEN
|
||||
value: "{{ calico_loglevel }}"
|
||||
@@ -308,20 +310,28 @@ spec:
|
||||
- name: IP_AUTODETECTION_METHOD
|
||||
value: "can-reach=$(NODEIP)"
|
||||
{% endif %}
|
||||
- name: IP
|
||||
value: "autodetect"
|
||||
{% if calico_ip6_auto_method is defined and enable_dual_stack_networks %}
|
||||
{% if calico_ip6_auto_method is defined and (enable_dual_stack_networks or enable_ipv6only_stack_networks) %}
|
||||
- name: IP6_AUTODETECTION_METHOD
|
||||
value: "{{ calico_ip6_auto_method }}"
|
||||
{% endif %}
|
||||
{% if enable_ipv6only_stack_networks %}
|
||||
- name: IP6
|
||||
value: "autodetect"
|
||||
- name: IP
|
||||
value: none
|
||||
{% elif enable_dual_stack_networks %}
|
||||
- name: IP6
|
||||
value: "autodetect"
|
||||
- name: IP
|
||||
value: "autodetect"
|
||||
{% else %}
|
||||
- name: IP
|
||||
value: "autodetect"
|
||||
{% endif %}
|
||||
{% if calico_felix_mtu_iface_pattern is defined %}
|
||||
- name: FELIX_MTUIFACEPATTERN
|
||||
value: "{{ calico_felix_mtu_iface_pattern }}"
|
||||
{% endif %}
|
||||
{% if enable_dual_stack_networks %}
|
||||
- name: IP6
|
||||
value: autodetect
|
||||
{% endif %}
|
||||
{% if calico_use_default_route_src_ipaddr | default(false) %}
|
||||
- name: FELIX_DEVICEROUTESOURCEADDRESS
|
||||
valueFrom:
|
||||
|
||||
Reference in New Issue
Block a user