-
Notifications
You must be signed in to change notification settings - Fork 240
79 lines (68 loc) · 2.44 KB
/
cyclonus-netpol-extended-nightly-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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.23"
- 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