Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add persistent volume scale tests
Browse files Browse the repository at this point in the history
Hantao (Will) Wang committed Jul 19, 2019
1 parent a743784 commit b6f9857
Showing 6 changed files with 203 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
TEST_NAME: single-node-scale-by-pod
PODS_PER_NODE: 100
PVC_PER_POD: 1
POD_STARTUP_SLO: 300
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
TEST_NAME: single-node-scale-by-pvc-per-pod
PODS_PER_NODE: 1
PVC_PER_POD: 100
POD_STARTUP_SLO: 300
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
TEST_NAME: multi-node-cluster-load-scale-by-node
PODS_PER_NODE: 10
PVC_PER_POD: 1
POD_STARTUP_SLO: 300
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# ASSUMPTIONS:
# TODO: Assumptions

# Constants
{{$NODE_MODE := DefaultParam .NODE_MODE "allnodes"}}
{{$DEFAULT_NODES_PER_NAMESPACE := DefaultParam .NODES_PER_NAMESPACE 100}}

# Variables
{{$PODS_PER_NODE := DefaultParam .PODS_PER_NODE 50}}
{{$PVC_PER_POD := DefaultParam .PVC_PER_POD 2}}
{{$ENABLE_CHAOSMONKEY := DefaultParam .ENABLE_CHAOSMONKEY false}}
{{$TEST_NAME := DefaultParam .TEST_NAME "generic-test"}}
{{$PVC_SIZE := DefaultParam .PVC_SIZE "8Gi"}}
{{$PER_PVC_BOUND_SLO := DefaultParam .PVC_BOUND_SLO 2}}
{{$POD_STARTUP_SLO := DefaultParam .POD_STARTUP_SLO 100}}
{{$OBJ_CREATION_QPS := DefaultParam .OBJ_CREATION_QPS 10}}

# Calculated
{{$minNamespaces := DivideInt .Nodes $DEFAULT_NODES_PER_NAMESPACE}}
{{$namespaces := MaxInt $minNamespaces 1}}
{{$nodesPerNamespace := DivideInt .Nodes $namespaces}}
{{$podsPerNamespace := MultiplyInt $nodesPerNamespace $PODS_PER_NODE}}
{{$pvcsPerNamespace := MultiplyInt $podsPerNamespace $nodesPerNamespace}}
{{$totalPVCs := MultiplyInt $pvcsPerNamespace $namespaces}}
{{$PVCBoundTime := MultiplyInt $totalPVCs $PER_PVC_BOUND_SLO | MaxInt 60}}

name: pv-storage-{{$TEST_NAME}}
automanagedNamespaces: {{$namespaces}}
tuningSets:
- name: Sequence
parallelismLimitedLoad:
parallelismLimit: 1
- name: UniformQPS
qpsLoad:
qps: {{$OBJ_CREATION_QPS}}
{{if $ENABLE_CHAOSMONKEY}}
chaosMonkey:
nodeFailure:
failureRate: 0.01
interval: 1m
jitterFactor: 10.0
simulatedDowntime: 10m
{{end}}
steps:
- measurements:
- Identifier: APIResponsiveness
Method: APIResponsiveness
Params:
action: reset
- Identifier: APIResponsivenessPrometheus
Method: APIResponsivenessPrometheus
Params:
action: start
- Identifier: TestMetrics
Method: TestMetrics
Params:
action: start
nodeMode: {{$NODE_MODE}}
# Create PVCs
- phases:
- namespaceRange:
min: 1
max: {{$namespaces}}
replicasPerNamespace: {{$pvcsPerNamespace}}
tuningSet: UniformQPS
objectBundle:
- basename: pvc
objectTemplatePath: pvc.yaml
templateFillMap:
PVCSize: {{$PVC_SIZE}}
- measurements:
- Identifier: WaitForPVCsToBeBound
Method: WaitForBoundPVCs
Params:
desiredPVCCount: {{MultiplyInt $podsPerNamespace $PVC_PER_POD}}
apiVersion: v1
labelSelector: group = test-pvc
timeout: {{MultiplyInt $PVCBoundTime 2}}s
# Create Pods
- measurements:
- Identifier: PodStartupLatency
Method: PodStartupLatency
Params:
action: start
labelSelector: group = test-pod
threshold: {{$PVCBoundTime}}s
- phases:
- namespaceRange:
min: 1
max: {{$namespaces}}
replicasPerNamespace: {{$podsPerNamespace}}
tuningSet: UniformQPS
objectBundle:
- basename: pod
objectTemplatePath: pod.yaml
templateFillMap:
PVCsPerPod: {{$PVC_PER_POD}}
- measurements:
- Identifier: WaitForRunningPVCOwningPods
Method: WaitForRunningPods
Params:
desiredPodCount: {{MultiplyInt $podsPerNamespace $namespaces}}
apiVersion: v1
labelSelector: group = test-pod
timeout: {{MultiplyInt $POD_STARTUP_SLO 2}}s
- measurements:
- Identifier: PodStartupLatency
Method: PodStartupLatency
Params:
action: gather
# Delete Resources
- phases:
- namespaceRange:
min: 1
max: {{$namespaces}}
replicasPerNamespace: 0
tuningSet: Sequence
objectBundle:
- basename: {{$TEST_NAME}}-pod
objectTemplatePath: pod.yaml
- namespaceRange:
min: 1
max: {{$namespaces}}
replicasPerNamespace: 0
tuningSet: Sequence
objectBundle:
- basename: {{$TEST_NAME}}-pvc
objectTemplatePath: pvc.yaml
# Collect measurements
- measurements:
- Identifier: APIResponsiveness
Method: APIResponsiveness
Params:
action: gather
- Identifier: APIResponsivenessPrometheus
Method: APIResponsivenessPrometheus
Params:
action: gather
- Identifier: TestMetrics
Method: TestMetrics
Params:
action: gather
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: v1
kind: Pod
metadata:
name: {{.Name}}
labels:
group: test-pod
spec:
containers:
- image: k8s.gcr.io/pause:3.1
imagePullPolicy: IfNotPresent
name: {{.Name}}
volumeMounts:
{{range $volumeIndex, $vol := Seq .PVCsPerPod}}
- mountPath: /pvc-{{$volumeIndex}}
name: pod-pvc-{{$volumeIndex}}
{{end}}
volumes:
{{$PVCInitialIndex := MultiplyInt .Index .PVCsPerPod}}
{{range $volumeIndex, $vol := Seq .PVCsPerPod}}
- name: pod-pvc-{{$volumeIndex}}
persistentVolumeClaim:
claimName: pvc-{{AddInt $PVCInitialIndex $volumeIndex}}
readOnly: false
{{end}}
# Add not-ready/unreachable tolerations for 15 minutes so that node
# failure doesn't trigger pod deletion.
tolerations:
- key: "node.kubernetes.io/not-ready"
operator: "Exists"
effect: "NoExecute"
tolerationSeconds: 900
- key: "node.kubernetes.io/unreachable"
operator: "Exists"
effect: "NoExecute"
tolerationSeconds: 900
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{.Name}}
labels:
group: test-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{.PVCSize}}
persistentVolumeReclaimPolicy: Delete
volumeBindingMode: Immediate

0 comments on commit b6f9857

Please sign in to comment.