From 69b67a293ad36ab52bf38ce8abb3e87245461cd9 Mon Sep 17 00:00:00 2001
From: "Ole Mathias Aa. Heggem" <olemathias.aa.heggem@gmail.com>
Date: Wed, 8 Sep 2021 09:37:20 +0200
Subject: [PATCH] Calico: Add kube_service_addresses_ipv6 to serviceClusterIPs
 (#7889) (#7944)

Add IPv6 Service Addresses to BGP advertisement when
calico_advertise_cluster_ips is true.
---
 roles/network_plugin/calico/tasks/install.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/roles/network_plugin/calico/tasks/install.yml b/roles/network_plugin/calico/tasks/install.yml
index 84dd1509a..3b7e39c41 100644
--- a/roles/network_plugin/calico/tasks/install.yml
+++ b/roles/network_plugin/calico/tasks/install.yml
@@ -240,7 +240,8 @@
           "logSeverityScreen": "Info",
           {% 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 }}" }],{% endif %}
+          {% if calico_advertise_cluster_ips|default(false) %}
+          "serviceClusterIPs": [{"cidr": "{{ kube_service_addresses }}" } {{ ',{"cidr":"' + kube_service_addresses_ipv6 + '"}' if enable_dual_stack_networks else '' }}],{% endif %}
           {% if calico_version is version('v3.18.0', '>') and calico_advertise_service_loadbalancer_ips|length > 0  %}"serviceLoadBalancerIPs": {{ _service_loadbalancer_ips }},{% endif %}
           "serviceExternalIPs": {{ _service_external_ips|default([]) }} }}
   changed_when: false
-- 
GitLab