Skip to content

Commit db62973

Browse files
wonderylLei Yao
andcommitted
clusterloader2: add CL2_TOLERATION override to all workload templates
Add a new CL2_TOLERATION parameter that, when set to a non-empty string, adds a toleration with operator: Exists and effect: NoSchedule using that string as the key. This allows directing all workloads to any arbitrarily tainted node without needing a dedicated override per taint type. Applies to: Deployment, StatefulSet, DaemonSet, Job (reconcile-objects) and simple-deployment (scheduler-throughput / huge-service). Co-authored-by: Lei Yao <[email protected]>
1 parent 54cdea9 commit db62973

File tree

5 files changed

+30
-0
lines changed

5 files changed

+30
-0
lines changed

clusterloader2/testing/load/modules/reconcile-objects/daemonset.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{{$Env := DefaultParam .Env ""}}
44
{{$DaemonSetSurge := DefaultParam .CL2_DS_SURGE (MaxInt 10 (DivideInt .Nodes 20))}} # 5% of nodes, but not less than 10
55
{{$RUN_ON_ARM_NODES := DefaultParam .CL2_RUN_ON_ARM_NODES false}}
6+
{{$TOLERATION := DefaultParam .CL2_TOLERATION ""}}
67

78
{{$ENABLE_NETWORK_POLICY_ENFORCEMENT_LATENCY_TEST := DefaultParam .CL2_ENABLE_NETWORK_POLICY_ENFORCEMENT_LATENCY_TEST false}}
89
{{$NET_POLICY_ENFORCEMENT_LATENCY_NODE_LABEL_VALUE := DefaultParam .CL2_NET_POLICY_ENFORCEMENT_LATENCY_NODE_LABEL_VALUE "net-policy-client"}}
@@ -55,6 +56,11 @@ spec:
5556
value: arm64
5657
effect: NoSchedule
5758
{{end}}
59+
{{if $TOLERATION}}
60+
- key: {{$TOLERATION}}
61+
operator: Exists
62+
effect: NoSchedule
63+
{{end}}
5864
{{if $ENABLE_NETWORK_POLICY_ENFORCEMENT_LATENCY_TEST}}
5965
- key: test-np
6066
operator: Equal

clusterloader2/testing/load/modules/reconcile-objects/deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# Guard the new DNS tests. Remove it once it's confirmed that it works on a subset of tests.
99
{{$USE_ADVANCED_DNSTEST := DefaultParam .CL2_USE_ADVANCED_DNSTEST false}}
1010
{{$RUN_ON_ARM_NODES := DefaultParam .CL2_RUN_ON_ARM_NODES false}}
11+
{{$TOLERATION := DefaultParam .CL2_TOLERATION ""}}
1112

1213
{{$EnableNetworkPolicyEnforcementLatencyTest := DefaultParam .EnableNetworkPolicyEnforcementLatencyTest false}}
1314
{{$TargetLabelValue := DefaultParam .TargetLabelValue "enforcement-latency"}}
@@ -113,6 +114,11 @@ spec:
113114
value: arm64
114115
effect: NoSchedule
115116
{{end}}
117+
{{if $TOLERATION}}
118+
- key: {{$TOLERATION}}
119+
operator: Exists
120+
effect: NoSchedule
121+
{{end}}
116122
volumes:
117123
- name: configmap
118124
configMap:

clusterloader2/testing/load/modules/reconcile-objects/job.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{$HostNetworkMode := DefaultParam .CL2_USE_HOST_NETWORK_PODS false}}
22
{{$RUN_ON_ARM_NODES := DefaultParam .CL2_RUN_ON_ARM_NODES false}}
3+
{{$TOLERATION := DefaultParam .CL2_TOLERATION ""}}
34
{{$Image := DefaultParam .Image "registry.k8s.io/pause:3.9"}}
45
{{$podPayloadSize := DefaultParam .CL2_JOB_POD_PAYLOAD_SIZE 0}}
56
{{$RuntimeClassName := DefaultParam .CL2_RUNTIME_CLASS_NAME nil}}
@@ -60,3 +61,8 @@ spec:
6061
value: arm64
6162
effect: NoSchedule
6263
{{end}}
64+
{{if $TOLERATION}}
65+
- key: {{$TOLERATION}}
66+
operator: Exists
67+
effect: NoSchedule
68+
{{end}}

clusterloader2/testing/load/modules/reconcile-objects/statefulset.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{{$HostNetworkMode := DefaultParam .CL2_USE_HOST_NETWORK_PODS false}}
22
{{$EnablePVs := DefaultParam .CL2_ENABLE_PVS true}}
33
{{$RUN_ON_ARM_NODES := DefaultParam .CL2_RUN_ON_ARM_NODES false}}
4+
{{$TOLERATION := DefaultParam .CL2_TOLERATION ""}}
45
{{$podPayloadSize := DefaultParam .CL2_STATEFULSET_POD_PAYLOAD_SIZE 0}}
56
{{$Image := DefaultParam .Image "registry.k8s.io/pause:3.9"}}
67
{{$RuntimeClassName := DefaultParam .CL2_RUNTIME_CLASS_NAME nil}}
@@ -67,6 +68,11 @@ spec:
6768
value: arm64
6869
effect: NoSchedule
6970
{{end}}
71+
{{if $TOLERATION}}
72+
- key: {{$TOLERATION}}
73+
operator: Exists
74+
effect: NoSchedule
75+
{{end}}
7076
{{if $EnablePVs}}
7177
# NOTE: PVs created this way should be cleaned-up manually, as deleting the StatefulSet doesn't automatically delete PVs.
7278
# To avoid deleting all the PVs at once during namespace deletion, they should be deleted explicitly via Phase.

clusterloader2/testing/load/modules/scheduler-throughput/simple-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
{{$MemoryRequest := DefaultParam .MemoryRequest "20M"}}
77
{{$Image := DefaultParam .Image "registry.k8s.io/pause:3.9"}}
88
{{$RUN_ON_ARM_NODES := DefaultParam .CL2_RUN_ON_ARM_NODES false}}
9+
{{$TOLERATION := DefaultParam .CL2_TOLERATION ""}}
910

1011
apiVersion: apps/v1
1112
kind: Deployment
@@ -57,3 +58,8 @@ spec:
5758
value: arm64
5859
effect: NoSchedule
5960
{{end}}
61+
{{if $TOLERATION}}
62+
- key: {{$TOLERATION}}
63+
operator: Exists
64+
effect: NoSchedule
65+
{{end}}

0 commit comments

Comments
 (0)