Skip to content

Commit

Permalink
simplify test cases only 1-node test cases and separate pod configs f…
Browse files Browse the repository at this point in the history
…or different volume types

Signed-off-by: Mucahit Kurt <[email protected]>
  • Loading branch information
mucahitkurt committed Jul 8, 2019
1 parent e914fd1 commit 4d2c1e9
Show file tree
Hide file tree
Showing 15 changed files with 120 additions and 55 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Below test cases can be run with the parameters like;

- 1 pod with X volumes and 1 node
-- `.Nodes := 1`, `$TOTAL_PODS := 1`, `$VOLUMES_PER_POD := <X>`
- X pods with 1 volume each on 1 node in parallel
-- `.Nodes := 1`, `$TOTAL_PODS := <X>`, `$VOLUMES_PER_POD := 1`

To test with different volume types please use the override file for the specific volume type, default volume type is `EmptyDir`
ª
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# ASSUMPTIONS:
# - this test cases should be run on only 1 node on cluster

#Constants
{{$NODES_PER_NAMESPACE := DefaultParam .NODES_PER_NAMESPACE 1}}
{{$PODS_PER_NODE := DefaultParam .PODS_PER_NODE 1}}
{{$TOTAL_PODS := DefaultParam .TOTAL_PODS 1}}
{{$POD_TEMPLATE_PATH := DefaultParam .POD_TEMPLATE_PATH "pod_with_EmptyDirs.yaml"}}
{{$LOAD_TEST_THROUGHPUT := DefaultParam .LOAD_TEST_THROUGHPUT 10}}

{{$VOLUMES_PER_POD := 4}}
{{$VOLUMES_PER_POD := DefaultParam .VOLUMES_PER_POD 4}}
{{$VOLUME_TYPE := DefaultParam .VOLUME_TYPE "EmptyDir"}}
{{$VOLUME_TEMPLATE_PATH := .VOLUME_TEMPLATE_PATH}}
{{$PROVISION_VOLUME := DefaultParam .PROVISION_VOLUME false}}

{{$APP_NAME := "pod-load"}}
{{$GROUP := "pod-with-ephemeral-volume-startup-latency"}}

#Variables
# TODO think about this!
{{$podStartupTimeout := $VOLUMES_PER_POD}}
{{$namespaces := DivideInt .Nodes $NODES_PER_NAMESPACE}}
{{$podsPerNamespace := MultiplyInt $NODES_PER_NAMESPACE $PODS_PER_NODE}}
{{$totalPods := MultiplyInt $namespaces $NODES_PER_NAMESPACE $PODS_PER_NODE}}
{{$volumesPerNamespace := MultiplyInt $podsPerNamespace $VOLUMES_PER_POD}}
# used stateless pod SLO for initial run
{{$podStartupTimeout := 5}}
{{$totalVolumes := MultiplyInt $TOTAL_PODS $VOLUMES_PER_POD}}

name: pod-with-ephemeral-volume-startup-latency
automanagedNamespaces: {{$namespaces}}
automanagedNamespaces: 1
tuningSets:
# TODO different options?
- name: UniformQPS
qpsLoad:
qps: {{$LOAD_TEST_THROUGHPUT}}
Expand All @@ -36,12 +36,12 @@ steps:
- phases:
- namespaceRange:
min: 1
max: {{$namespaces}}
replicasPerNamespace: {{$volumesPerNamespace}}
max: 1
replicasPerNamespace: {{$totalVolumes}}
tuningSet: UniformQPS
objectBundle:
- basename: vol-{{$APP_NAME}}
objectTemplatePath: {{$VOLUME_TYPE}}.yaml
objectTemplatePath: {{$VOLUME_TEMPLATE_PATH}}
{{ end }}
# Start measurements
- measurements:
Expand All @@ -55,24 +55,23 @@ steps:
- phases:
- namespaceRange:
min: 1
max: {{$namespaces}}
replicasPerNamespace: {{$podsPerNamespace}}
max: 1
replicasPerNamespace: {{$TOTAL_PODS}}
tuningSet: UniformQPS
objectBundle:
- basename: {{$APP_NAME}}
objectTemplatePath: pod.yaml
objectTemplatePath: {{$POD_TEMPLATE_PATH}}
templateFillMap:
Group: {{$GROUP}}
VolumesPerPod: {{$VOLUMES_PER_POD}}
VolumeType: {{$VOLUME_TYPE}}
AppName: {{$APP_NAME}}
- measurements:
- Identifier: WaitForRunningPodsWithStorage
Method: WaitForRunningPods
Params:
desiredPodCount: {{$totalPods}}
desiredPodCount: {{$TOTAL_PODS}}
labelSelector: group = {{$GROUP}}
# TODO how can i determine this?
# TODO decide this after test roll-out phase
timeout: 15m
- measurements:
- Identifier: PodWithMultiVolumeStartupLatency
Expand All @@ -83,15 +82,15 @@ steps:
- phases:
- namespaceRange:
min: 1
max: {{$namespaces}}
max: 1
replicasPerNamespace: 0
tuningSet: UniformQPS
objectBundle:
- basename: {{$APP_NAME}}
objectTemplatePath: pod.yaml
objectTemplatePath: {{$POD_TEMPLATE_PATH}}
# Collect measurements
- measurements:
- Identifier: APIResponsiveness
Method: APIResponsiveness
Params:
action: gather
action: gather
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ kind: ConfigMap
metadata:
name: {{.Name}}
data:
TEST_KEY1: testData1
TEST_KEY1: testData1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
VOLUME_TYPE: ConfigMap
PROVISION_VOLUME: true
POD_TEMPLATE_PATH: "configmap/pod_with_ConfigMaps.yaml"
VOLUME_TEMPLATE_PATH: "configmap/ConfigMap.yaml"
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{$index := .Index}}
{{$appName := .AppName}}
{{$volumesPerPod := .VolumesPerPod}}
apiVersion: v1
kind: Pod
metadata:
name: {{.Name}}
labels:
app: {{.Name}}
group: {{.Group}}
spec:
containers:
- name: {{.Name}}
image: k8s.gcr.io/pause:3.1
imagePullPolicy: IfNotPresent
volumeMounts:
{{ range $volumeIndex, $vol := Seq .VolumesPerPod }}
- name: vol-{{$volumeIndex}}
mountPath: /usr/share/{{$volumeIndex}}
{{ end }}
volumes:
{{ range $volumeIndex, $vol := Seq .VolumesPerPod }}
- name: vol-{{$volumeIndex}}
configMap:
name: vol-{{$appName}}-{{AddInt $volumeIndex (MultiplyInt $index $volumesPerPod)}}
{{ end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VOLUME_TYPE: DownwardAPI
POD_TEMPLATE_PATH: "downwardapi/pod_with_DownwardAPIs.yaml"
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{$volumeType := .VolumeType}}
{{$index := .Index}}
{{$appName := .AppName}}
{{$volumesPerPod := .VolumesPerPod}}
Expand All @@ -14,9 +13,6 @@ spec:
- name: {{.Name}}
image: k8s.gcr.io/pause:3.1
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
name: {{.Name}}
volumeMounts:
{{ range $volumeIndex, $vol := Seq .VolumesPerPod }}
- name: vol-{{$volumeIndex}}
Expand All @@ -25,18 +21,6 @@ spec:
volumes:
{{ range $volumeIndex, $vol := Seq .VolumesPerPod }}
- name: vol-{{$volumeIndex}}
{{ if eq $volumeType "ConfigMap" }}
configMap:
name: vol-{{$appName}}-{{AddInt $volumeIndex (MultiplyInt $index $volumesPerPod)}}
{{ end }}
{{ if eq $volumeType "EmptyDir" }}
emptyDir: {}
{{ end }}
{{ if eq $volumeType "Secret" }}
secret:
secretName: vol-{{$appName}}-{{AddInt $volumeIndex (MultiplyInt $index $volumesPerPod)}}
{{ end }}
{{ if eq $volumeType "DownwardAPI" }}
downwardAPI:
items:
- path: "pod_name"
Expand All @@ -46,4 +30,3 @@ spec:
fieldRef:
fieldPath: metadata.namespace
{{ end }}
{{ end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{$index := .Index}}
{{$appName := .AppName}}
{{$volumesPerPod := .VolumesPerPod}}
apiVersion: v1
kind: Pod
metadata:
name: {{.Name}}
labels:
app: {{.Name}}
group: {{.Group}}
spec:
containers:
- name: {{.Name}}
image: k8s.gcr.io/pause:3.1
imagePullPolicy: IfNotPresent
volumeMounts:
{{ range $volumeIndex, $vol := Seq .VolumesPerPod }}
- name: vol-{{$volumeIndex}}
mountPath: /usr/share/{{$volumeIndex}}
{{ end }}
volumes:
{{ range $volumeIndex, $vol := Seq .VolumesPerPod }}
- name: vol-{{$volumeIndex}}
emptyDir: {}
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
type: Opaque
data:
username: dXNlcm5hbWVfCg==
password: cGFzc3dvcmRfCg==
password: cGFzc3dvcmRfCg==
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
VOLUME_TYPE: Secret
PROVISION_VOLUME: true
POD_TEMPLATE_PATH: "secret/pod_with_Secrets.yaml"
VOLUME_TEMPLATE_PATH: "secret/Secret.yaml"
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{$index := .Index}}
{{$appName := .AppName}}
{{$volumesPerPod := .VolumesPerPod}}
apiVersion: v1
kind: Pod
metadata:
name: {{.Name}}
labels:
app: {{.Name}}
group: {{.Group}}
spec:
containers:
- name: {{.Name}}
image: k8s.gcr.io/pause:3.1
imagePullPolicy: IfNotPresent
volumeMounts:
{{ range $volumeIndex, $vol := Seq .VolumesPerPod }}
- name: vol-{{$volumeIndex}}
mountPath: /usr/share/{{$volumeIndex}}
{{ end }}
volumes:
{{ range $volumeIndex, $vol := Seq .VolumesPerPod }}
- name: vol-{{$volumeIndex}}
secret:
secretName: vol-{{$appName}}-{{AddInt $volumeIndex (MultiplyInt $index $volumesPerPod)}}
{{ end }}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 4d2c1e9

Please sign in to comment.