Added network policy test setup for soak, scale and load and supporting tools#22
Added network policy test setup for soak, scale and load and supporting tools#22sanamsarath wants to merge 6 commits intoAzure:mainfrom
Conversation
| imagePullPolicy: Always | ||
| image: gcr.io/k8s-staging-perf-tests/network-policy-enforcement-latency/policy-creation-enforcement-latency:v0.0.1 | ||
| # image: gcr.io/k8s-staging-perf-tests/network-policy-enforcement-latency/policy-creation-enforcement-latency:v0.0.1 | ||
| image: docker.io/sanamsarath/policy-creation-enforcement-latency:v0.0.1 |
There was a problem hiding this comment.
why are we using custom image here? If that's needed to add new commands, then we should publish it to ghcr and use image from there instead of docker.io
| -MaxTargets={{.MaxTargets}} | ||
| -MetricsPort={{.MetricsPort}} | ||
| -AllowPolicyName={{.AllowPolicyName}} | ||
| -np_type={{.NetworkPolicy_Type}} |
There was a problem hiding this comment.
Let's follow proper format like the original arguments. For example, -NetworkPolicyType instead of np_type. Also, remove _ for consistency in naming, like NetworkPolicyType instead of NetworkPolicy_Type
There was a problem hiding this comment.
Does this repo have a style guide?
| - method: GET | ||
| path: / | ||
| {{end}} | ||
| {{else if .NetworkPolicy_Type "ccnp" }} |
There was a problem hiding this comment.
I don't quite follow the if else here. Can you use indentation those to make the condition flow clearer?
| // test client pods should run. | ||
| testClientNodeSelectorValue string | ||
| // np type is the type of network policy to be created, default is k8s. | ||
| npType string |
There was a problem hiding this comment.
netPolicyType instead of npType. We should avoid unclear variable names
| app.kubernetes.io/name: prometheus-operator | ||
| app.kubernetes.io/part-of: kube-prometheus | ||
| app.kubernetes.io/version: 0.46.0 | ||
| k8s-app: prometheus-operator |
There was a problem hiding this comment.
why do we need this? it's already defined with app.kubernetes.io/name: prometheus-operator
| @@ -0,0 +1,18 @@ | |||
| # test setup details - | |||
There was a problem hiding this comment.
Rename file to README.md. Add documentation for different type of network policies, like what is k8s, ccnp, cnp.
| @@ -0,0 +1,17 @@ | |||
| USERNAME ?= sanamsarath | |||
There was a problem hiding this comment.
let use some default name here instead of your name in case we want to merge this into upstream
| @@ -0,0 +1,17 @@ | |||
| USERNAME ?= sanamsarath | |||
| PROJECT ?= netloader | |||
| REGISTRY ?= acnpublic.azurecr.io | |||
There was a problem hiding this comment.
same here let's use ghcr
| @@ -1,4 +1,4 @@ | |||
| REGISTRY ?= gcr.io/k8s-staging-perf-tests/network-policy-enforcement-latency | |||
| REGISTRY ?= docker.io/sanamsarath | |||
| module k8s.io/perf-tests/network/tools/network-policy-enforcement-latency | ||
|
|
||
| go 1.22.4 | ||
| go 1.23.0 |
There was a problem hiding this comment.
changing go version could break other tests. Let's avoid doing that if not necessary
…elay in Dispose method
…Policy, and deployClientPods to prevent memory spikes
…nd improve template management in deployment methods
What type of PR is this?
/kind feature
/kind regression
What this PR does / why we need it:
The changes in the pull request include:
Copilot generated summery below:
This pull request introduces several significant enhancements and modifications to the network policy enforcement and soak tests in the
clusterloader2project. The changes include adding support for Cilium network policies, updating image references, and improving the flexibility of the network policy framework.Enhancements to Network Policy Enforcement:
clusterloader2/pkg/measurement/common/network-policy/network-policy-enforcement-latency.go: Added support for Cilium network policies (cnpandccnp), including new fields for network policy type and L7 policies. Introduced functions to delete Cilium network policies. [1] [2] [3] [4] [5] [6] [7]Updates to Network Policy Manifests:
clusterloader2/pkg/measurement/common/network-policy/manifests/policy-egress-allow-target-pods.yaml: Added support for Cilium network policies and updated the structure to handle different types of network policies. [1] [2]Changes to Image References:
clusterloader2/pkg/measurement/common/network-policy/manifests/dep-test-client-policy-creation.yaml: Updated the image reference fromgcr.iotodocker.iofor thepolicy-creation-enforcement-latencyimage. [1] [2]Additions to Network Policy Soak Tests:
clusterloader2/pkg/measurement/common/network-policy/network-policy-soak/manifests/allow_apiserver_np.yamlclusterloader2/pkg/measurement/common/network-policy/network-policy-soak/manifests/client_deploy.yamlclusterloader2/pkg/measurement/common/network-policy/network-policy-soak/manifests/clusterrole.yamlclusterloader2/pkg/measurement/common/network-policy/network-policy-soak/manifests/clusterrolebinding.yamlclusterloader2/pkg/measurement/common/network-policy/network-policy-soak/manifests/network_policy.yamlclusterloader2/pkg/measurement/common/network-policy/network-policy-soak/manifests/serviceaccount.yamlclusterloader2/pkg/measurement/common/network-policy/network-policy-soak/manifests/target_deploy.yamlMinor Import and Function Updates:
clusterloader2/cmd/clusterloader.go: Added import fornetwork-policy-soak.clusterloader2/pkg/measurement/common/network-policy/network-policy-enforcement-latency.go: Added import forschema.clusterloader2/pkg/measurement/util/gatherers/container_resource_gatherer.go: UpdatedNewResourceUsageGathererfunction to accept optional pod label selectors. [1] [2] [3]