Skip to content

Commit

Permalink
Added PDB for the loadtester
Browse files Browse the repository at this point in the history
Signed-off-by: Marcus Rodan <marcus.rodan@sinch.com>
  • Loading branch information
marcus-rodan-sinch committed Feb 18, 2021
1 parent fa33a3e commit 596bb64
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
10 changes: 5 additions & 5 deletions charts/loadtester/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Flagger load testing service

[Flagger's](https://github.com/fluxcd/flagger) load testing service is based on
[rakyll/hey](https://github.com/rakyll/hey) and
[Flagger's](https://github.com/fluxcd/flagger) load testing service is based on
[rakyll/hey](https://github.com/rakyll/hey) and
[bojand/ghz](https://github.com/bojand/ghz).
It can be used to generate HTTP and gRPC traffic during canary analysis when configured as a webhook.

Expand Down Expand Up @@ -50,7 +50,7 @@ Parameter | Description | Default
`image.pullPolicy` | Image pull policy | `IfNotPresent`
`image.tag` | Image tag | `<VERSION>`
`replicaCount` | Desired number of pods | `1`
`serviceAccountName` | Kubernetes service account name | `none`
`serviceAccountName` | Kubernetes service account name | `none`
`resources.requests.cpu` | CPU requests | `10m`
`resources.requests.memory` | Memory requests | `64Mi`
`tolerations` | List of node taints to tolerate | `[]`
Expand All @@ -70,6 +70,8 @@ Parameter | Description | Default
`podPriorityClassName` | PriorityClass name for pod priority configuration | ""
`securityContext.enabled` | Add securityContext to container | ""
`securityContext.context` | securityContext to add | ""
`podDisruptionBudget.enabled` | A PodDisruptionBudget will be created if `true` | `false`
`podDisruptionBudget.minAvailable` | The minimal number of available replicas that will be set in the PodDisruptionBudget | `1`

Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade`. For example,

Expand All @@ -87,5 +89,3 @@ helm install flagger/loadtester --name flagger-loadtester -f values.yaml
```

> **Tip**: You can use the default [values.yaml](values.yaml)

11 changes: 11 additions & 0 deletions charts/loadtester/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.podDisruptionBudget.enabled }}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: {{ include "loadtester.fullname" . }}
spec:
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "loadtester.name" . }}
{{- end }}
12 changes: 8 additions & 4 deletions charts/loadtester/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ podAnnotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8080"

podPriorityClassName: ""
podPriorityClassName: ""

logLevel: info
cmd:
Expand Down Expand Up @@ -62,15 +62,15 @@ appmesh:
- podinfo
- podinfo-canary

#Istio virtual service and gatway settings. TLS secrets should be in namespace before enbaled it. ( secret format loadtester.fullname )
#Istio virtual service and gatway settings. TLS secrets should be in namespace before enbaled it. ( secret format loadtester.fullname )
istio:
enabled: false
host: flagger-loadtester.flagger
gateway:
enabled: false
enabled: false
tls:
enabled: false
httpsRedirect: false
httpsRedirect: false

# when enabled, it will add a security context for the loadtester pod
securityContext:
Expand All @@ -79,3 +79,7 @@ securityContext:
readOnlyRootFilesystem: true
runAsUser: 100
runAsGroup: 101

podDisruptionBudget:
enabled: false
minAvailable: 1

0 comments on commit 596bb64

Please sign in to comment.