Skip to content

Commit

Permalink
Merge pull request #792 from mm4tt/load_daemonsets
Browse files Browse the repository at this point in the history
Extend load test to cover DaemonSets
  • Loading branch information
k8s-ci-robot committed Sep 12, 2019
2 parents 331d2e3 + 347e070 commit e25ec1a
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 1 deletion.
65 changes: 64 additions & 1 deletion clusterloader2/testing/load/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
{{$ENABLE_CHAOSMONKEY := DefaultParam .ENABLE_CHAOSMONKEY false}}
{{$ENABLE_PROMETHEUS_API_RESPONSIVENESS := DefaultParam .ENABLE_PROMETHEUS_API_RESPONSIVENESS false}}
{{$ENABLE_CONFIGMAPS := DefaultParam .ENABLE_CONFIGMAPS false}}
{{$ENABLE_DAEMONSETS := DefaultParam .ENABLE_DAEMONSETS false}}
{{$ENABLE_SECRETS := DefaultParam .ENABLE_SECRETS false}}
{{$ENABLE_STATEFULSETS := DefaultParam .ENABLE_STATEFULSETS false}}
#Variables
Expand Down Expand Up @@ -142,9 +143,31 @@ steps:
labelSelector: group = load
operationTimeout: 15m
{{end}}
{{if $ENABLE_DAEMONSETS}}
- Identifier: WaitForRunningDaemonSets
Method: WaitForControlledPodsRunning
Params:
action: start
apiVersion: apps/v1
kind: DaemonSet
labelSelector: group = load
operationTimeout: 15m
{{end}}

- name: Creating objects
phases:
{{if $ENABLE_DAEMONSETS}}
- namespaceRange:
min: 1
max: 1
replicasPerNamespace: 1
tuningSet: RandomizedSaturationTimeLimited
objectBundle:
- basename: daemonset
objectTemplatePath: daemonset.yaml
templateFillMap:
Image: k8s.gcr.io/pause:3.0
{{end}}
- namespaceRange:
min: 1
max: {{$namespaces}}
Expand Down Expand Up @@ -246,8 +269,14 @@ steps:
Params:
action: gather
{{end}}
{{if $ENABLE_DAEMONSETS}}
- Identifier: WaitForRunningDaemonSets
Method: WaitForControlledPodsRunning
Params:
action: gather
{{end}}

- name: Scaling objects
- name: Scaling and updating objects
phases:
- namespaceRange:
min: 1
Expand Down Expand Up @@ -309,6 +338,18 @@ steps:
ReplicasMin: {{MultiplyInt $MEDIUM_GROUP_SIZE 0.5}}
ReplicasMax: {{MultiplyInt $MEDIUM_GROUP_SIZE 1.5}}
{{end}}
{{if $ENABLE_DAEMONSETS}}
- namespaceRange:
min: 1
max: 1
replicasPerNamespace: 1
tuningSet: RandomizedSaturationTimeLimited
objectBundle:
- basename: daemonset
objectTemplatePath: daemonset.yaml
templateFillMap:
Image: k8s.gcr.io/pause:3.1
{{end}}

- name: Waiting for objects to become scaled
measurements:
Expand All @@ -322,6 +363,12 @@ steps:
Params:
action: gather
{{end}}
{{if $ENABLE_DAEMONSETS}}
- Identifier: WaitForRunningDaemonSets
Method: WaitForControlledPodsRunning
Params:
action: gather
{{end}}

- name: Deleting objects
phases:
Expand Down Expand Up @@ -395,6 +442,16 @@ steps:
- basename: medium-statefulset
objectTemplatePath: statefulset_service.yaml
{{end}}
{{if $ENABLE_DAEMONSETS}}
- namespaceRange:
min: 1
max: 1
replicasPerNamespace: 0
tuningSet: RandomizedSaturationTimeLimited
objectBundle:
- basename: daemonset
objectTemplatePath: daemonset.yaml
{{end}}

- name: Waiting for pods to be deleted
measurements:
Expand All @@ -408,6 +465,12 @@ steps:
Params:
action: gather
{{end}}
{{if $ENABLE_DAEMONSETS}}
- Identifier: WaitForRunningDaemonSets
Method: WaitForControlledPodsRunning
Params:
action: gather
{{end}}

- name: Deleting SVCs
phases:
Expand Down
40 changes: 40 additions & 0 deletions clusterloader2/testing/load/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{$Image := DefaultParam .Image "k8s.gcr.io/pause:3.1"}}

apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{.Name}}
labels:
group: load
spec:
updateStrategy:
rollingUpdate:
maxUnavailable: {{MaxInt 10 (DivideInt .Nodes 100)}} # 1% of nodes, but not less than 10
selector:
matchLabels:
name: {{.Name}}
template:
metadata:
labels:
group: load
name: {{.Name}}
spec:
containers:
- name: {{.Name}}
image: {{$Image}}
resources:
requests:
cpu: 10m
memory: "10M"
terminationGracePeriodSeconds: 1
# 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

0 comments on commit e25ec1a

Please sign in to comment.