Skip to content

Commit f81de67

Browse files
committed
add changes requested
1 parent feeec15 commit f81de67

10 files changed

Lines changed: 35 additions & 155 deletions

helm/defectdojo/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,6 @@ A Helm chart for Kubernetes to install DefectDojo
529529
| celery.beat.affinity | object | `{}` | |
530530
| celery.beat.annotations | object | `{}` | Annotations for the Celery beat deployment. |
531531
| celery.beat.automountServiceAccountToken | bool | `false` | |
532-
| celery.beat.autoscaling | object | `{"autoscaleBehavior":{},"enabled":false,"maxReplicas":5,"minReplicas":2,"targetCPUUtilizationPercentage":80,"targetMemoryUtilizationPercentage":80}` | Autoscaling configuration for Celery beat deployment. |
533532
| celery.beat.containerSecurityContext | object | `{}` | Container security context for the Celery beat containers. |
534533
| celery.beat.extraEnv | list | `[]` | Additional environment variables injected to Celery beat containers. |
535534
| celery.beat.extraInitContainers | list | `[]` | A list of additional initContainers to run before celery beat containers. |
@@ -539,7 +538,6 @@ A Helm chart for Kubernetes to install DefectDojo
539538
| celery.beat.livenessProbe | object | `{}` | Enable liveness probe for Celery beat container. ``` exec: command: - bash - -c - celery -A dojo inspect ping -t 5 initialDelaySeconds: 30 periodSeconds: 60 timeoutSeconds: 10 ``` |
540539
| celery.beat.nodeSelector | object | `{}` | |
541540
| celery.beat.podAnnotations | object | `{}` | Annotations for the Celery beat pods. |
542-
| celery.beat.podDisruptionBudget | object | `{"enabled":false,"minAvailable":"50%","unhealthyPodEvictionPolicy":"AlwaysAllow"}` | Configure pod disruption budgets for Celery beat ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
543541
| celery.beat.podSecurityContext | object | `{}` | Pod security context for the Celery beat pods. |
544542
| celery.beat.readinessProbe | object | `{}` | Enable readiness probe for Celery beat container. |
545543
| celery.beat.replicas | int | `1` | |
@@ -564,7 +562,7 @@ A Helm chart for Kubernetes to install DefectDojo
564562
| celery.worker.image | object | `{"digest":"","registry":"","repository":"","tag":""}` | If empty, uses values from images.django.image |
565563
| celery.worker.livenessProbe | object | `{}` | Enable liveness probe for Celery worker containers. ``` exec: command: - bash - -c - celery -A dojo inspect ping -t 5 initialDelaySeconds: 30 periodSeconds: 60 timeoutSeconds: 10 ``` |
566564
| celery.worker.nodeSelector | object | `{}` | |
567-
| celery.worker.podAnnotations | object | `{}` | Annotations for the Celery beat pods. |
565+
| celery.worker.podAnnotations | object | `{}` | Annotations for the Celery worker pods. |
568566
| celery.worker.podDisruptionBudget | object | `{"enabled":false,"minAvailable":"50%","unhealthyPodEvictionPolicy":"AlwaysAllow"}` | Configure pod disruption budgets for Celery worker ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
569567
| celery.worker.podSecurityContext | object | `{}` | Pod security context for the Celery worker pods. |
570568
| celery.worker.readinessProbe | object | `{}` | Enable readiness probe for Celery worker container. |
@@ -574,6 +572,7 @@ A Helm chart for Kubernetes to install DefectDojo
574572
| celery.worker.resources.requests.cpu | string | `"100m"` | |
575573
| celery.worker.resources.requests.memory | string | `"128Mi"` | |
576574
| celery.worker.startupProbe | object | `{}` | Enable startup probe for Celery worker container. |
575+
| celery.worker.terminationGracePeriodSeconds | int | `300` | |
577576
| celery.worker.tolerations | list | `[]` | |
578577
| cloudsql | object | `{"containerSecurityContext":{},"enable_iam_login":false,"enabled":false,"extraEnv":[],"extraVolumeMounts":[],"image":{"pullPolicy":"IfNotPresent","repository":"gcr.io/cloudsql-docker/gce-proxy","tag":"1.37.9"},"instance":"","resources":{},"use_private_ip":false,"verbose":true}` | Google CloudSQL support in GKE via gce-proxy |
579578
| cloudsql.containerSecurityContext | object | `{}` | Optional: security context for the CloudSQL proxy container. |
@@ -633,6 +632,7 @@ A Helm chart for Kubernetes to install DefectDojo
633632
| django.service.annotations | object | `{}` | |
634633
| django.service.type | string | `""` | |
635634
| django.strategy | object | `{}` | |
635+
| django.terminationGracePeriodSeconds | int | `60` | |
636636
| django.tolerations | list | `[]` | |
637637
| django.uwsgi.appSettings.maxFd | int | `0` | Use this value to set the maximum number of file descriptors. If set to 0 will be detected by uwsgi e.g. 102400 |
638638
| django.uwsgi.appSettings.processes | int | `4` | |

helm/defectdojo/templates/celery-beat-hpa.yaml

Lines changed: 0 additions & 51 deletions
This file was deleted.

helm/defectdojo/templates/celery-beat-pdb.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.

helm/defectdojo/templates/celery-worker-deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ spec:
170170
affinity:
171171
{{- toYaml . | nindent 8 }}
172172
{{- end }}
173+
{{- with .Values.celery.worker.terminationGracePeriodSeconds }}
174+
terminationGracePeriodSeconds:
175+
{{- toYaml . | nindent 8 }}
176+
{{- end }}
173177
{{- with .Values.celery.worker.tolerations }}
174178
tolerations:
175179
{{- toYaml . | nindent 8 }}

helm/defectdojo/templates/celery-worker-pdb.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .Values.celery.worker.podDisruptionBudget.enabled }}
1+
{{- if and .Values.celery.worker.podDisruptionBudget.enabled (or (gt (int .Values.celery.worker.replicas) 1) .Values.celery.worker.autoscaling.enabled) }}
22
{{- $fullName := include "defectdojo.fullname" . -}}
33
apiVersion: policy/v1
44
kind: PodDisruptionBudget
@@ -24,7 +24,7 @@ metadata:
2424
spec:
2525
selector:
2626
matchLabels:
27-
app.kubernetes.io/name: {{ .Release.Name }}
27+
app.kubernetes.io/name: {{ include "defectdojo.name" . }}
2828
defectdojo.org/component: celery
2929
defectdojo.org/subcomponent: worker
3030
{{ toYaml (omit .Values.celery.worker.podDisruptionBudget "enabled" ) | indent 2 }}

helm/defectdojo/templates/django-deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,10 @@ spec:
372372
affinity:
373373
{{- toYaml . | nindent 8 }}
374374
{{- end }}
375+
{{- with .Values.django.terminationGracePeriodSeconds }}
376+
terminationGracePeriodSeconds:
377+
{{- toYaml . | nindent 8 }}
378+
{{- end }}
375379
{{- with .Values.django.tolerations }}
376380
tolerations:
377381
{{- toYaml . | nindent 8 }}

helm/defectdojo/templates/django-hpa.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
apiVersion: autoscaling/v2
44
kind: HorizontalPodAutoscaler
55
metadata:
6-
{{- if or .Values.extraAnnotations .Values.django.autoscaling.annotations }}
6+
{{- with mergeOverwrite dict .Values.extraAnnotations .Values.django.annotations }}
77
annotations:
8-
{{- range $key, $value := .Values.extraAnnotations }}
8+
{{- range $key, $value := . }}
99
{{ $key }}: {{ quote $value }}
10-
{{- end }}
11-
{{- range $key, $value := .Values.django.annotations }}
12-
{{ $key }}: {{ quote $value }}
13-
{{- end }}
10+
{{- end }}
1411
{{- end }}
1512
name: {{ $fullName }}-django
1613
namespace: {{ .Release.Namespace }}
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
{{- if .Values.django.podDisruptionBudget.enabled }}
1+
{{- if and .Values.django.podDisruptionBudget.enabled (or (gt (int .Values.django.replicaCount) 1) .Values.django.autoscaling.enabled) }}
22
{{- $fullName := include "defectdojo.fullname" . -}}
33
apiVersion: policy/v1
44
kind: PodDisruptionBudget
55
metadata:
6-
{{- if or .Values.extraAnnotations .Values.django.podDisruptionBudget.annotations }}
6+
{{- with mergeOverwrite dict .Values.extraAnnotations .Values.django.annotations }}
77
annotations:
8-
{{- range $key, $value := .Values.extraAnnotations }}
8+
{{- range $key, $value := . }}
99
{{ $key }}: {{ quote $value }}
10-
{{- end }}
11-
{{- range $key, $value := .Values.django.annotations }}
12-
{{ $key }}: {{ quote $value }}
13-
{{- end }}
10+
{{- end }}
1411
{{- end }}
1512
labels:
1613
defectdojo.org/component: django
@@ -26,7 +23,7 @@ metadata:
2623
spec:
2724
selector:
2825
matchLabels:
29-
app.kubernetes.io/name: {{ .Release.Name }}
26+
app.kubernetes.io/name: {{ include "defectdojo.name" . }}
3027
defectdojo.org/component: django
3128
{{ toYaml (omit .Values.django.podDisruptionBudget "enabled" ) | indent 2 }}
3229
{{- end }}

helm/defectdojo/values.schema.json

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -55,30 +55,6 @@
5555
"automountServiceAccountToken": {
5656
"type": "boolean"
5757
},
58-
"autoscaling": {
59-
"description": "Autoscaling configuration for Celery beat deployment.",
60-
"type": "object",
61-
"properties": {
62-
"autoscaleBehavior": {
63-
"type": "object"
64-
},
65-
"enabled": {
66-
"type": "boolean"
67-
},
68-
"maxReplicas": {
69-
"type": "integer"
70-
},
71-
"minReplicas": {
72-
"type": "integer"
73-
},
74-
"targetCPUUtilizationPercentage": {
75-
"type": "integer"
76-
},
77-
"targetMemoryUtilizationPercentage": {
78-
"type": "integer"
79-
}
80-
}
81-
},
8258
"containerSecurityContext": {
8359
"description": "Container security context for the Celery beat containers.",
8460
"type": "object"
@@ -128,21 +104,6 @@
128104
"description": "Annotations for the Celery beat pods.",
129105
"type": "object"
130106
},
131-
"podDisruptionBudget": {
132-
"description": "Configure pod disruption budgets for Celery beat ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget",
133-
"type": "object",
134-
"properties": {
135-
"enabled": {
136-
"type": "boolean"
137-
},
138-
"minAvailable": {
139-
"type": "string"
140-
},
141-
"unhealthyPodEvictionPolicy": {
142-
"type": "string"
143-
}
144-
}
145-
},
146107
"podSecurityContext": {
147108
"description": "Pod security context for the Celery beat pods.",
148109
"type": "object"
@@ -288,7 +249,7 @@
288249
"type": "object"
289250
},
290251
"podAnnotations": {
291-
"description": "Annotations for the Celery beat pods.",
252+
"description": "Annotations for the Celery worker pods.",
292253
"type": "object"
293254
},
294255
"podDisruptionBudget": {
@@ -348,6 +309,10 @@
348309
"description": "Enable startup probe for Celery worker container.",
349310
"type": "object"
350311
},
312+
"terminationGracePeriodSeconds": {
313+
"description": "Termination grace period seconds for Celery worker pods.",
314+
"type": "integer"
315+
},
351316
"tolerations": {
352317
"type": "array"
353318
}
@@ -737,6 +702,10 @@
737702
"strategy": {
738703
"type": "object"
739704
},
705+
"terminationGracePeriodSeconds": {
706+
"description": "Termination grace period seconds for django pods.",
707+
"type": "integer"
708+
},
740709
"tolerations": {
741710
"type": "array"
742711
},

helm/defectdojo/values.yaml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,6 @@ celery:
221221
repository: ""
222222
tag: ""
223223
digest: ""
224-
# -- Autoscaling configuration for Celery beat deployment.
225-
autoscaling:
226-
enabled: false
227-
minReplicas: 2
228-
maxReplicas: 5
229-
targetCPUUtilizationPercentage: 80
230-
targetMemoryUtilizationPercentage: 80
231-
autoscaleBehavior: {}
232224
automountServiceAccountToken: false
233225
# -- Annotations for the Celery beat deployment.
234226
annotations: {}
@@ -259,11 +251,6 @@ celery:
259251
nodeSelector: {}
260252
# -- Annotations for the Celery beat pods.
261253
podAnnotations: {}
262-
# -- Configure pod disruption budgets for Celery beat ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
263-
podDisruptionBudget:
264-
enabled: false
265-
minAvailable: 50%
266-
unhealthyPodEvictionPolicy: AlwaysAllow
267254
# -- Pod security context for the Celery beat pods.
268255
podSecurityContext: {}
269256
# -- Enable readiness probe for Celery beat container.
@@ -322,7 +309,7 @@ celery:
322309
# ```
323310
livenessProbe: {}
324311
nodeSelector: {}
325-
# -- Annotations for the Celery beat pods.
312+
# -- Annotations for the Celery worker pods.
326313
podAnnotations: {}
327314
# -- Configure pod disruption budgets for Celery worker ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
328315
podDisruptionBudget:
@@ -343,6 +330,8 @@ celery:
343330
memory: 512Mi
344331
# -- Enable startup probe for Celery worker container.
345332
startupProbe: {}
333+
# -- Termination grace period seconds for Celery worker pods.
334+
terminationGracePeriodSeconds: 300
346335
tolerations: []
347336
appSettings:
348337
# -- Performance improved celery worker config when needing to deal with a lot of findings (e.g deduplication ops)
@@ -421,6 +410,8 @@ django:
421410
unhealthyPodEvictionPolicy: AlwaysAllow
422411
replicas: 1
423412
strategy: {}
413+
# -- Termination grace period seconds for django pods.
414+
terminationGracePeriodSeconds: 60
424415
tolerations: []
425416
uwsgi:
426417
# -- If empty, uses values from images.django.image

0 commit comments

Comments
 (0)