Skip to content

Commit f9843f0

Browse files
committed
use deployment instead of raw pod
Signed-off-by: Mucahit Kurt <[email protected]>
1 parent 3a6b3de commit f9843f0

File tree

16 files changed

+258
-150
lines changed

16 files changed

+258
-150
lines changed

clusterloader2/testing/experimental/storage/pod-startup/config.yaml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# Test Variales
1010
{{$TEST_NAME := DefaultParam .TEST_NAME "generic-test"}}
1111
{{$PODS_PER_NODE := .PODS_PER_NODE}}
12-
{{$POD_TEMPLATE_PATH := .POD_TEMPLATE_PATH }}
12+
{{$DEPLOYMENT_TEMPLATE_PATH := .DEPLOYMENT_TEMPLATE_PATH }}
1313
{{$VOLUMES_PER_POD := .VOLUMES_PER_POD}}
1414
{{$VOLUME_TEMPLATE_PATH := .VOLUME_TEMPLATE_PATH}}
1515
{{$PROVISION_VOLUME := DefaultParam .PROVISION_VOLUME false}}
@@ -21,7 +21,6 @@
2121

2222
# Computed Variables
2323
{{$namespaces := DivideInt .Nodes $NODES_PER_NAMESPACE | MaxInt 1}}
24-
{{$totalPods := MultiplyInt $namespaces $NODES_PER_NAMESPACE $PODS_PER_NODE}}
2524
{{$podsPerNamespace := MultiplyInt $NODES_PER_NAMESPACE $PODS_PER_NODE}}
2625
{{$volumesPerNamespace := MultiplyInt $podsPerNamespace $VOLUMES_PER_POD}}
2726
{{$totalVols := MultiplyInt $volumesPerNamespace $namespaces}}
@@ -81,36 +80,45 @@ steps:
8180
labelSelector: group = volume-test
8281
timeout: {{$PVCBoundTime}}s
8382
{{ end }}
84-
# Create pods
83+
- name: Starting measurement for waiting for deployments
84+
measurements:
85+
- Identifier: WaitForRunningDeployments
86+
Method: WaitForControlledPodsRunning
87+
Params:
88+
action: start
89+
apiVersion: apps/v1
90+
kind: Deployment
91+
labelSelector: group = volume-test
92+
operationTimeout: {{$POD_STARTUP_TIMEOUT}}
93+
# Create deployments
8594
- phases:
8695
- namespaceRange:
8796
min: 1
8897
max: {{$namespaces}}
8998
replicasPerNamespace: {{$podsPerNamespace}}
9099
tuningSet: Sequence
91100
objectBundle:
92-
- basename: pod
93-
objectTemplatePath: {{$POD_TEMPLATE_PATH}}
101+
- basename: deployment
102+
objectTemplatePath: {{$DEPLOYMENT_TEMPLATE_PATH}}
94103
templateFillMap:
95104
Group: volume-test
96105
VolumesPerPod: {{$VOLUMES_PER_POD}}
97-
- measurements:
98-
- Identifier: WaitForRunningPodsWithVolumes
99-
Method: WaitForRunningPods
106+
- name: Waiting for deployments to be running
107+
measurements:
108+
- Identifier: WaitForRunningDeployments
109+
Method: WaitForControlledPodsRunning
100110
Params:
101-
desiredPodCount: {{$totalPods}}
102-
labelSelector: group = volume-test
103-
timeout: {{$POD_STARTUP_TIMEOUT}}
104-
# Delete pods
111+
action: gather
112+
# Delete deployments
105113
- phases:
106114
- namespaceRange:
107115
min: 1
108116
max: {{$namespaces}}
109117
replicasPerNamespace: 0
110118
tuningSet: Sequence
111119
objectBundle:
112-
- basename: pod
113-
objectTemplatePath: {{$POD_TEMPLATE_PATH}}
120+
- basename: deployment
121+
objectTemplatePath: {{$DEPLOYMENT_TEMPLATE_PATH}}
114122
{{ if $PROVISION_VOLUME }}
115123
# Delete volumes
116124
- phases:
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{{$index := .Index}}
2+
{{$volumesPerPod := .VolumesPerPod}}
3+
apiVersion: apps/v1
4+
kind: Deployment
5+
metadata:
6+
name: {{.Name}}
7+
labels:
8+
group: {{.Group}}
9+
spec:
10+
replicas: 1
11+
selector:
12+
matchLabels:
13+
name: {{.Name}}
14+
template:
15+
metadata:
16+
labels:
17+
group: {{.Group}}
18+
name: {{.Name}}
19+
spec:
20+
containers:
21+
- name: {{.Name}}
22+
image: k8s.gcr.io/pause:3.1
23+
imagePullPolicy: IfNotPresent
24+
volumeMounts:
25+
{{ range $volumeIndex, $vol := Seq .VolumesPerPod }}
26+
- name: vol-{{$volumeIndex}}
27+
mountPath: /usr/share/{{$volumeIndex}}
28+
{{ end }}
29+
volumes:
30+
{{ range $volumeIndex, $vol := Seq .VolumesPerPod }}
31+
- name: vol-{{$volumeIndex}}
32+
configMap:
33+
name: vol-{{AddInt $volumeIndex (MultiplyInt $index $volumesPerPod)}}
34+
{{ end }}
35+
# Add not-ready/unreachable tolerations for 15 minutes so that node
36+
# failure doesn't trigger pod deletion.
37+
tolerations:
38+
- key: "node.kubernetes.io/not-ready"
39+
operator: "Exists"
40+
effect: "NoExecute"
41+
tolerationSeconds: 900
42+
- key: "node.kubernetes.io/unreachable"
43+
operator: "Exists"
44+
effect: "NoExecute"
45+
tolerationSeconds: 900
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
PROVISION_VOLUME: true
2-
POD_TEMPLATE_PATH: "volume-types/configmap/pod_with_configmap.yaml"
2+
DEPLOYMENT_TEMPLATE_PATH: "volume-types/configmap/deployment_with_configmap.yaml"
33
VOLUME_TEMPLATE_PATH: "volume-types/configmap/configmap.yaml"

clusterloader2/testing/experimental/storage/pod-startup/volume-types/configmap/pod_with_configmap.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{{$index := .Index}}
2+
{{$volumesPerPod := .VolumesPerPod}}
3+
apiVersion: apps/v1
4+
kind: Deployment
5+
metadata:
6+
name: {{.Name}}
7+
labels:
8+
group: {{.Group}}
9+
spec:
10+
replicas: 1
11+
selector:
12+
matchLabels:
13+
name: {{.Name}}
14+
template:
15+
metadata:
16+
labels:
17+
group: {{.Group}}
18+
name: {{.Name}}
19+
spec:
20+
containers:
21+
- name: {{.Name}}
22+
image: k8s.gcr.io/pause:3.1
23+
imagePullPolicy: IfNotPresent
24+
volumeMounts:
25+
{{ range $volumeIndex, $vol := Seq .VolumesPerPod }}
26+
- name: vol-{{$volumeIndex}}
27+
mountPath: /usr/share/{{$volumeIndex}}
28+
{{ end }}
29+
volumes:
30+
{{ range $volumeIndex, $vol := Seq .VolumesPerPod }}
31+
- name: vol-{{$volumeIndex}}
32+
downwardAPI:
33+
items:
34+
- path: "pod_name"
35+
fieldRef:
36+
fieldPath: metadata.name
37+
- path: "pod_namespace"
38+
fieldRef:
39+
fieldPath: metadata.namespace
40+
{{ end }}
41+
# Add not-ready/unreachable tolerations for 15 minutes so that node
42+
# failure doesn't trigger pod deletion.
43+
tolerations:
44+
- key: "node.kubernetes.io/not-ready"
45+
operator: "Exists"
46+
effect: "NoExecute"
47+
tolerationSeconds: 900
48+
- key: "node.kubernetes.io/unreachable"
49+
operator: "Exists"
50+
effect: "NoExecute"
51+
tolerationSeconds: 900
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
POD_TEMPLATE_PATH: "volume-types/downwardapi/pod_with_downwardapi.yaml"
1+
DEPLOYMENT_TEMPLATE_PATH: "volume-types/downwardapi/deployment_with_downwardapi.yaml"

clusterloader2/testing/experimental/storage/pod-startup/volume-types/downwardapi/pod_with_downwardapi.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{{$index := .Index}}
2+
{{$volumesPerPod := .VolumesPerPod}}
3+
apiVersion: apps/v1
4+
kind: Deployment
5+
metadata:
6+
name: {{.Name}}
7+
labels:
8+
group: {{.Group}}
9+
spec:
10+
replicas: 1
11+
selector:
12+
matchLabels:
13+
name: {{.Name}}
14+
template:
15+
metadata:
16+
labels:
17+
group: {{.Group}}
18+
name: {{.Name}}
19+
spec:
20+
containers:
21+
- name: {{.Name}}
22+
image: k8s.gcr.io/pause:3.1
23+
imagePullPolicy: IfNotPresent
24+
volumeMounts:
25+
{{ range $volumeIndex, $vol := Seq .VolumesPerPod }}
26+
- name: vol-{{$volumeIndex}}
27+
mountPath: /usr/share/{{$volumeIndex}}
28+
{{ end }}
29+
volumes:
30+
{{ range $volumeIndex, $vol := Seq .VolumesPerPod }}
31+
- name: vol-{{$volumeIndex}}
32+
emptyDir: {}
33+
{{ end }}
34+
# Add not-ready/unreachable tolerations for 15 minutes so that node
35+
# failure doesn't trigger pod deletion.
36+
tolerations:
37+
- key: "node.kubernetes.io/not-ready"
38+
operator: "Exists"
39+
effect: "NoExecute"
40+
tolerationSeconds: 900
41+
- key: "node.kubernetes.io/unreachable"
42+
operator: "Exists"
43+
effect: "NoExecute"
44+
tolerationSeconds: 900
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
POD_TEMPLATE_PATH: "volume-types/emptydir/pod_with_emptydir.yaml"
1+
DEPLOYMENT_TEMPLATE_PATH: "volume-types/emptydir/deployment_with_emptydir.yaml"

clusterloader2/testing/experimental/storage/pod-startup/volume-types/emptydir/pod_with_emptydir.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)