-
Notifications
You must be signed in to change notification settings - Fork 634
Expand file tree
/
Copy pathdaemonset.yaml
More file actions
69 lines (67 loc) · 2.29 KB
/
daemonset.yaml
File metadata and controls
69 lines (67 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{{$HostNetworkMode := DefaultParam .CL2_USE_HOST_NETWORK_PODS false}}
{{$Image := DefaultParam .Image "registry.k8s.io/pause:3.9"}}
{{$Env := DefaultParam .Env ""}}
{{$DaemonSetSurge := DefaultParam .CL2_DS_SURGE (MaxInt 10 (DivideInt .Nodes 20))}} # 5% of nodes, but not less than 10
{{$RUN_ON_ARM_NODES := DefaultParam .CL2_RUN_ON_ARM_NODES false}}
{{$TOLERATION := DefaultParam .CL2_TOLERATION ""}}
{{$ENABLE_NETWORK_POLICY_ENFORCEMENT_LATENCY_TEST := DefaultParam .CL2_ENABLE_NETWORK_POLICY_ENFORCEMENT_LATENCY_TEST false}}
{{$NET_POLICY_ENFORCEMENT_LATENCY_NODE_LABEL_VALUE := DefaultParam .CL2_NET_POLICY_ENFORCEMENT_LATENCY_NODE_LABEL_VALUE "net-policy-client"}}
{{$podPayloadSize := DefaultParam .CL2_DAEMONSET_POD_PAYLOAD_SIZE 0}}
{{$RuntimeClassName := DefaultParam .CL2_RUNTIME_CLASS_NAME nil}}
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{.Name}}
labels:
group: load
spec:
updateStrategy:
rollingUpdate:
maxUnavailable: {{$DaemonSetSurge}}
selector:
matchLabels:
name: {{.Name}}
template:
metadata:
labels:
group: load
name: {{.Name}}
spec:
{{if $RuntimeClassName}}
runtimeClassName: {{$RuntimeClassName}}
{{end}}
hostNetwork: {{$HostNetworkMode}}
containers:
- name: {{.Name}}
image: {{$Image}}
env:
- name: TEST_ENV
value: {{$Env}}
- name: ENV_VAR
value: {{RandDataWithSeed $podPayloadSize .Name}}
resources:
# Keep the CpuRequest/MemoryRequest request equal percentage of 1-core, 4GB node.
# For now we're setting it to 0.5%.
requests:
cpu: 5m
memory: "20M"
priorityClassName: daemonset-priorityclass-0 # Name is autogenerated, hence the -0 prefix.
terminationGracePeriodSeconds: 1
tolerations:
{{if $RUN_ON_ARM_NODES}}
- key: "kubernetes.io/arch"
operator: Equal
value: arm64
effect: NoSchedule
{{end}}
{{if $TOLERATION}}
- key: {{$TOLERATION}}
operator: Exists
effect: NoSchedule
{{end}}
{{if $ENABLE_NETWORK_POLICY_ENFORCEMENT_LATENCY_TEST}}
- key: test-np
operator: Equal
value: {{$NET_POLICY_ENFORCEMENT_LATENCY_NODE_LABEL_VALUE}}
effect: NoSchedule
{{end}}