From 185997a7f36113bab3c0c2ccb943dc12e18e62ca Mon Sep 17 00:00:00 2001 From: Mucahit Kurt Date: Tue, 9 Jul 2019 00:13:47 +0300 Subject: [PATCH] simplify test cases only 1-node test cases and separate pod configs for different volume types Signed-off-by: Mucahit Kurt --- .../ephemeral-volumes/1_node/README.md | 8 ++++ .../ephemeral-volumes/1_node}/config.yaml | 46 +++++++++---------- .../1_node/configmap}/ConfigMap.yaml | 2 +- .../1_node/configmap/override.yaml | 3 ++ .../1_node/configmap/pod_with_ConfigMaps.yaml | 26 +++++++++++ .../1_node/downwardapi/override.yaml | 1 + .../downwardapi/pod_with_DownwardAPIs.yaml} | 17 ------- .../1_node/pod_with_EmptyDirs.yaml | 25 ++++++++++ .../1_node/secret}/Secret.yaml | 2 +- .../1_node/secret/override.yaml | 3 ++ .../1_node/secret/pod_with_Secrets.yaml | 26 +++++++++++ .../pod-startup/ephemeral-volumes/README.md | 8 ---- .../ephemeral-volumes/configmap/override.yaml | 2 - .../downwardapi/override.yaml | 1 - .../ephemeral-volumes/secret/override.yaml | 2 - 15 files changed, 116 insertions(+), 56 deletions(-) create mode 100644 clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/README.md rename clusterloader2/testing/{storage/pod-startup/ephemeral-volumes => experimental/storage/pod-startup/ephemeral-volumes/1_node}/config.yaml (62%) rename clusterloader2/testing/{storage/pod-startup/ephemeral-volumes => experimental/storage/pod-startup/ephemeral-volumes/1_node/configmap}/ConfigMap.yaml (73%) create mode 100644 clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/configmap/override.yaml create mode 100644 clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/configmap/pod_with_ConfigMaps.yaml create mode 100644 clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/downwardapi/override.yaml rename clusterloader2/testing/{storage/pod-startup/ephemeral-volumes/pod.yaml => experimental/storage/pod-startup/ephemeral-volumes/1_node/downwardapi/pod_with_DownwardAPIs.yaml} (59%) create mode 100644 clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/pod_with_EmptyDirs.yaml rename clusterloader2/testing/{storage/pod-startup/ephemeral-volumes => experimental/storage/pod-startup/ephemeral-volumes/1_node/secret}/Secret.yaml (78%) create mode 100644 clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/secret/override.yaml create mode 100644 clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/secret/pod_with_Secrets.yaml delete mode 100644 clusterloader2/testing/storage/pod-startup/ephemeral-volumes/README.md delete mode 100644 clusterloader2/testing/storage/pod-startup/ephemeral-volumes/configmap/override.yaml delete mode 100644 clusterloader2/testing/storage/pod-startup/ephemeral-volumes/downwardapi/override.yaml delete mode 100644 clusterloader2/testing/storage/pod-startup/ephemeral-volumes/secret/override.yaml diff --git a/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/README.md b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/README.md new file mode 100644 index 0000000000..ed4734817c --- /dev/null +++ b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/README.md @@ -0,0 +1,8 @@ +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 pods with 1 volume each on 1 node in parallel +-- `.Nodes := 1`, `$TOTAL_PODS := `, `$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` diff --git a/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/config.yaml b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/config.yaml similarity index 62% rename from clusterloader2/testing/storage/pod-startup/ephemeral-volumes/config.yaml rename to clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/config.yaml index 6c4d01e8f1..c3aac4b35b 100644 --- a/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/config.yaml +++ b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/config.yaml @@ -1,27 +1,26 @@ +# ASSUMPTIONS: +# - this test cases should be run on only 1 node + #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}} -{{$VOLUME_TYPE := DefaultParam .VOLUME_TYPE "EmptyDir"}} +{{$VOLUMES_PER_POD := DefaultParam .VOLUMES_PER_POD 4}} +{{$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}} @@ -36,12 +35,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: @@ -55,24 +54,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 @@ -83,15 +81,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 \ No newline at end of file + action: gather diff --git a/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/ConfigMap.yaml b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/configmap/ConfigMap.yaml similarity index 73% rename from clusterloader2/testing/storage/pod-startup/ephemeral-volumes/ConfigMap.yaml rename to clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/configmap/ConfigMap.yaml index 05f13f0952..d18983a809 100644 --- a/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/ConfigMap.yaml +++ b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/configmap/ConfigMap.yaml @@ -3,4 +3,4 @@ kind: ConfigMap metadata: name: {{.Name}} data: - TEST_KEY1: testData1 \ No newline at end of file + TEST_KEY1: testData1 diff --git a/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/configmap/override.yaml b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/configmap/override.yaml new file mode 100644 index 0000000000..fb14d6a7a6 --- /dev/null +++ b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/configmap/override.yaml @@ -0,0 +1,3 @@ +PROVISION_VOLUME: true +POD_TEMPLATE_PATH: "configmap/pod_with_ConfigMaps.yaml" +VOLUME_TEMPLATE_PATH: "configmap/ConfigMap.yaml" diff --git a/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/configmap/pod_with_ConfigMaps.yaml b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/configmap/pod_with_ConfigMaps.yaml new file mode 100644 index 0000000000..08d201a859 --- /dev/null +++ b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/configmap/pod_with_ConfigMaps.yaml @@ -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 }} diff --git a/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/downwardapi/override.yaml b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/downwardapi/override.yaml new file mode 100644 index 0000000000..ecf6234f84 --- /dev/null +++ b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/downwardapi/override.yaml @@ -0,0 +1 @@ +POD_TEMPLATE_PATH: "downwardapi/pod_with_DownwardAPIs.yaml" diff --git a/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/pod.yaml b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/downwardapi/pod_with_DownwardAPIs.yaml similarity index 59% rename from clusterloader2/testing/storage/pod-startup/ephemeral-volumes/pod.yaml rename to clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/downwardapi/pod_with_DownwardAPIs.yaml index fdd12656b2..03ce130315 100644 --- a/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/pod.yaml +++ b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/downwardapi/pod_with_DownwardAPIs.yaml @@ -1,4 +1,3 @@ -{{$volumeType := .VolumeType}} {{$index := .Index}} {{$appName := .AppName}} {{$volumesPerPod := .VolumesPerPod}} @@ -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}} @@ -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" @@ -46,4 +30,3 @@ spec: fieldRef: fieldPath: metadata.namespace {{ end }} - {{ end }} \ No newline at end of file diff --git a/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/pod_with_EmptyDirs.yaml b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/pod_with_EmptyDirs.yaml new file mode 100644 index 0000000000..ea58fdeaed --- /dev/null +++ b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/pod_with_EmptyDirs.yaml @@ -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 }} diff --git a/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/Secret.yaml b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/secret/Secret.yaml similarity index 78% rename from clusterloader2/testing/storage/pod-startup/ephemeral-volumes/Secret.yaml rename to clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/secret/Secret.yaml index 91b732b371..fc9b8a4049 100644 --- a/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/Secret.yaml +++ b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/secret/Secret.yaml @@ -5,4 +5,4 @@ metadata: type: Opaque data: username: dXNlcm5hbWVfCg== - password: cGFzc3dvcmRfCg== \ No newline at end of file + password: cGFzc3dvcmRfCg== diff --git a/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/secret/override.yaml b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/secret/override.yaml new file mode 100644 index 0000000000..cb72e58ee5 --- /dev/null +++ b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/secret/override.yaml @@ -0,0 +1,3 @@ +PROVISION_VOLUME: true +POD_TEMPLATE_PATH: "secret/pod_with_Secrets.yaml" +VOLUME_TEMPLATE_PATH: "secret/Secret.yaml" diff --git a/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/secret/pod_with_Secrets.yaml b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/secret/pod_with_Secrets.yaml new file mode 100644 index 0000000000..981d144408 --- /dev/null +++ b/clusterloader2/testing/experimental/storage/pod-startup/ephemeral-volumes/1_node/secret/pod_with_Secrets.yaml @@ -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 }} diff --git a/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/README.md b/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/README.md deleted file mode 100644 index 74abcd0f39..0000000000 --- a/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/README.md +++ /dev/null @@ -1,8 +0,0 @@ -Below test cases can be run with the parameters like; - -- 1 pod with X volumes and 1 node --- `.Nodes := 1`, `$NODES_PER_NAMESPACE := 1`, `$PODS_PER_NODE := 1`, `$VOLUMES_PER_POD := ` -- X pods with 1 volume each on 1 node in parallel --- `.Nodes := 1`, `$NODES_PER_NAMESPACE := 1`, `$PODS_PER_NODE := `, `$VOLUMES_PER_POD := 1` -- X pods with 1 volume each in parallel --- `.Nodes := `, `$NODES_PER_NAMESPACE := `, `$PODS_PER_NODE := `, `$VOLUMES_PER_POD := 1` \ No newline at end of file diff --git a/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/configmap/override.yaml b/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/configmap/override.yaml deleted file mode 100644 index 9a5300016e..0000000000 --- a/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/configmap/override.yaml +++ /dev/null @@ -1,2 +0,0 @@ -VOLUME_TYPE: ConfigMap -PROVISION_VOLUME: true \ No newline at end of file diff --git a/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/downwardapi/override.yaml b/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/downwardapi/override.yaml deleted file mode 100644 index 56b6748ad8..0000000000 --- a/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/downwardapi/override.yaml +++ /dev/null @@ -1 +0,0 @@ -VOLUME_TYPE: DownwardAPI \ No newline at end of file diff --git a/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/secret/override.yaml b/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/secret/override.yaml deleted file mode 100644 index 48a79ff5f9..0000000000 --- a/clusterloader2/testing/storage/pod-startup/ephemeral-volumes/secret/override.yaml +++ /dev/null @@ -1,2 +0,0 @@ -VOLUME_TYPE: Secret -PROVISION_VOLUME: true \ No newline at end of file