From 1c28d7e8affe3579d94b3081e33bc1714590473a Mon Sep 17 00:00:00 2001 From: Harald Koch Date: Sat, 13 Jan 2024 19:21:09 -0500 Subject: [PATCH 1/3] add IPv6 cidr to cilium LB pool --- .../kubernetes/apps/kube-system/cilium/app/cilium-l2.yaml.j2 | 3 +++ .../apps/kube-system/cilium/app/kustomization.yaml.j2 | 2 -- .../templates/kubernetes/flux/vars/cluster-settings.yaml.j2 | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bootstrap/templates/kubernetes/apps/kube-system/cilium/app/cilium-l2.yaml.j2 b/bootstrap/templates/kubernetes/apps/kube-system/cilium/app/cilium-l2.yaml.j2 index e8eba26e1b1..6ae80d24aab 100644 --- a/bootstrap/templates/kubernetes/apps/kube-system/cilium/app/cilium-l2.yaml.j2 +++ b/bootstrap/templates/kubernetes/apps/kube-system/cilium/app/cilium-l2.yaml.j2 @@ -20,3 +20,6 @@ metadata: spec: cidrs: - cidr: "${NODE_CIDR}" + {% if not bootstrap_ipv6_enabled | default(false) %} + - cidr: "${NODE_CIDR_V6}" + {% endif %} diff --git a/bootstrap/templates/kubernetes/apps/kube-system/cilium/app/kustomization.yaml.j2 b/bootstrap/templates/kubernetes/apps/kube-system/cilium/app/kustomization.yaml.j2 index fedf381214b..1dcc8666354 100644 --- a/bootstrap/templates/kubernetes/apps/kube-system/cilium/app/kustomization.yaml.j2 +++ b/bootstrap/templates/kubernetes/apps/kube-system/cilium/app/kustomization.yaml.j2 @@ -3,8 +3,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - {% if not bootstrap_ipv6_enabled | default(false) %} - ./cilium-l2.yaml - {% endif %} - ./helmvalues.yaml - ./helmrelease.yaml diff --git a/bootstrap/templates/kubernetes/flux/vars/cluster-settings.yaml.j2 b/bootstrap/templates/kubernetes/flux/vars/cluster-settings.yaml.j2 index 759c9842942..825a3077273 100644 --- a/bootstrap/templates/kubernetes/flux/vars/cluster-settings.yaml.j2 +++ b/bootstrap/templates/kubernetes/flux/vars/cluster-settings.yaml.j2 @@ -11,8 +11,9 @@ data: KUBEAPI_ADDR: "{{ bootstrap_kubeapi_addr }}" CLUSTER_CIDR: "{{ bootstrap_cluster_cidr.split(',')[0] }}" SERVICE_CIDR: "{{ bootstrap_service_cidr.split(',')[0] }}" - NODE_CIDR: "{{ bootstrap_node_cidr }}" + NODE_CIDR: "{{ bootstrap_node_cidr.split(',')[0] }}" {% if bootstrap_ipv6_enabled | default(false) %} + NODE_CIDR_V6: "{{ bootstrap_node_cidr.split(',')[1] }}" CLUSTER_CIDR_V6: "{{ bootstrap_cluster_cidr.split(',')[1] }}" SERVICE_CIDR_V6: "{{ bootstrap_service_cidr.split(',')[1] }}" {% endif %} From 80f7b70938887880d2f35098b8c5ca16fdb5001f Mon Sep 17 00:00:00 2001 From: Harald Koch Date: Sat, 13 Jan 2024 19:28:03 -0500 Subject: [PATCH 2/3] invert the logic inside cilium-l2.yaml --- .../kubernetes/apps/kube-system/cilium/app/cilium-l2.yaml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap/templates/kubernetes/apps/kube-system/cilium/app/cilium-l2.yaml.j2 b/bootstrap/templates/kubernetes/apps/kube-system/cilium/app/cilium-l2.yaml.j2 index 6ae80d24aab..fe6610657c6 100644 --- a/bootstrap/templates/kubernetes/apps/kube-system/cilium/app/cilium-l2.yaml.j2 +++ b/bootstrap/templates/kubernetes/apps/kube-system/cilium/app/cilium-l2.yaml.j2 @@ -20,6 +20,6 @@ metadata: spec: cidrs: - cidr: "${NODE_CIDR}" - {% if not bootstrap_ipv6_enabled | default(false) %} + {% if bootstrap_ipv6_enabled | default(false) %} - cidr: "${NODE_CIDR_V6}" {% endif %} From 878ae3fd51973b70ce08914d38f39f9622b59122 Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Sat, 13 Jan 2024 20:46:50 -0500 Subject: [PATCH 3/3] add node_cidr_v6 to ansible vars --- .../inventory/group_vars/kubernetes/supplemental.yaml.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bootstrap/templates/ansible/shared/inventory/group_vars/kubernetes/supplemental.yaml.j2 b/bootstrap/templates/ansible/shared/inventory/group_vars/kubernetes/supplemental.yaml.j2 index 260dee17132..6a9e0393584 100644 --- a/bootstrap/templates/ansible/shared/inventory/group_vars/kubernetes/supplemental.yaml.j2 +++ b/bootstrap/templates/ansible/shared/inventory/group_vars/kubernetes/supplemental.yaml.j2 @@ -6,8 +6,9 @@ coredns_addr: "{{ bootstrap_service_cidr.split(',')[0] | ansible.utils.nthhost(1 kubeapi_addr: "{{ bootstrap_kubeapi_addr }}" cluster_cidr: "{{ bootstrap_cluster_cidr.split(',')[0] }}" service_cidr: "{{ bootstrap_service_cidr.split(',')[0] }}" -node_cidr: "{{ bootstrap_node_cidr }}" +node_cidr: "{{ bootstrap_node_cidr.split(',')[0] }}" {% if bootstrap_ipv6_enabled | default(false) %} +node_cidr_v6: "{{ bootstrap_node_cidr.split(',')[1] }}" cluster_cidr_v6: "{{ bootstrap_cluster_cidr.split(',')[1] }}" service_cidr_v6: "{{ bootstrap_service_cidr.split(',')[1] }}" {% endif %}