-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Network churn Load test - Add network policy enforcement latency measurement #431
base: main
Are you sure you want to change the base?
Changes from 6 commits
d69ce5d
5024f5c
a0599f3
9814101
b9aa5f6
e976e31
9c20982
9b55220
bdb7267
6ced26d
2e3e8ee
568b69c
6ddeace
a3c8a83
56df80f
b7e79fc
95e7006
ed4c562
293b0cb
6f6950f
725c6c2
b27b806
ec21cce
c26601d
00c1e73
6beb6b1
b19978a
b3ab5f9
a2e1e68
d7d3fc4
3061d90
15bd627
c40aacd
fb1184a
d4e2c0a
2d9eea7
512e931
71df343
5e4aaa9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,9 @@ parameters: | |
- name: run_id | ||
type: string | ||
default: '' | ||
- name: run_id_2 | ||
type: string | ||
default: '' | ||
- name: timeout_in_minutes | ||
type: number | ||
default: 60 # default when not specified is 60 minutes | ||
|
@@ -48,6 +51,9 @@ parameters: | |
- name: ssh_key_enabled | ||
type: boolean | ||
default: true | ||
- name: use_secondary_cluster | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is secondary cluster for? |
||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
- job: ${{ parameters.cloud }} | ||
|
@@ -62,10 +68,12 @@ jobs: | |
cloud: ${{ parameters.cloud }} | ||
region: ${{ parameters.regions[0] }} | ||
run_id: ${{ parameters.run_id }} | ||
run_id_2: ${{ parameters.run_id_2 }} | ||
test_modules_dir: ${{ parameters.test_modules_dir }} | ||
retry_attempt_count: ${{ parameters.retry_attempt_count }} | ||
credential_type: ${{ parameters.credential_type }} | ||
ssh_key_enabled: ${{ parameters.ssh_key_enabled }} | ||
use_secondary_cluster: ${{ parameters.use_secondary_cluster }} | ||
- template: /steps/provision-resources.yml | ||
parameters: | ||
cloud: ${{ parameters.cloud }} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ name: load-config | |
|
||
# Config options for test type | ||
{{$SERVICE_TEST := DefaultParam .CL2_SERVICE_TEST true}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This value is not explicitly overridden in |
||
{{$NETWORK_TEST := DefaultParam .CL2_NETWORK_TEST false}} | ||
|
||
# Config options for test parameters | ||
{{$nodesPerNamespace := DefaultParam .CL2_NODES_PER_NAMESPACE 100}} | ||
|
@@ -12,12 +13,12 @@ name: load-config | |
{{$groupName := DefaultParam .CL2_GROUP_NAME "service-discovery"}} | ||
|
||
# TODO(jshr-w): This should eventually use >1 namespace. | ||
{{$namespaces := 1}} | ||
{{$namespaces := DefaultParam .CL2_NO_OF_NAMESPACES 1}} | ||
{{$nodes := DefaultParam .CL2_NODES 1000}} | ||
|
||
{{$deploymentQPS := DivideFloat $loadTestThroughput $deploymentSize}} | ||
{{$operationTimeout := DefaultParam .CL2_OPERATION_TIMEOUT "15m"}} | ||
{{$totalPods := MultiplyInt $namespaces $nodes $podsPerNode}} | ||
{{$totalPods := MultiplyInt $namespaces $nodesPerNamespace $podsPerNode}} | ||
{{$podsPerNamespace := DivideInt $totalPods $namespaces}} | ||
{{$deploymentsPerNamespace := DivideInt $podsPerNamespace $deploymentSize}} | ||
|
||
|
@@ -29,17 +30,17 @@ name: load-config | |
|
||
# Service test | ||
{{$BIG_GROUP_SIZE := DefaultParam .BIG_GROUP_SIZE 4000}} | ||
{{$SMALL_GROUP_SIZE := DefaultParam .SMALL_GROUP_SIZE 20}} | ||
{{$SMALL_GROUP_SIZE := DefaultParam .CL2_DEPLOYMENT_SIZE 20}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we name this CL2_SMALL_GROUP_SIZE to keep the variable naming coordinated? |
||
{{$bigDeploymentsPerNamespace := DefaultParam .bigDeploymentsPerNamespace 1}} | ||
{{$smallDeploymentPods := SubtractInt $podsPerNamespace (MultiplyInt $bigDeploymentsPerNamespace $BIG_GROUP_SIZE)}} | ||
{{$smallDeploymentPods := DivideInt $totalPods $namespaces}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is going to break all the other tests, right? Could you please restore this, and probably create a parameter for bigDeployments and set that to 0 instead. |
||
{{$smallDeploymentsPerNamespace := DivideInt $smallDeploymentPods $SMALL_GROUP_SIZE}} | ||
|
||
namespace: | ||
number: {{$namespaces}} | ||
prefix: slo | ||
deleteStaleNamespaces: true | ||
deleteAutomanagedNamespaces: true | ||
enableExistingNamespaces: false | ||
enableExistingNamespaces: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This may break testing. If namespaces weren't deleted by the previous run, we should be aware (many existing pipelines are dependent on this). Let's restore to the original value. |
||
|
||
tuningSets: | ||
- name: Sequence | ||
|
@@ -53,7 +54,7 @@ tuningSets: | |
qps: {{$deploymentQPS}} | ||
|
||
steps: | ||
- name: Log - namespaces={{$namespaces}}, nodesPerNamespace={{$nodesPerNamespace}}, podsPerNode={{$podsPerNode}}, totalPods={{$totalPods}}, podsPerNamespace={{$podsPerNamespace}}, deploymentsPerNamespace={{$deploymentsPerNamespace}}, deploymentSize={{$deploymentSize}}, deploymentQPS={{$deploymentQPS}} | ||
- name: Log - namespaces={{$namespaces}}, nodes={{$nodes}}, nodesPerNamespace={{$nodesPerNamespace}}, podsPerNode={{$podsPerNode}}, totalPods={{$totalPods}}, podsPerNamespace={{$podsPerNamespace}}, deploymentsPerNamespace={{$deploymentsPerNamespace}}, deploymentSize={{$deploymentSize}}, deploymentQPS={{$deploymentQPS}} | ||
measurements: | ||
- Identifier: Dummy | ||
Method: Sleep | ||
|
@@ -74,6 +75,13 @@ steps: | |
action: start | ||
{{end}} | ||
|
||
{{if $NETWORK_TEST}} | ||
- module: | ||
path: /modules/network-policy/net-policy-metrics.yaml | ||
params: | ||
action: start | ||
{{end}} | ||
|
||
{{range $i := Loop $repeats}} | ||
{{if $SERVICE_TEST}} | ||
- module: | ||
|
@@ -85,6 +93,15 @@ steps: | |
bigServicesPerNamespace: {{$bigDeploymentsPerNamespace}} | ||
{{end}} | ||
|
||
{{if $NETWORK_TEST}} | ||
- module: | ||
path: modules/network-policy/net-policy-enforcement-latency.yaml | ||
params: | ||
setup: true | ||
run: true | ||
testType: "pod-creation" | ||
{{end}} | ||
|
||
- module: | ||
path: /modules/reconcile-objects.yaml | ||
params: | ||
|
@@ -101,6 +118,27 @@ steps: | |
Group: {{$groupName}} | ||
deploymentLabel: start | ||
|
||
{{if $NETWORK_TEST}} | ||
- module: | ||
path: modules/network-policy/net-policy-metrics.yaml | ||
params: | ||
action: gather | ||
usePolicyCreationMetrics: true | ||
usePodCreationMetrics: true | ||
|
||
- module: | ||
path: modules/network-policy/net-policy-enforcement-latency.yaml | ||
params: | ||
complete: true | ||
testType: "pod-creation" | ||
|
||
- module: | ||
path: modules/network-policy/net-policy-enforcement-latency.yaml | ||
params: | ||
run: true | ||
testType: "policy-creation" | ||
{{end}} | ||
|
||
- module: | ||
path: /modules/reconcile-objects.yaml | ||
params: | ||
|
@@ -152,3 +190,18 @@ steps: | |
params: | ||
action: gather | ||
group: {{$groupName}} | ||
|
||
{{if $NETWORK_TEST}} | ||
- module: | ||
path: modules/network-policy/net-policy-metrics.yaml | ||
params: | ||
action: gather | ||
usePolicyCreationMetrics: true | ||
usePodCreationMetrics: true | ||
|
||
- module: | ||
path: modules/network-policy/net-policy-enforcement-latency.yaml | ||
params: | ||
complete: true | ||
testType: "policy-creation" | ||
{{end}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{{$NETWORK_POLICY_ENFORCEMENT_LATENCY_BASELINE := DefaultParam .CL2_NETWORK_POLICY_ENFORCEMENT_LATENCY_BASELINE false}} | ||
{{$NET_POLICY_ENFORCEMENT_LATENCY_TARGET_LABEL_KEY := DefaultParam .CL2_NET_POLICY_ENFORCEMENT_LATENCY_TARGET_LABEL_KEY "net-pol-test"}} | ||
{{$NET_POLICY_ENFORCEMENT_LATENCY_TARGET_LABEL_VALUE := DefaultParam .CL2_NET_POLICY_ENFORCEMENT_LATENCY_TARGET_LABEL_VALUE "enforcement-latency"}} | ||
{{$NET_POLICY_ENFORCEMENT_LATENCY_NODE_LABEL_KEY := DefaultParam .CL2_NET_POLICY_ENFORCEMENT_LATENCY_NODE_LABEL_KEY "test"}} | ||
{{$NET_POLICY_ENFORCEMENT_LATENCY_NODE_LABEL_VALUE := DefaultParam .CL2_NET_POLICY_ENFORCEMENT_LATENCY_NODE_LABEL_VALUE "net-policy-client"}} | ||
{{$NET_POLICY_ENFORCEMENT_LATENCY_MAX_TARGET_PODS_PER_NS := DefaultParam .CL2_NET_POLICY_ENFORCEMENT_LATENCY_MAX_TARGET_PODS_PER_NS 100}} | ||
{{$NET_POLICY_ENFORCEMENT_LOAD_COUNT := DefaultParam .CL2_NET_POLICY_ENFORCEMENT_LOAD_COUNT 1000}} | ||
{{$NET_POLICY_ENFORCEMENT_LOAD_QPS := DefaultParam .CL2_NET_POLICY_ENFORCEMENT_LOAD_QPS 10}} | ||
{{$NET_POLICY_ENFORCEMENT_LOAD_TARGET_NAME := DefaultParam .CL2_POLICY_ENFORCEMENT_LOAD_TARGET_NAME "small-deployment"}} | ||
|
||
{{$setup := DefaultParam .setup false}} | ||
{{$run := DefaultParam .run false}} | ||
{{$complete := DefaultParam .complete false}} | ||
{{$testType := DefaultParam .testType "policy-creation"}} | ||
# Target port needs to match the server container port of target pods that have | ||
# "targetLabelKey: targetLabelValue" label selector. | ||
{{$targetPort := 80}} | ||
|
||
steps: | ||
{{if $setup}} | ||
- name: Setup network policy enforcement latency measurement | ||
measurements: | ||
- Identifier: NetworkPolicyEnforcement | ||
Method: NetworkPolicyEnforcement | ||
Params: | ||
action: setup | ||
targetLabelKey: {{$NET_POLICY_ENFORCEMENT_LATENCY_TARGET_LABEL_KEY}} | ||
targetLabelValue: {{$NET_POLICY_ENFORCEMENT_LATENCY_TARGET_LABEL_VALUE}} | ||
baseline: {{$NETWORK_POLICY_ENFORCEMENT_LATENCY_BASELINE}} | ||
testClientNodeSelectorKey: {{$NET_POLICY_ENFORCEMENT_LATENCY_NODE_LABEL_KEY}} | ||
testClientNodeSelectorValue: {{$NET_POLICY_ENFORCEMENT_LATENCY_NODE_LABEL_VALUE}} | ||
{{end}} | ||
|
||
{{if $run}} | ||
- name: "Run pod creation network policy enforcement latency measurement (testType={{$testType}})" | ||
measurements: | ||
- Identifier: NetworkPolicyEnforcement | ||
Method: NetworkPolicyEnforcement | ||
Params: | ||
action: run | ||
testType: {{$testType}} | ||
targetPort: {{$targetPort}} | ||
maxTargets: {{$NET_POLICY_ENFORCEMENT_LATENCY_MAX_TARGET_PODS_PER_NS}} | ||
policyLoadCount: {{$NET_POLICY_ENFORCEMENT_LOAD_COUNT}} | ||
policyLoadQPS: {{$NET_POLICY_ENFORCEMENT_LOAD_QPS}} | ||
policyLoadTargetBaseName: {{$NET_POLICY_ENFORCEMENT_LOAD_TARGET_NAME}} | ||
{{end}} | ||
|
||
{{if $complete}} | ||
- name: "Complete pod creation network policy enforcement latency measurement (testType={{$testType}})" | ||
measurements: | ||
- Identifier: NetworkPolicyEnforcement | ||
Method: NetworkPolicyEnforcement | ||
Params: | ||
action: complete | ||
testType: {{$testType}} | ||
{{end}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is run id 2 for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am using two different pre created cluster for azure_cilium and azure_cni_overlay and I am passing those two clusters using run_id and run_id_2, as creating two new cluster for every run with 1000 nodes each takes a very long time, so I am passing two cluster tags to run tests on them.
On second thought I am thinking i can do it with terraform and schedule it to run periodically.