diff --git a/.github/in-cluster-test-scripts/eks-install.sh b/.github/in-cluster-test-scripts/eks-install.sh deleted file mode 100644 index 6193cec3fe..0000000000 --- a/.github/in-cluster-test-scripts/eks-install.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -set -x -set -e - -# Install Cilium -cilium install \ - --cluster-name "${CLUSTER_NAME}" \ - --wait=false \ - --config monitor-aggregation=none diff --git a/.github/in-cluster-test-scripts/eks-tunnel-install.sh b/.github/in-cluster-test-scripts/eks-tunnel-install.sh deleted file mode 100644 index dbc3000484..0000000000 --- a/.github/in-cluster-test-scripts/eks-tunnel-install.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -set -x -set -e - -# Install Cilium -cilium install \ - --cluster-name "${CLUSTER_NAME}" \ - --wait=false \ - --config monitor-aggregation=none \ - --datapath-mode=tunnel \ - --ipam cluster-pool diff --git a/.github/in-cluster-test-scripts/eks-tunnel.sh b/.github/in-cluster-test-scripts/eks-tunnel.sh index 1f4da2a935..fdf9915b58 100644 --- a/.github/in-cluster-test-scripts/eks-tunnel.sh +++ b/.github/in-cluster-test-scripts/eks-tunnel.sh @@ -3,12 +3,23 @@ set -x set -e +# Install Cilium +cilium install \ + --cluster-name "${CLUSTER_NAME}" \ + --wait=false \ + --config monitor-aggregation=none \ + --datapath-mode=tunnel \ + --ipam cluster-pool + # Enable Relay cilium hubble enable # Wait for Cilium status to be ready cilium status --wait +# Make sure the 'aws-node' DaemonSet exists but has no scheduled pods +[[ $(kubectl -n kube-system get ds/aws-node -o jsonpath='{.status.currentNumberScheduled}') == 0 ]] + # Port forward Relay cilium hubble port-forward& sleep 10s diff --git a/.github/in-cluster-test-scripts/eks-uninstall.sh b/.github/in-cluster-test-scripts/eks-uninstall.sh index 22989d8f80..e03a99b7c3 100644 --- a/.github/in-cluster-test-scripts/eks-uninstall.sh +++ b/.github/in-cluster-test-scripts/eks-uninstall.sh @@ -5,3 +5,6 @@ set -e # Uninstall Cilium cilium uninstall --wait + +# Make sure the 'aws-node' DaemonSet blocking nodeSelector was removed +[[ ! $(kubectl -n kube-system get ds/aws-node -o jsonpath="{.spec.template.spec.nodeSelector['io\.cilium/aws-node-enabled']}") ]] diff --git a/.github/in-cluster-test-scripts/eks.sh b/.github/in-cluster-test-scripts/eks.sh index 1f4da2a935..a6e854adb9 100644 --- a/.github/in-cluster-test-scripts/eks.sh +++ b/.github/in-cluster-test-scripts/eks.sh @@ -3,12 +3,21 @@ set -x set -e +# Install Cilium +cilium install \ + --cluster-name "${CLUSTER_NAME}" \ + --wait=false \ + --config monitor-aggregation=none + # Enable Relay cilium hubble enable # Wait for Cilium status to be ready cilium status --wait +# Make sure the 'aws-node' DaemonSet exists but has no scheduled pods +[[ $(kubectl -n kube-system get ds/aws-node -o jsonpath='{.status.currentNumberScheduled}') == 0 ]] + # Port forward Relay cilium hubble port-forward& sleep 10s diff --git a/.github/workflows/eks-tunnel.yaml b/.github/workflows/eks-tunnel.yaml index 0462766913..871007993b 100644 --- a/.github/workflows/eks-tunnel.yaml +++ b/.github/workflows/eks-tunnel.yaml @@ -55,7 +55,7 @@ jobs: echo ::set-output name=sha::${SHA} echo ::set-output name=owner::${OWNER} - - name: Create EKS cluster with nodegroup + - name: Create EKS cluster run: | cat < eks-config.yaml apiVersion: eksctl.io/v1alpha5 @@ -91,23 +91,6 @@ jobs: .github/get-kubeconfig.sh kubectl create configmap cilium-cli-kubeconfig -n kube-system --from-file kubeconfig - - name: Load cilium install script in configmap - run: | - kubectl create configmap cilium-cli-test-script-install -n kube-system --from-file=in-cluster-test-script.sh=.github/in-cluster-test-scripts/eks-tunnel-install.sh - - - name: Create cilium-cli install job - run: | - helm install .github/cilium-cli-test-job-chart \ - --generate-name \ - --set tag=${{ steps.vars.outputs.sha }} \ - --set cluster_name=${{ env.clusterName }} \ - --set job_name=cilium-cli-install \ - --set test_script_cm=cilium-cli-test-script-install - - - name: Make sure the 'aws-node' DaemonSet exists but has no scheduled pods - run: | - [[ $(kubectl -n kube-system get ds/aws-node -o jsonpath='{.status.currentNumberScheduled}') == 0 ]] - - name: Load cilium cli script in configmap run: | kubectl create configmap cilium-cli-test-script -n kube-system --from-file=in-cluster-test-script.sh=.github/in-cluster-test-scripts/eks-tunnel.sh @@ -121,13 +104,12 @@ jobs: - name: Wait for test job run: | - kubectl -n kube-system wait job/cilium-cli --for=condition=complete --timeout=10m + kubectl -n kube-system wait job/cilium-cli --for=condition=complete --timeout=20m - name: Post-test information gathering if: ${{ !success() }} run: | echo "=== Retrieve in-cluster jobs logs ===" - kubectl logs --timestamps -n kube-system job/cilium-cli-install kubectl logs --timestamps -n kube-system job/cilium-cli echo "\n\n\n=== Install latest stable CLI ===" @@ -152,7 +134,9 @@ jobs: --set job_name=cilium-cli-uninstall \ --set test_script_cm=cilium-cli-test-script-uninstall kubectl -n kube-system wait job/cilium-cli-uninstall --for=condition=complete --timeout=2m - [[ ! $(kubectl -n kube-system get ds/aws-node -o jsonpath="{.spec.template.spec.nodeSelector['io\.cilium/aws-node-enabled']}") ]] + + echo "=== Retrieve in-cluster jobs logs ===" + kubectl logs --timestamps -n kube-system job/cilium-cli-uninstall - name: Clean up EKS if: ${{ always() }} diff --git a/.github/workflows/eks.yaml b/.github/workflows/eks.yaml index 6697e313b6..fe43a99bab 100644 --- a/.github/workflows/eks.yaml +++ b/.github/workflows/eks.yaml @@ -55,7 +55,7 @@ jobs: echo ::set-output name=sha::${SHA} echo ::set-output name=owner::${OWNER} - - name: Create EKS cluster nodegroup + - name: Create EKS cluster run: | cat < eks-config.yaml apiVersion: eksctl.io/v1alpha5 @@ -91,23 +91,6 @@ jobs: .github/get-kubeconfig.sh kubectl create configmap cilium-cli-kubeconfig -n kube-system --from-file kubeconfig - - name: Load cilium install script in configmap - run: | - kubectl create configmap cilium-cli-test-script-install -n kube-system --from-file=in-cluster-test-script.sh=.github/in-cluster-test-scripts/eks-install.sh - - - name: Create cilium-cli install job - run: | - helm install .github/cilium-cli-test-job-chart \ - --generate-name \ - --set tag=${{ steps.vars.outputs.sha }} \ - --set cluster_name=${{ env.clusterName }} \ - --set job_name=cilium-cli-install \ - --set test_script_cm=cilium-cli-test-script-install - - - name: Make sure the 'aws-node' DaemonSet exists but has no scheduled pods - run: | - [[ $(kubectl -n kube-system get ds/aws-node -o jsonpath='{.status.currentNumberScheduled}') == 0 ]] - - name: Load cilium cli script in configmap run: | kubectl create configmap cilium-cli-test-script -n kube-system --from-file=in-cluster-test-script.sh=.github/in-cluster-test-scripts/eks.sh @@ -121,13 +104,12 @@ jobs: - name: Wait for test job run: | - kubectl -n kube-system wait job/cilium-cli --for=condition=complete --timeout=10m + kubectl -n kube-system wait job/cilium-cli --for=condition=complete --timeout=20m - name: Post-test information gathering if: ${{ !success() }} run: | echo "=== Retrieve in-cluster jobs logs ===" - kubectl logs --timestamps -n kube-system job/cilium-cli-install kubectl logs --timestamps -n kube-system job/cilium-cli echo "\n\n\n=== Install latest stable CLI ===" @@ -152,7 +134,9 @@ jobs: --set job_name=cilium-cli-uninstall \ --set test_script_cm=cilium-cli-test-script-uninstall kubectl -n kube-system wait job/cilium-cli-uninstall --for=condition=complete --timeout=2m - [[ ! $(kubectl -n kube-system get ds/aws-node -o jsonpath="{.spec.template.spec.nodeSelector['io\.cilium/aws-node-enabled']}") ]] + + echo "=== Retrieve in-cluster jobs logs ===" + kubectl logs --timestamps -n kube-system job/cilium-cli-uninstall - name: Clean up EKS if: ${{ always() }}