You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* replace site url variable name to match values.yaml style
* rework app settings block in values.yaml to match file style
* rework uwsgi debug variable setting
* fix configmap boolean value to string
* remove unneded variable
* update release documentation
* fix variable name
* move documentation to the next realease notes
* change description in the changelog
* remove empty line at the end of file
Copy file name to clipboardExpand all lines: docs/content/en/getting_started/upgrading/2.38.md
+23-2Lines changed: 23 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,27 @@
2
2
title: 'Upgrading to DefectDojo Version 2.38.x'
3
3
toc_hide: true
4
4
weight: -20240805
5
-
description: No special instructions.
5
+
description: Breaking Change for HELM deployments
6
6
---
7
-
There are no special instructions for upgrading to 2.38.x. Check the [Release Notes](https://github.com/DefectDojo/django-DefectDojo/releases/tag/2.38.0) for the contents of the release.
7
+
8
+
**Breaking Change**
9
+
10
+
Previous HELM `values.yaml` file was not following the official HELM best practicies on key naming - [https://helm.sh/docs/chart_best_practices/values/#naming-conventions](https://helm.sh/docs/chart_best_practices/values/#naming-conventions)
11
+
12
+
The following `snake_case` keys are replaced with `camelCase` keys in the `values.yaml`:
13
+
14
+
-`site_url` is replaced with `siteUrl`
15
+
-`celery.worker.app_settings` block is replaced with `celery.worker.appSettings`. In this block:
16
+
17
+
-`pool_type` is replaced with `poolType`
18
+
-`autoscale_min` is replaced with `autoscaleMin`
19
+
-`autoscale_max` is replaced with `autoscaleMax`
20
+
-`prefetch_multiplier` is replaced with `prefetchMultiplier`
21
+
22
+
-`django.uwsgi.app_settings` block is changed to `django.uwsgi.appSettings`. In this block:
23
+
24
+
-`max_fd` is changed to `maxFd`
25
+
26
+
-`django.uwsgi.enable_debug` is changed to `django.uwsgi.enableDebug`
27
+
28
+
There are no other special instructions for upgrading to 2.38.x. Check the [Release Notes](https://github.com/DefectDojo/django-DefectDojo/releases/tag/2.38.0) for the contents of the release.
DD_CELERY_BROKER_SCHEME: {{ if eq .Values.celery.broker "redis" }}{{ template "redis.scheme" . }}{{ end }}
19
19
DD_CELERY_BROKER_USER: ''
20
20
DD_CELERY_BROKER_HOST: {{ if eq .Values.celery.broker "redis" }}{{ template "redis.hostname" . }}{{ end }}
21
21
DD_CELERY_BROKER_PORT: '{{ if eq .Values.celery.broker "redis" }}{{ .Values.redis.master.service.ports.redis | default "6379" }}{{ end }}'
22
22
DD_CELERY_BROKER_PARAMS: '{{ if eq .Values.celery.broker "redis" }}{{- if .Values.redis.transportEncryption.enabled -}}{{ .Values.redis.transportEncryption.params | default "ssl_cert_reqs=optional" }}{{ end }}{{ end }}'
DD_CELERY_WORKER_AUTOSCALE_MIN: '{{ if eq .Values.celery.worker.appSettings.poolType "prefork" }}{{ .Values.celery.worker.appSettings.autoscaleMin | default "2" }}{{ end }}'
27
+
DD_CELERY_WORKER_AUTOSCALE_MAX: '{{ if eq .Values.celery.worker.appSettings.poolType "prefork" }}{{ .Values.celery.worker.appSettings.autoscaleMax | default "8" }}{{ end }}'
28
+
DD_CELERY_WORKER_CONCURRENCY: '{{ if eq .Values.celery.worker.appSettings.poolType "prefork" }}{{ .Values.celery.worker.appSettings.concurrency | default "8" }}{{ end }}'
29
+
DD_CELERY_WORKER_PREFETCH_MULTIPLIER: '{{ if eq .Values.celery.worker.appSettings.poolType "prefork" }}{{ .Values.celery.worker.appSettings.prefetchMultiplier | default "128" }}{{ end }}'
30
30
DD_DATABASE_ENGINE: django.db.backends.{{ if eq .Values.database "postgresql" }}postgresql{{ end }}{{ if eq .Values.database "postgresqlha" }}postgresql{{ end }}
31
31
DD_DATABASE_HOST: {{ if eq .Values.database "postgresql" }}{{ template "postgresql.hostname" . }}{{ end }}{{ if eq .Values.database "postgresqlha" }}{{ template "postgresqlha.hostname" . }}{{ end }}
32
32
DD_DATABASE_PORT: '{{ if eq .Values.database "postgresql" }}{{ .Values.postgresql.primary.service.ports.postgresql }}{{ end }}{{ if eq .Values.database "postgresqlha" }}{{ .Values.postgresqlha.service.ports.postgresql }}{{ end }}'
Copy file name to clipboardExpand all lines: readme-docs/KUBERNETES.md
+34-15Lines changed: 34 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,11 @@ and [Helm](https://helm.sh/) can be installed locally by following
10
10
this [guide](https://helm.sh/docs/using_helm/#installing-helm).
11
11
12
12
## Supported Kubernetes Versions
13
+
13
14
The tests cover the deployment on the lastest [kubernetes version](https://kubernetes.io/releases/) and the oldest supported [version from AWS](https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html#available-versions). The assumption is that version in between do not have significant differences. Current tested versions can looks up in the [github k8s workflow](https://github.com/DefectDojo/django-DefectDojo/blob/master/.github/workflows/k8s-tests.yml).
14
15
15
16
## Helm chart
17
+
16
18
Starting with version 1.14.0, a helm chart will be pushed onto the `helm-charts` branch during the release process. Don't look for a chart museum, we're leveraging the "raw" capabilities of GitHub at this time.
It usually takes up to a minute for the services to startup and the
97
-
status of the containers can be viewed by starting up ```minikube dashboard```.
108
+
status of the containers can be viewed by starting up `minikube dashboard`.
98
109
Note: If the containers are not cached locally the services will start once the
99
110
containers have been pulled locally.
100
111
@@ -134,15 +145,18 @@ If testing containers locally, then set the imagePullPolicy to Never,
134
145
which ensures containers are not pulled from Docker hub.
135
146
136
147
Use the same commands as before but add:
148
+
137
149
```zsh
138
150
--set imagePullPolicy=Never
139
151
```
140
152
141
153
### Installing from a private registry
154
+
142
155
If you have stored your images in a private registry, you can install defectdojo chart with (helm 3).
143
156
144
157
- First create a secret named "defectdojoregistrykey" based on the credentials that can pull from the registry: see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
145
158
- Then install the chart with the same commands as before but adding:
159
+
146
160
```zsh
147
161
--set repositoryPrefix=<myregistry.com/path> \
148
162
--set imagePullSecrets=defectdojoregistrykey
@@ -168,21 +182,23 @@ You can set breakpoints in code that is handled by uWSGI. The feature is meant t
168
182
169
183
The port is currently hard-coded to 3000.
170
184
171
-
* In `values.yaml`, ensure the value for `enable_ptvsd` is set to `true` (the default is `false`). Make sure the change is taken into account in your deployment.
172
-
* Have `DD_DEBUG` set to `True`.
173
-
* Port forward port 3000 to the pod, such as `kubectl port-forward defectdojo-django-7886f49466-7cwm7 3000`.
185
+
- In `values.yaml`, ensure the value for `enable_ptvsd` is set to `true` (the default is `false`). Make sure the change is taken into account in your deployment.
186
+
- Have `DD_DEBUG` set to `True`.
187
+
- Port forward port 3000 to the pod, such as `kubectl port-forward defectdojo-django-7886f49466-7cwm7 3000`.
174
188
175
189
### Upgrade the chart
190
+
176
191
If you want to change kubernetes configuration of use an updated docker image (evolution of defectDojo code), upgrade the application:
In case of issue or in any other situation where you need to re-install the chart, you can do it and re-use the same secrets.
187
203
188
204
**Note: With postgresql you'll keep the same database (more information below)**
@@ -229,7 +245,6 @@ If you want to encrypt the traffic to the nginx server you can use the option `-
229
245
230
246
Be aware that the traffic to the database and celery broker are unencrypted at the moment.
231
247
232
-
233
248
### Media persistent volume
234
249
235
250
By default, DefectDojo helm installation doesn't support persistent storage for storing images (dynamically uploaded by users). By default, it uses emptyDir, which is ephemeral by its nature and doesn't support multiple replicas of django pods, so should not be in use for production.
@@ -245,7 +260,7 @@ mediaPersistentVolume:
245
260
type: pvc
246
261
# there are two options to create pvc 1) when you want the chart to create pvc for you, set django.mediaPersistentVolume.persistentVolumeClaim.create to true and do not specify anything for django.mediaPersistentVolume.PersistentVolumeClaim.name 2) when you want to create pvc outside the chart, pass the pvc name via django.mediaPersistentVolume.PersistentVolumeClaim.name and ensure django.mediaPersistentVolume.PersistentVolumeClaim.create is set to false
247
262
persistentVolumeClaim:
248
-
create: true
263
+
create: true
249
264
name:
250
265
size: 5Gi
251
266
accessModes:
@@ -327,10 +342,12 @@ It's possible to enable Nginx prometheus exporter by setting `--set monitoring.e
327
342
## Useful stuff
328
343
329
344
### Setting your own domain
330
-
The `site_url` in values.yaml controls what domain is configured in Django, and also what the celery workers will put as links in Jira tickets for example.
345
+
346
+
The `siteUrl` in values.yaml controls what domain is configured in Django, and also what the celery workers will put as links in Jira tickets for example.
331
347
Set this to your `https://<yourdomain>` in values.yaml
332
348
333
349
### Multiple Hostnames
350
+
334
351
Django requires a list of all hostnames that are valid for requests.
335
352
You can add additional hostnames via helm or values file as an array.
336
353
This helps if you have a local service submitting reports to defectDojo using
@@ -347,30 +364,29 @@ This will also work with shell inserted variables:
347
364
You will still need to set a host value as well.
348
365
349
366
### Using an existing redis setup with redis-sentinel
367
+
350
368
If you want to use a redis-sentinel setup as the Celery broker, you will need to set the following.
351
369
352
370
1. Set redis.scheme to "sentinel" in values.yaml
353
371
2. Set two additional extraEnv vars specifying the sentinel master name and port in values.yaml
354
372
355
373
```yaml
356
374
celery:
357
-
broker: "redis"
375
+
broker: 'redis'
358
376
359
377
redis:
360
-
redisServer: "PutYourRedisSentinelAddress"
361
-
scheme: "sentinel"
378
+
redisServer: 'PutYourRedisSentinelAddress'
379
+
scheme: 'sentinel'
362
380
363
381
extraEnv:
364
382
- name: DD_CELERY_BROKER_TRANSPORT_OPTIONS
365
383
value: '{"master_name": "mymaster"}'
366
384
- name: 'DD_CELERY_BROKER_PORT'
367
-
value: "26379"
385
+
value: '26379'
368
386
```
369
387
370
-
371
-
372
-
373
388
### kubectl commands
389
+
374
390
```zsh
375
391
# View logs of a specific pod
376
392
kubectl logs $(kubectl get pod --selector=defectdojo.org/component=${POD} \
@@ -388,12 +404,15 @@ kubectl exec -it $(kubectl get pod --selector=defectdojo.org/component=${POD} \
388
404
```
389
405
390
406
### Clean up Kubernetes
407
+
391
408
Helm >= v3
409
+
392
410
```
393
411
helm uninstall defectdojo
394
412
```
395
413
396
414
To remove persistent objects not removed by uninstall (this will remove any database):
0 commit comments