From 514b700b55816866e0bffac8550931be163e8c97 Mon Sep 17 00:00:00 2001 From: Fabrice Jammes Date: Mon, 28 Oct 2024 10:13:33 +0100 Subject: [PATCH] Upgrade calico and cilium --- .github/workflows/e2e.yml | 4 ++-- cmd/create.go | 4 +--- resources/constants.go | 3 +++ resources/install-calico.sh | 17 +++++++++++++++++ resources/install-cilium.sh | 3 +-- 5 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 resources/install-calico.sh diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index e31721e..e77f9e1 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,10 +31,10 @@ jobs: kubectl get nodes - name: Start nginx run: | - ./itest/run-nginx.sh + ./e2e/run-nginx.sh - name: Test nginx run: | - ./itest/test-nginx.sh + ./e2e/test-nginx.sh check_argo: name: Check argoCD install runs-on: ubuntu-22.04 diff --git a/cmd/create.go b/cmd/create.go index 42ae975..adbb331 100644 --- a/cmd/create.go +++ b/cmd/create.go @@ -84,9 +84,7 @@ func createCluster(clusterName string) { switch c.Cni { case "calico": - cmd = `kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.24.5/manifests/tigera-operator.yaml && - kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.24.5/manifests/custom-resources.yaml` - _, _, err = ExecCmd(cmd, false) + _, _, err = ExecCmd(resources.CiliumInstallScript, false) case "cilium": _, _, err = ExecCmd(resources.CiliumInstallScript, false) diff --git a/resources/constants.go b/resources/constants.go index 593a508..52393b8 100644 --- a/resources/constants.go +++ b/resources/constants.go @@ -10,6 +10,9 @@ var ArgoCDInstallScript string //go:embed install-argoworkflows.sh var ArgoWorkflowInstallScript string +//go:embed install-calico.sh +var CalicoInstallScript string + //go:embed install-cilium.sh var CiliumInstallScript string diff --git a/resources/install-calico.sh b/resources/install-calico.sh new file mode 100644 index 0000000..1cb51f2 --- /dev/null +++ b/resources/install-calico.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Install Cilium cli and CNI plugin + +# @author Fabrice Jammes + +set -euxo pipefail + +# Install calico cni plugin +CALICO_VERSION="v3.28.2" + +kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/$CALICO_VERSION/manifests/tigera-operator.yaml +kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/$CALICO_VERSION/manifests/custom-resources.yaml + + +echo "Wait for calico pods to be ready" +kubectl wait --for=condition=Ready pods --all -n calico-system --timeout=600s \ No newline at end of file diff --git a/resources/install-cilium.sh b/resources/install-cilium.sh index ef22c8b..4da0447 100644 --- a/resources/install-cilium.sh +++ b/resources/install-cilium.sh @@ -9,10 +9,9 @@ set -euxo pipefail # Retrieve latest Cilium cli version with: # curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable.txt) CILIUM_CLI_VERSION="v0.16.4" -CILIUM_VERSION="1.15.2" +CILIUM_VERSION="1.16.3" # Install cilium cli -CILIUM_VERSION="1.15.4" CLI_ARCH=amd64 if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}