Skip to content

Commit c244424

Browse files
committed
Merge branch 'master' into isaiahraya/npm-cilium-migration-script
2 parents 9de5cb8 + 1594ec2 commit c244424

23 files changed

+1939
-41
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 () {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ require (
2020
github.com/golang/mock v1.6.0
2121
github.com/golang/protobuf v1.5.4
2222
github.com/google/gnostic-models v0.6.8 // indirect
23-
github.com/google/go-cmp v0.6.0
23+
github.com/google/go-cmp v0.7.0
2424
github.com/google/uuid v1.6.0
2525
github.com/gorilla/mux v1.8.1
2626
github.com/hashicorp/go-version v1.7.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
144144
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
145145
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
146146
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
147-
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
148-
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
147+
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
148+
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
149149
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
150150
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
151151
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=

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
}

test/integration/manifests/cilium/v1.16/cilium-agent/templates/daemonset-dualstack.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ spec:
152152
readOnly: true
153153
- mountPath: /run/xtables.lock
154154
name: xtables-lock
155+
- mountPath: /var/run/cilium/netns
156+
name: cilium-netns
157+
mountPropagation: HostToContainer
155158
dnsPolicy: ClusterFirst
156159
hostNetwork: true
157160
initContainers:
@@ -428,6 +431,10 @@ spec:
428431
path: /proc/sys/kernel
429432
type: Directory
430433
name: host-proc-sys-kernel
434+
- hostPath:
435+
path: /var/run/netns
436+
type: DirectoryOrCreate
437+
name: cilium-netns
431438
updateStrategy:
432439
rollingUpdate:
433440
maxSurge: 0

test/integration/manifests/cilium/v1.16/cilium-agent/templates/daemonset.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ spec:
152152
readOnly: true
153153
- mountPath: /run/xtables.lock
154154
name: xtables-lock
155+
- mountPath: /var/run/cilium/netns
156+
name: cilium-netns
157+
mountPropagation: HostToContainer
155158
dnsPolicy: ClusterFirst
156159
hostNetwork: true
157160
initContainers:
@@ -415,6 +418,10 @@ spec:
415418
path: /proc/sys/kernel
416419
type: Directory
417420
name: host-proc-sys-kernel
421+
- hostPath:
422+
path: /var/run/netns
423+
type: DirectoryOrCreate
424+
name: cilium-netns
418425
updateStrategy:
419426
rollingUpdate:
420427
maxSurge: 0

test/integration/manifests/cilium/v1.16/cilium-config/cilium-config-dualstack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ data:
6969
synchronize-k8s-nodes: "true"
7070
tofqdns-dns-reject-response-code: refused
7171
tofqdns-enable-dns-compression: "true"
72-
tofqdns-endpoint-max-ip-per-hostname: "50"
72+
tofqdns-endpoint-max-ip-per-hostname: "1000"
7373
tofqdns-idle-connection-grace-period: 0s
7474
tofqdns-max-deferred-connection-deletes: "10000"
7575
tofqdns-min-ttl: "0"

test/integration/manifests/cilium/v1.16/cilium-config/cilium-config-hubble.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ data:
7070
synchronize-k8s-nodes: "true"
7171
tofqdns-dns-reject-response-code: refused
7272
tofqdns-enable-dns-compression: "true"
73-
tofqdns-endpoint-max-ip-per-hostname: "50"
73+
tofqdns-endpoint-max-ip-per-hostname: "1000"
7474
tofqdns-idle-connection-grace-period: 0s
7575
tofqdns-max-deferred-connection-deletes: "10000"
7676
tofqdns-min-ttl: "0"

test/integration/manifests/cilium/v1.16/cilium-config/cilium-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ data:
6565
synchronize-k8s-nodes: "true"
6666
tofqdns-dns-reject-response-code: refused
6767
tofqdns-enable-dns-compression: "true"
68-
tofqdns-endpoint-max-ip-per-hostname: "50"
68+
tofqdns-endpoint-max-ip-per-hostname: "1000"
6969
tofqdns-idle-connection-grace-period: 0s
7070
tofqdns-max-deferred-connection-deletes: "10000"
7171
tofqdns-min-ttl: "0"

0 commit comments

Comments
 (0)