Skip to content

Commit 5256328

Browse files
brendanhoyt-sketchBrendan Hoytj2fw
authored
Add updateStrategy (#21)
Adds updateStrategy as a helm chart value. --------- Co-authored-by: Brendan Hoyt <brendan.hoyt@Brendans-MacBook-Pro.local> Co-authored-by: Jeff W <233818084+j2fw@users.noreply.github.com>
1 parent 8ed5899 commit 5256328

4 files changed

Lines changed: 47 additions & 1 deletion

File tree

trufflehog/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
apiVersion: v2
22
name: trufflehog
33
description: A Helm chart for TruffleHog Enterprise
4-
version: 0.3.0
4+
version: 0.4.0

trufflehog/templates/deployment.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ metadata:
99
{{- include "trufflehog.annotations" . | nindent 4 }}
1010
spec:
1111
replicas: {{ .Values.replicaCount }}
12+
{{- with .Values.strategy }}
13+
strategy:
14+
type: {{ .type }}
15+
{{- if and (eq .type "RollingUpdate") .rollingUpdate }}
16+
rollingUpdate:
17+
{{- toYaml .rollingUpdate | nindent 6 }}
18+
{{- end }}
19+
{{- end }}
1220
selector:
1321
matchLabels:
1422
{{- include "trufflehog.selectorLabels" . | nindent 6 }}

trufflehog/values.schema.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,35 @@
1010
"default": 1,
1111
"minimum": 1
1212
},
13+
"strategy": {
14+
"type": "object",
15+
"description": "Deployment update strategy configuration",
16+
"properties": {
17+
"type": {
18+
"type": "string",
19+
"description": "Deployment strategy type",
20+
"enum": ["RollingUpdate", "Recreate"],
21+
"default": "RollingUpdate"
22+
},
23+
"rollingUpdate": {
24+
"type": "object",
25+
"description": "Rolling update configuration, only used when type is RollingUpdate",
26+
"properties": {
27+
"maxSurge": {
28+
"type": ["string", "integer"],
29+
"description": "Maximum number of pods that can be created over the desired number of pods (absolute number or percentage)",
30+
"default": "25%"
31+
},
32+
"maxUnavailable": {
33+
"type": ["string", "integer"],
34+
"description": "Maximum number of pods that can be unavailable during the update (absolute number or percentage)",
35+
"default": "25%"
36+
}
37+
}
38+
}
39+
},
40+
"required": ["type"]
41+
},
1342
"image": {
1443
"type": "object",
1544
"description": "Container image configuration",

trufflehog/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
## Sets the number of pod replicas.
22
replicaCount: 1
33

4+
## Controls how pods are replaced during upgrades.
5+
## RollingUpdate: gradually replaces pods, keeping the service available.
6+
## Recreate: terminates all existing pods before creating new ones (causes downtime).
7+
strategy:
8+
type: RollingUpdate
9+
rollingUpdate:
10+
maxSurge: "25%"
11+
maxUnavailable: "25%"
12+
413
image:
514
repository: us-docker.pkg.dev/thog-artifacts/public/scanner
615
tag: latest

0 commit comments

Comments
 (0)