CI: fix frr-k8s certificate flake #291
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [main] | |
merge_group: | |
pull_request: | |
branches: | |
- "main" | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
- "v[0-9]+.[0-9]+" | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
metallb_e2e_frr-k8s: | |
runs-on: ubuntu-20.04 | |
env: | |
built_image: "metallb-operator:ci" # Arbitrary name | |
defaults: | |
run: | |
shell: bash | |
working-directory: metallboperator | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | |
uses: ./.github/workflows/composite/setup | |
- name: Read metallb ref | |
id: metallb_ref | |
run: echo "content=$(cat ./hack/metallb_ref.txt)" >> $GITHUB_OUTPUT | |
- name: Read frr-k8s version | |
id: frrk8s_ref | |
run: | | |
wget https://raw.githubusercontent.com/metallb/metallb/${{ steps.metallb_ref.outputs.content }}/charts/metallb/Chart.yaml | |
echo "content=v$(yq e '.dependencies[] | select(.name == "frr-k8s") | .version' Chart.yaml)" >> $GITHUB_OUTPUT | |
rm -f Chart.yaml | |
- name: Checkout MetalLB | |
uses: actions/checkout@v2 | |
with: | |
repository: metallb/metallb | |
path: metallb | |
ref: "${{ steps.metallb_ref.outputs.content }}" | |
- name: Checkout frr-k8s | |
uses: actions/checkout@v2 | |
with: | |
repository: metallb/frr-k8s | |
path: frr-k8s | |
ref: "${{ steps.frrk8s_ref.outputs.content }}" | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install linux-modules-extra-$(uname -r) python3-pip arping ndisc6 | |
sudo pip3 install -r ${GITHUB_WORKSPACE}/metallb/dev-env/requirements.txt | |
go install github.com/onsi/ginkgo/v2/[email protected] | |
- name: Build image | |
run: | | |
IMG=${built_image} make docker-build | |
- name: Create multi-node K8s Kind Cluster | |
run: | | |
./hack/kind-multi-node-cluster-without-registry.sh | |
kind load docker-image ${built_image} | |
./hack/create_second_interface.sh | |
- name: Deploy Prometheus | |
run: | | |
make deploy-prometheus | |
- name: Deploy MetalLB Operator using frr-k8s mode | |
run: | | |
IMG=${built_image} KUSTOMIZE_DEPLOY_DIR="config/frr-k8s-on-ci/" make deploy | |
- name: Ensure MetalLB operator is ready | |
run: | | |
while [ "$(kubectl get pods -n metallb-system -l control-plane='controller-manager' -o jsonpath='{.items[*].status.containerStatuses[0].ready}')" != "true" ]; do | |
sleep 5 | |
echo "Waiting for operator pod to be ready." | |
done | |
- name: Operator E2E Tests | |
run: | | |
export KUBECONFIG=${HOME}/.kube/config | |
make test-validation | |
make test-e2e | |
kubectl wait -n metallb-system --for=delete pod -l "component in (speaker,controller,frr-k8s,frr-k8s-webhook-server)" --timeout=180s | |
- name: Deploy MetalLB resource | |
run: | | |
export KUBECONFIG=${HOME}/.kube/config | |
kubectl apply -f config/samples/metallb.yaml | |
kubectl wait -n metallb-system --for=condition=Ready pod -l "component in (speaker,controller,frr-k8s,frr-k8s-webhook-server)" --timeout=180s | |
- name: frr-k8s E2E Webhooks tests | |
run: | | |
export KUBECONFIG=${HOME}/.kube/config | |
kubectl create ns frr-k8s-system | |
cd ${GITHUB_WORKSPACE}/frr-k8s | |
mkdir -p /tmp/kind_logs | |
# TODO: remove skipping the conflict test, curerntly broken for multiple namespaces | |
KUBECONFIG_PATH=${HOME}/.kube/config GINKGO_ARGS="--focus Webhooks --skip conflict" TEST_ARGS="--report-path=/tmp/kind_logs" make e2etests | |
kubectl delete ns frr-k8s-system | |
- name: Setup tmate session | |
if: ${{ failure() }} | |
uses: mxschmitt/action-tmate@v3 | |
#- name: MetalLB E2E Tests | |
# run: | | |
# cd ${GITHUB_WORKSPACE}/metallb | |
# sudo -E env "PATH=$PATH" inv e2etest -b frr-k8s --skip "IPV6|DUALSTACK|FRR-MODE" -e /tmp/kind_logs | |
- name: Collect Logs | |
if: ${{ failure() }} | |
uses: ./.github/workflows/composite/collectlogs | |
with: | |
artifact-name: metallb_e2e_frr-k8s |