Skip to content

Commit 1594ec2

Browse files
ci: [NPM] conformance test for loadbalancer and nodeport services (#3420)
* ci: update profiles (disable placefirst for "background", enable background for "placefirst") Signed-off-by: Hunter Gregory <42728408+huntergregory@users.noreply.github.com> * ci: run conformance for place first special services Signed-off-by: Hunter Gregory <42728408+huntergregory@users.noreply.github.com> --------- Signed-off-by: Hunter Gregory <42728408+huntergregory@users.noreply.github.com>
1 parent 6683a8b commit 1594ec2

File tree

3 files changed

+54
-35
lines changed

3 files changed

+54
-35
lines changed

.pipelines/npm/npm-conformance-tests.yaml

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ stages:
110110
AZURE_CLUSTER: "conformance-v2-linux-stress"
111111
PROFILE: "v2-background"
112112
IS_STRESS_TEST: "true"
113+
v2-place-first:
114+
AZURE_CLUSTER: "conformance-v2-place-first"
115+
PROFILE: "v2-place-first"
116+
IS_STRESS_TEST: "false"
113117
pool:
114118
name: $(BUILD_POOL_NAME_DEFAULT)
115119
demands:
@@ -251,15 +255,23 @@ stages:
251255
set -e
252256
make -C ./hack/aks set-kubeconf AZCLI=az GROUP=$(RESOURCE_GROUP) CLUSTER=$(AZURE_CLUSTER)
253257
254-
# sig-release provides test suite tarball(s) per k8s release. Just need to provide k8s version "v1.xx.xx"
255-
# pulling k8s version from AKS.
256-
eval k8sVersion="v"$( az aks show -g $(RESOURCE_GROUP) -n $(AZURE_CLUSTER) --query "currentKubernetesVersion")
257-
echo $k8sVersion
258-
curl -L https://dl.k8s.io/$k8sVersion/kubernetes-test-linux-amd64.tar.gz -o ./kubernetes-test-linux-amd64.tar.gz
259-
260-
# https://github.com/kubernetes/sig-release/blob/master/release-engineering/artifacts.md#content-of-kubernetes-test-system-archtargz-on-example-of-kubernetes-test-linux-amd64targz-directories-removed-from-list
261-
# explictly unzip and strip directories from ginkgo and e2e.test
262-
tar -xvzf kubernetes-test-linux-amd64.tar.gz --strip-components=3 kubernetes/test/bin/ginkgo kubernetes/test/bin/e2e.test
258+
if [ $(PROFILE) == "v2-place-first" ]; then
259+
git clone --depth=1 --branch=huntergregory/service-types https://github.com/huntergregory/network-policy-api.git
260+
cd network-policy-api/cmd/policy-assistant
261+
make policy-assistant
262+
cd ../../..
263+
mv network-policy-api/cmd/policy-assistant/cmd/policy-assistant/policy-assistant .
264+
else
265+
# sig-release provides test suite tarball(s) per k8s release. Just need to provide k8s version "v1.xx.xx"
266+
# pulling k8s version from AKS.
267+
eval k8sVersion="v"$( az aks show -g $(RESOURCE_GROUP) -n $(AZURE_CLUSTER) --query "currentKubernetesVersion")
268+
echo $k8sVersion
269+
curl -L https://dl.k8s.io/$k8sVersion/kubernetes-test-linux-amd64.tar.gz -o ./kubernetes-test-linux-amd64.tar.gz
270+
271+
# https://github.com/kubernetes/sig-release/blob/master/release-engineering/artifacts.md#content-of-kubernetes-test-system-archtargz-on-example-of-kubernetes-test-linux-amd64targz-directories-removed-from-list
272+
# explictly unzip and strip directories from ginkgo and e2e.test
273+
tar -xvzf kubernetes-test-linux-amd64.tar.gz --strip-components=3 kubernetes/test/bin/ginkgo kubernetes/test/bin/e2e.test
274+
fi
263275
264276
displayName: "Setup Environment"
265277

@@ -280,8 +292,13 @@ stages:
280292
echo $FQDN
281293
282294
runConformance () {
283-
KUBERNETES_SERVICE_HOST="$FQDN" KUBERNETES_SERVICE_PORT=443 ./e2e.test --provider=local --ginkgo.focus="NetworkPolicy" --ginkgo.skip="SCTP" --kubeconfig=./kubeconfig
284-
# there can't be a command after e2e.test because the exit code is important
295+
if [ $(PROFILE) == "v2-place-first" ]; then
296+
# 15 minute timeout for creating LoadBalancer with Azure-internal "external IPs"
297+
./policy-assistant generate --noisy=true --job-timeout-seconds=2 --pod-creation-timeout-seconds 900 --server-protocol TCP,UDP --ignore-loopback --include special-services --exclude cni-brings-source-pod-info-to-other-node
298+
else
299+
KUBERNETES_SERVICE_HOST="$FQDN" KUBERNETES_SERVICE_PORT=443 ./e2e.test --provider=local --ginkgo.focus="NetworkPolicy" --ginkgo.skip="SCTP" --kubeconfig=./kubeconfig
300+
fi
301+
# there can't be a command after e2e.test/policy-assistant because the exit code is important
285302
}
286303
287304
runConformanceWindows () {

npm/profiles/v2-background.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ metadata:
66
data:
77
azure-npm.json: |
88
{
9-
"ResyncPeriodInMinutes": 15,
10-
"ListeningPort": 10091,
11-
"ListeningAddress": "0.0.0.0",
12-
"NetPolInvervalInMilliseconds": 500,
13-
"MaxPendingNetPols": 100,
14-
"Toggles": {
15-
"EnablePrometheusMetrics": true,
16-
"EnablePprof": true,
17-
"EnableHTTPDebugAPI": true,
18-
"EnableV2NPM": true,
19-
"PlaceAzureChainFirst": true,
20-
"ApplyIPSetsOnNeed": false,
21-
"NetPolInBackground": true
9+
"ResyncPeriodInMinutes": 15,
10+
"ListeningPort": 10091,
11+
"ListeningAddress": "0.0.0.0",
12+
"NetPolInvervalInMilliseconds": 500,
13+
"MaxPendingNetPols": 100,
14+
"Toggles": {
15+
"EnablePrometheusMetrics": true,
16+
"EnablePprof": true,
17+
"EnableHTTPDebugAPI": true,
18+
"EnableV2NPM": true,
19+
"PlaceAzureChainFirst": false,
20+
"ApplyIPSetsOnNeed": false,
21+
"NetPolInBackground": true
2222
}
2323
}

npm/profiles/v2-place-first.yaml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@ metadata:
66
data:
77
azure-npm.json: |
88
{
9-
"ResyncPeriodInMinutes": 15,
10-
"ListeningPort": 10091,
11-
"ListeningAddress": "0.0.0.0",
9+
"ResyncPeriodInMinutes": 15,
10+
"ListeningPort": 10091,
11+
"ListeningAddress": "0.0.0.0",
12+
"NetPolInvervalInMilliseconds": 500,
13+
"MaxPendingNetPols": 100,
1214
"Toggles": {
13-
"EnablePrometheusMetrics": true,
14-
"EnablePprof": false,
15-
"EnableHTTPDebugAPI": true,
16-
"EnableV2NPM": true,
17-
"PlaceAzureChainFirst": true,
18-
"ApplyIPSetsOnNeed": true,
19-
"NetPolInBackground": false
20-
}
15+
"EnablePrometheusMetrics": true,
16+
"EnablePprof": true,
17+
"EnableHTTPDebugAPI": true,
18+
"EnableV2NPM": true,
19+
"PlaceAzureChainFirst": true,
20+
"ApplyIPSetsOnNeed": false,
21+
"NetPolInBackground": true
22+
}
2123
}

0 commit comments

Comments
 (0)