From 3710eb6be17594feeb9cb6459ec28b23d8fa1602 Mon Sep 17 00:00:00 2001 From: Hunter Gregory Date: Thu, 11 Nov 2021 18:49:39 -0800 Subject: [PATCH 1/6] v2 profile (with azure chain first) and v1 profile for both chain positions --- npm/profiles/default-config.yaml | 19 +++++++++++++++++++ npm/profiles/v1-default-profile.yaml | 19 +++++++++++++++++++ npm/profiles/v1-place-azure-chain-first.yaml | 19 +++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 npm/profiles/default-config.yaml create mode 100644 npm/profiles/v1-default-profile.yaml create mode 100644 npm/profiles/v1-place-azure-chain-first.yaml diff --git a/npm/profiles/default-config.yaml b/npm/profiles/default-config.yaml new file mode 100644 index 0000000000..b90410270b --- /dev/null +++ b/npm/profiles/default-config.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: azure-npm-config + namespace: kube-system +data: + azure-npm.json: | + { + "ResyncPeriodInMinutes": 15, + "ListeningPort": 10091, + "ListeningAddress": "0.0.0.0", + "Toggles": { + "EnablePrometheusMetrics": true, + "EnablePprof": true, + "EnableHTTPDebugAPI": true, + "EnableV2Controllers": true, + "PlaceAzureChainFirst": true + } + } diff --git a/npm/profiles/v1-default-profile.yaml b/npm/profiles/v1-default-profile.yaml new file mode 100644 index 0000000000..e571cf87b1 --- /dev/null +++ b/npm/profiles/v1-default-profile.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: azure-npm-config + namespace: kube-system +data: + azure-npm.json: | + { + "ResyncPeriodInMinutes": 15, + "ListeningPort": 10091, + "ListeningAddress": "0.0.0.0", + "Toggles": { + "EnablePrometheusMetrics": true, + "EnablePprof": true, + "EnableHTTPDebugAPI": true, + "EnableV2Controllers": false, + "PlaceAzureChainFirst": false + } + } diff --git a/npm/profiles/v1-place-azure-chain-first.yaml b/npm/profiles/v1-place-azure-chain-first.yaml new file mode 100644 index 0000000000..2d85c4a32f --- /dev/null +++ b/npm/profiles/v1-place-azure-chain-first.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: azure-npm-config + namespace: kube-system +data: + azure-npm.json: | + { + "ResyncPeriodInMinutes": 15, + "ListeningPort": 10091, + "ListeningAddress": "0.0.0.0", + "Toggles": { + "EnablePrometheusMetrics": true, + "EnablePprof": true, + "EnableHTTPDebugAPI": true, + "EnableV2Controllers": false, + "PlaceAzureChainFirst": true + } + } From 7d31aa06bead3218a4a8c4074435bfc146144d24 Mon Sep 17 00:00:00 2001 From: Hunter Gregory Date: Fri, 12 Nov 2021 13:00:07 -0800 Subject: [PATCH 2/6] disable pprof and remove chain placement toggle for v2 --- npm/profiles/v1-default-profile.yaml | 2 +- npm/profiles/v1-place-azure-chain-first.yaml | 2 +- npm/profiles/{default-config.yaml => v2-default-config.yaml} | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) rename npm/profiles/{default-config.yaml => v2-default-config.yaml} (76%) diff --git a/npm/profiles/v1-default-profile.yaml b/npm/profiles/v1-default-profile.yaml index e571cf87b1..a5c092ab1b 100644 --- a/npm/profiles/v1-default-profile.yaml +++ b/npm/profiles/v1-default-profile.yaml @@ -11,7 +11,7 @@ data: "ListeningAddress": "0.0.0.0", "Toggles": { "EnablePrometheusMetrics": true, - "EnablePprof": true, + "EnablePprof": false, "EnableHTTPDebugAPI": true, "EnableV2Controllers": false, "PlaceAzureChainFirst": false diff --git a/npm/profiles/v1-place-azure-chain-first.yaml b/npm/profiles/v1-place-azure-chain-first.yaml index 2d85c4a32f..e0ee3fcc25 100644 --- a/npm/profiles/v1-place-azure-chain-first.yaml +++ b/npm/profiles/v1-place-azure-chain-first.yaml @@ -11,7 +11,7 @@ data: "ListeningAddress": "0.0.0.0", "Toggles": { "EnablePrometheusMetrics": true, - "EnablePprof": true, + "EnablePprof": false, "EnableHTTPDebugAPI": true, "EnableV2Controllers": false, "PlaceAzureChainFirst": true diff --git a/npm/profiles/default-config.yaml b/npm/profiles/v2-default-config.yaml similarity index 76% rename from npm/profiles/default-config.yaml rename to npm/profiles/v2-default-config.yaml index b90410270b..345671c528 100644 --- a/npm/profiles/default-config.yaml +++ b/npm/profiles/v2-default-config.yaml @@ -11,9 +11,8 @@ data: "ListeningAddress": "0.0.0.0", "Toggles": { "EnablePrometheusMetrics": true, - "EnablePprof": true, + "EnablePprof": false, "EnableHTTPDebugAPI": true, - "EnableV2Controllers": true, - "PlaceAzureChainFirst": true + "EnableV2Controllers": true } } From 8fd9d3705e4725e902700a14b9c3e8549404ce1d Mon Sep 17 00:00:00 2001 From: Hunter Gregory Date: Thu, 18 Nov 2021 14:32:24 -0800 Subject: [PATCH 3/6] parallelize cyclonus tests for multiple NPM profiles --- .github/workflows/cyclonus-netpol-test.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/cyclonus-netpol-test.yaml b/.github/workflows/cyclonus-netpol-test.yaml index e7457f11dd..c7f54ea9b7 100644 --- a/.github/workflows/cyclonus-netpol-test.yaml +++ b/.github/workflows/cyclonus-netpol-test.yaml @@ -17,6 +17,10 @@ on: jobs: cyclonus-test: runs-on: ubuntu-latest + strategy: + matrix: + # run cyclonus tests in parallel for NPM with the given ConfigMaps + config-map: [v1-default-profile.yaml] steps: - name: Checkout uses: actions/checkout@v2 @@ -41,10 +45,14 @@ jobs: VERSION=cyclonus IMAGE_PLATFORM_ARCHES=linux/amd64 IMAGE_ACTION=load make azure-npm-image - 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 + kubectl apply -f ./npm/profiles/${{ matrix.config-map }} + kubectl rollout restart ds azure-npm -n kube-system - name: Check Cluster Components run: | From 5e1a2c2f9a3da5cb31f598dddac5b9cddfbc33fd Mon Sep 17 00:00:00 2001 From: Hunter Gregory Date: Thu, 18 Nov 2021 14:58:03 -0800 Subject: [PATCH 4/6] rename things and try 2 different profiles run in parallel --- .github/workflows/cyclonus-netpol-test.yaml | 5 +++-- npm/profiles/{v1-default-profile.yaml => v1-default.yaml} | 0 npm/profiles/{v2-default-config.yaml => v2-default.yaml} | 0 3 files changed, 3 insertions(+), 2 deletions(-) rename npm/profiles/{v1-default-profile.yaml => v1-default.yaml} (100%) rename npm/profiles/{v2-default-config.yaml => v2-default.yaml} (100%) diff --git a/.github/workflows/cyclonus-netpol-test.yaml b/.github/workflows/cyclonus-netpol-test.yaml index c7f54ea9b7..3b3a80e471 100644 --- a/.github/workflows/cyclonus-netpol-test.yaml +++ b/.github/workflows/cyclonus-netpol-test.yaml @@ -20,7 +20,7 @@ jobs: strategy: matrix: # run cyclonus tests in parallel for NPM with the given ConfigMaps - config-map: [v1-default-profile.yaml] + profile: [v1-default.yaml, v2-default.yaml] steps: - name: Checkout uses: actions/checkout@v2 @@ -51,7 +51,8 @@ jobs: 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 - kubectl apply -f ./npm/profiles/${{ matrix.config-map }} + 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 diff --git a/npm/profiles/v1-default-profile.yaml b/npm/profiles/v1-default.yaml similarity index 100% rename from npm/profiles/v1-default-profile.yaml rename to npm/profiles/v1-default.yaml diff --git a/npm/profiles/v2-default-config.yaml b/npm/profiles/v2-default.yaml similarity index 100% rename from npm/profiles/v2-default-config.yaml rename to npm/profiles/v2-default.yaml From 59ae4526db769fcf67f5845aec921e5d04251e93 Mon Sep 17 00:00:00 2001 From: Hunter Gregory Date: Mon, 22 Nov 2021 09:32:04 -0800 Subject: [PATCH 5/6] update v2 toggle name in profiles --- npm/profiles/v1-default.yaml | 2 +- npm/profiles/v1-place-azure-chain-first.yaml | 2 +- npm/profiles/v2-default.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/npm/profiles/v1-default.yaml b/npm/profiles/v1-default.yaml index a5c092ab1b..a4d63ff093 100644 --- a/npm/profiles/v1-default.yaml +++ b/npm/profiles/v1-default.yaml @@ -13,7 +13,7 @@ data: "EnablePrometheusMetrics": true, "EnablePprof": false, "EnableHTTPDebugAPI": true, - "EnableV2Controllers": false, + "EnableV2NPM": false, "PlaceAzureChainFirst": false } } diff --git a/npm/profiles/v1-place-azure-chain-first.yaml b/npm/profiles/v1-place-azure-chain-first.yaml index e0ee3fcc25..245935c49b 100644 --- a/npm/profiles/v1-place-azure-chain-first.yaml +++ b/npm/profiles/v1-place-azure-chain-first.yaml @@ -13,7 +13,7 @@ data: "EnablePrometheusMetrics": true, "EnablePprof": false, "EnableHTTPDebugAPI": true, - "EnableV2Controllers": false, + "EnableV2NPM": false, "PlaceAzureChainFirst": true } } diff --git a/npm/profiles/v2-default.yaml b/npm/profiles/v2-default.yaml index 345671c528..c51e020a52 100644 --- a/npm/profiles/v2-default.yaml +++ b/npm/profiles/v2-default.yaml @@ -13,6 +13,6 @@ data: "EnablePrometheusMetrics": true, "EnablePprof": false, "EnableHTTPDebugAPI": true, - "EnableV2Controllers": true + "EnableV2NPM": true } } From 500ffe515e5210c1bdaf5368bc4fc7c50b4b6fb3 Mon Sep 17 00:00:00 2001 From: Hunter Gregory Date: Mon, 22 Nov 2021 12:24:48 -0800 Subject: [PATCH 6/6] remove v2 cyclonus test and add one for placing azure chain first (v1) --- .github/workflows/cyclonus-netpol-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cyclonus-netpol-test.yaml b/.github/workflows/cyclonus-netpol-test.yaml index 3b3a80e471..7a310fd674 100644 --- a/.github/workflows/cyclonus-netpol-test.yaml +++ b/.github/workflows/cyclonus-netpol-test.yaml @@ -20,7 +20,7 @@ jobs: strategy: matrix: # run cyclonus tests in parallel for NPM with the given ConfigMaps - profile: [v1-default.yaml, v2-default.yaml] + profile: [v1-default.yaml, v1-place-azure-chain-first.yaml] steps: - name: Checkout uses: actions/checkout@v2