From 494b84d03868b9c64f4e8463c3b09767570a4bea Mon Sep 17 00:00:00 2001 From: ArthurSens <arthursens2005@gmail.com> Date: Sat, 5 Mar 2022 20:47:11 +0000 Subject: [PATCH] .github/workflows: Use cilium on e2e-test Signed-off-by: ArthurSens <arthursens2005@gmail.com> --- .github/workflows/ci.yaml | 20 +++++++++++++++- .github/workflows/kind/config.yml | 6 +++++ .gitignore | 2 +- .../codespaces/prepare-kind.sh | 23 +++++++++++++++---- 4 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/kind/config.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 592fda25..7f51fdbb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -94,7 +94,25 @@ jobs: with: version: ${{ env.kind-version }} image: ${{ matrix.kind-image }} - wait: 300s + wait: 10s # Without default CNI, control-plane doesn't get ready until Cilium is installed + config: .github/workflows/kind/config.yml + - name: Setup Helm + uses: azure/setup-helm@v1 + - name: Install Cilium + run: | + helm repo add cilium https://helm.cilium.io/ + helm install cilium cilium/cilium --version 1.9.13 \ + --namespace kube-system \ + --set nodeinit.enabled=true \ + --set kubeProxyReplacement=partial \ + --set hostServices.enabled=false \ + --set externalIPs.enabled=true \ + --set nodePort.enabled=true \ + --set hostPort.enabled=true \ + --set bpf.masquerade=false \ + --set image.pullPolicy=IfNotPresent \ + --set ipam.mode=kubernetes \ + --set operator.replicas=1 - name: Wait for cluster to finish bootstraping run: kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout=300s - name: Create kube-prometheus stack diff --git a/.github/workflows/kind/config.yml b/.github/workflows/kind/config.yml new file mode 100644 index 00000000..e0ac61d5 --- /dev/null +++ b/.github/workflows/kind/config.yml @@ -0,0 +1,6 @@ +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +networking: + disableDefaultCNI: true + podSubnet: "10.10.0.0/16" + serviceSubnet: "10.11.0.0/16" diff --git a/.gitignore b/.gitignore index cf9dc350..cebe81d2 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,4 @@ vendor/ crdschemas/ developer-workspace/gitpod/_output -kind \ No newline at end of file +developer-workspace/codespaces/kind \ No newline at end of file diff --git a/developer-workspace/codespaces/prepare-kind.sh b/developer-workspace/codespaces/prepare-kind.sh index 21bbf5af..5ee6f547 100755 --- a/developer-workspace/codespaces/prepare-kind.sh +++ b/developer-workspace/codespaces/prepare-kind.sh @@ -9,12 +9,27 @@ if [[ $? != 0 ]]; then | cut -d : -f 2,3 \ | tr -d \" \ | wget -qi - - mv kind-linux-amd64 kind && chmod +x kind + mv kind-linux-amd64 developer-workspace/codespaces/kind && chmod +x developer-workspace/codespaces/kind + export PATH=$PATH:$PWD/developer-workspace/codespaces fi -cluster_created=$($PWD/kind get clusters 2>&1) +cluster_created=$($PWD/developer-workspace/codespaces/kind get clusters 2>&1) if [[ "$cluster_created" == "No kind clusters found." ]]; then - $PWD/kind create cluster + $PWD/developer-workspace/codespaces/kind create cluster --config $PWD/.github/workflows/kind/config.yml else echo "Cluster '$cluster_created' already present" -fi \ No newline at end of file +fi + +helm repo add --force-update cilium https://helm.cilium.io/ +helm install cilium cilium/cilium --version 1.9.13 \ + --namespace kube-system \ + --set nodeinit.enabled=true \ + --set kubeProxyReplacement=partial \ + --set hostServices.enabled=false \ + --set externalIPs.enabled=true \ + --set nodePort.enabled=true \ + --set hostPort.enabled=true \ + --set bpf.masquerade=false \ + --set image.pullPolicy=IfNotPresent \ + --set ipam.mode=kubernetes \ + --set operator.replicas=1 \ No newline at end of file -- GitLab