Add support for dual-stack in Calico chart

Signed-off-by: Manuel Buil <mbuil@suse.com>
pull/138/head
Manuel Buil 2021-08-27 21:14:25 +02:00
parent 88de7d4247
commit 5024f51679
3 changed files with 20 additions and 4 deletions

View File

@ -1,6 +1,6 @@
--- charts-original/templates/crs/custom-resources.yaml
+++ charts/templates/crs/custom-resources.yaml
@@ -6,6 +6,13 @@
@@ -6,6 +6,27 @@
{{ $secrets = append $secrets $item }}
{{ end }}
{{ $_ := set $installSpec "imagePullSecrets" $secrets }}
@ -9,8 +9,22 @@
+{{ $_ := set $installSpec "registry" $finalRegistry }}
+{{ $defaultipPools := get .Values.installation.calicoNetwork "ipPools" | first }}
+{{ $defaultCIDR := get $defaultipPools "cidr" }}
+{{ $finalCIDR := coalesce .Values.global.clusterCIDR $defaultCIDR }}
+{{ $finalCIDR := coalesce .Values.global.clusterCIDRv4 $defaultCIDR }}
+{{ $_ := set $defaultipPools "cidr" $finalCIDR }}
+{{- /*
+If there is a defined ipv6 CIDR, we must add it as a new IPPool, disable any encapsulation and enable bgp
+*/}}
+{{ if not (empty .Values.global.clusterCIDRv6) }}
+{{ $myIP6Dict := dict "natOutgoing" "Enabled" "cidr" .Values.global.clusterCIDRv6 }}
+{{ $allIpPools := get .Values.installation.calicoNetwork "ipPools" }}
+{{ range $allIpPools }}
+{{ $_ := unset . "encapsulation" }}
+{{ end }}
+{{ $finalIpPoolList := append $allIpPools $myIP6Dict }}
+{{ $calicoNetwork := get .Values.installation "calicoNetwork" }}
+{{ $_ := set $calicoNetwork "ipPools" $finalIpPoolList }}
+{{ $_ := set $calicoNetwork "bgp" "Enabled" }}
+{{ end }}
apiVersion: operator.tigera.io/v1
kind: Installation

View File

@ -25,7 +25,7 @@
certs:
node:
@@ -17,9 +33,21 @@
@@ -17,9 +33,23 @@
# Configuration for the tigera operator
tigeraOperator:
@ -41,6 +41,8 @@
+
+global:
+ systemDefaultRegistry: ""
+ clusterCIDRv4: ""
+ clusterCIDRv6: ""
+
+# Config required by Windows nodes
+ipamConfig:

View File

@ -1,5 +1,5 @@
url: https://github.com/projectcalico/calico/releases/download/v3.19.2/tigera-operator-v3.19.2-2.tgz
packageVersion: 03
packageVersion: 04
additionalCharts:
- workingDir: charts-crd
crdOptions: