Cyclonus Network Policy Extended Test #63
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: Cyclonus Network Policy Extended Test | |
on: | |
workflow_dispatch: | |
schedule: | |
# run once a day at midnight | |
- cron: "0 0 * * *" | |
jobs: | |
cyclonus-test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 240 | |
strategy: | |
matrix: | |
# run cyclonus tests in parallel for NPM with the given ConfigMaps | |
profile: | |
[ | |
v2-apply-on-need.yaml, | |
v2-background.yaml, | |
v2-foreground.yaml, | |
v2-place-first.yaml, | |
] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: "^1.21" | |
- name: Setup Kind | |
uses: engineerd/[email protected] | |
with: | |
version: "v0.11.1" | |
config: ./test/kind/kind.yaml | |
name: npm-kind | |
- name: Check Kind | |
run: | | |
kubectl get po -owide -A | |
- name: Make NPM image | |
run: | | |
make npm-image NPM_PLATFORM_TAG=cyclonus PLATFORM=linux/amd64 CONTAINER_BUILDER=docker BUILDX_ACTION='--load' | |
- name: Install Azure NPM | |
# set the ConfigMap based on the build matrix | |
# currently have to restart the daemonset because changing the ConfigMap doesn't restart NPM | |
run: | | |
sed -i 's/mcr.microsoft.com\/containernetworking\/azure-npm:.*/acnpublic.azurecr.io\/azure-npm:cyclonus/' ./npm/azure-npm.yaml | |
kind load docker-image acnpublic.azurecr.io/azure-npm:cyclonus --name npm-kind | |
kubectl apply -f ./npm/azure-npm.yaml | |
echo "Applying profile: ${{ matrix.profile }}" | |
kubectl apply -f ./npm/profiles/${{ matrix.profile }} | |
kubectl rollout restart ds azure-npm -n kube-system | |
- name: Check Cluster Components | |
run: | | |
sleep 10 | |
kubectl get po -owide -A | |
kubectl describe ds azure-npm -n kube-system | |
- name: Run Cyclonus network policy test | |
run: make test-extended-cyclonus | |
- name: Fetch logs | |
if: always() | |
run: | | |
kubectl logs -n kube-system -l k8s-app=azure-npm --tail -1 --prefix > npm-logs_${{ matrix.profile }}.txt | |
mv ./test/cyclonus/cyclonus-test.txt ./cyclonus-test_${{ matrix.profile }}.txt | |
- name: "Upload Logs" | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: logs-${{ matrix.profile }} | |
path: | | |
./npm-logs_${{ matrix.profile }}.txt | |
./cyclonus-test_${{ matrix.profile }}.txt |