From dc39af186f52c0d9c70e571d98529dd719611beb Mon Sep 17 00:00:00 2001 From: Ganesh Maharaj Mahalingam Date: Thu, 3 Mar 2022 18:27:25 -0800 Subject: [PATCH] Update CNIs to versions that work well with 1.20.X of Kubernetes Signed-off-by: Ganesh Maharaj Mahalingam --- .../0-canal/overlays/v3.22/kustomization.yaml | 4 ++++ .../0-cilium/overlays/v1.9.13/kustomization.yaml | 2 ++ .../0-flannel/overlays/v0.16.3/kustomization.yaml | 2 ++ clr-k8s-examples/create_stack.sh | 13 +++++++------ 4 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 clr-k8s-examples/0-canal/overlays/v3.22/kustomization.yaml create mode 100644 clr-k8s-examples/0-cilium/overlays/v1.9.13/kustomization.yaml create mode 100644 clr-k8s-examples/0-flannel/overlays/v0.16.3/kustomization.yaml diff --git a/clr-k8s-examples/0-canal/overlays/v3.22/kustomization.yaml b/clr-k8s-examples/0-canal/overlays/v3.22/kustomization.yaml new file mode 100644 index 00000000..7a0c372b --- /dev/null +++ b/clr-k8s-examples/0-canal/overlays/v3.22/kustomization.yaml @@ -0,0 +1,4 @@ +resources: + - canal/canal.yaml + + diff --git a/clr-k8s-examples/0-cilium/overlays/v1.9.13/kustomization.yaml b/clr-k8s-examples/0-cilium/overlays/v1.9.13/kustomization.yaml new file mode 100644 index 00000000..7ef2edc8 --- /dev/null +++ b/clr-k8s-examples/0-cilium/overlays/v1.9.13/kustomization.yaml @@ -0,0 +1,2 @@ +resources: + cilium/cilium.yaml diff --git a/clr-k8s-examples/0-flannel/overlays/v0.16.3/kustomization.yaml b/clr-k8s-examples/0-flannel/overlays/v0.16.3/kustomization.yaml new file mode 100644 index 00000000..682baa26 --- /dev/null +++ b/clr-k8s-examples/0-flannel/overlays/v0.16.3/kustomization.yaml @@ -0,0 +1,2 @@ +resources: + - flannel/Documentation/kube-flannel.yml diff --git a/clr-k8s-examples/create_stack.sh b/clr-k8s-examples/create_stack.sh index 197b9f55..8fcf6f1e 100755 --- a/clr-k8s-examples/create_stack.sh +++ b/clr-k8s-examples/create_stack.sh @@ -18,9 +18,9 @@ LOAD_BALANCER_IP=${LOAD_BALANCER_IP:-""} LOAD_BALANCER_PORT="${LOAD_BALANCER_PORT:-6444}" # versions -CANAL_VER="${CLRK8S_CANAL_VER:-v3.18}" -CILIUM_VER="${CLRK8S_CILIUM_VER:-v1.9}" -FLANNEL_VER="${CLRK8S_FLANNEL_VER:-v0.14.0-rc1}" +CANAL_VER="${CLRK8S_CANAL_VER:-v3.22}" +CILIUM_VER="${CLRK8S_CILIUM_VER:-v1.9.13}" +FLANNEL_VER="${CLRK8S_FLANNEL_VER:-v0.16.3}" CILIUM_VAL_OVERRIDE="" K8S_VER="${CLRK8S_K8S_VER:-}" KATA_VER="${CLRK8S_KATA_VER:-1.9.1-kernel-config}" @@ -145,7 +145,7 @@ function cni() { # canal manifests are not kept in repo but in docs site so use curl mkdir -p "${CANAL_DIR}/overlays/${CANAL_VER}/canal" - curl -o "${CANAL_DIR}/overlays/${CANAL_VER}/canal/canal.yaml" "$CANAL_URL/canal.yaml" + curl -L -o "${CANAL_DIR}/overlays/${CANAL_VER}/canal/canal.yaml" "$CANAL_URL/canal.yaml" if [[ "$CANAL_VER" == "v3.3" ]]; then curl -o "${CANAL_DIR}/overlays/${CANAL_VER}/canal/rbac.yaml" "$CANAL_URL/rbac.yaml" fi @@ -154,7 +154,7 @@ function cni() { ;; flannel) FLANNEL_VER=${1:-$FLANNEL_VER} - FLANNEL_URL="https://github.com/coreos/flannel" + FLANNEL_URL="https://github.com/flannel-io/flannel" FLANNEL_DIR="0-flannel" get_repo "${FLANNEL_URL}" "${FLANNEL_DIR}/overlays/${FLANNEL_VER}" @@ -162,6 +162,7 @@ function cni() { kubectl apply -k "${FLANNEL_DIR}/overlays/${FLANNEL_VER}" ;; cilium) + local podsubnet=$(grep -Po 'podSubnet:\ \K[^*]*' ${SCRIPT_DIR}/kubeadm.yaml) CILIUM_VER=${1:-$CILIUM_VER} CILIUM_URL="https://github.com/cilium/cilium.git" CILIUM_DIR="0-cilium" @@ -171,7 +172,7 @@ function cni() { if [ -f "${CILIUM_DIR}/overlays/${CILIUM_VER}/values.yaml" ]; then CILIUM_VAL_OVERRIDE="--values ${CILIUM_DIR}/overlays/${CILIUM_VER}/values.yaml" fi - helm template "${CILIUM_DIR}/overlays/${CILIUM_VER}/cilium/install/kubernetes/cilium" ${CILIUM_VAL_OVERRIDE} --namespace kube-system --set global.containerRuntime.integration="$RUNNER" | kubectl apply -f - + helm template "${CILIUM_DIR}/overlays/${CILIUM_VER}/cilium/install/kubernetes/cilium" --namespace kube-system --set containerRuntime.integration="$RUNNER" --set hubble.enabled=false --set ipam.operator.clusterPoolIPv4PodCIDR="${podsubnet}" | kubectl apply -f - ;; *) echo"Unknown cni $CNI"