Skip to content

Commit ff2871e

Browse files
kiblikhblankenshipMaffooch
authored
feat(helm): Drop support for postgresql-ha (#12319)
* feat(psql-ha): Drop support for postgresql-ha * Update readme-docs/KUBERNETES.md Co-authored-by: Harold Blankenship <[email protected]> --------- Co-authored-by: Harold Blankenship <[email protected]> Co-authored-by: Cody Maffucci <[email protected]>
1 parent a403927 commit ff2871e

16 files changed

+28
-200
lines changed

.github/workflows/k8s-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ env:
1111
--set createRedisSecret=true \
1212
"
1313
HELM_PG_DATABASE_SETTINGS: " \
14-
--set database=postgresql \
1514
--set postgresql.enabled=true \
1615
--set createPostgresqlSecret=true \
1716
"

docs/content/en/open_source/upgrading/2.46.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ Before:
6363
"statistics": {
6464
"before": {},
6565
"delta": {
66-
"created": {},
67-
"closed": {},
68-
"reactivated": {},
69-
"left untouched": {}
66+
"created": {},
67+
"closed": {},
68+
"reactivated": {},
69+
"left untouched": {}
7070
},
7171
"after": {}
7272
}
@@ -76,10 +76,10 @@ After:
7676
"statistics": {
7777
"before": {},
7878
"delta": {
79-
"created": {},
80-
"closed": {},
81-
"reactivated": {},
82-
"untouched": {}
79+
"created": {},
80+
"closed": {},
81+
"reactivated": {},
82+
"untouched": {}
8383
},
8484
"after": {}
8585
}

docs/content/en/open_source/upgrading/2.47.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
title: 'Upgrading to DefectDojo Version 2.47.x'
33
toc_hide: true
44
weight: -20250505
5-
description: No special instructions.
5+
description: Drop support for PostgreSQL-HA in HELM
66
---
7+
### Drop support for PostgreSQL-HA in HELM
8+
9+
This release removes support for the PostgreSQL-HA (High Availability) Helm chart as a dependency in the DefectDojo Helm chart. Users relying on the PostgreSQL-HA Helm chart will need to transition to using the standard PostgreSQL configuration or an external PostgreSQL database.
10+
711
There are no special instructions for upgrading to 2.47.x. Check the [Release Notes](https://github.com/DefectDojo/django-DefectDojo/releases/tag/2.47.0) for the contents of the release.

helm/defectdojo/Chart.lock

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ dependencies:
22
- name: postgresql
33
repository: https://charts.bitnami.com/bitnami
44
version: 16.7.0
5-
- name: postgresql-ha
6-
repository: https://charts.bitnami.com/bitnami
7-
version: 9.4.11
85
- name: redis
96
repository: https://charts.bitnami.com/bitnami
107
version: 19.6.4

helm/defectdojo/Chart.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ dependencies:
1313
version: ~16.7.0
1414
repository: "https://charts.bitnami.com/bitnami"
1515
condition: postgresql.enabled
16-
- name: postgresql-ha
17-
version: ~9.4.0
18-
repository: "https://charts.bitnami.com/bitnami"
19-
alias: postgresqlha
20-
condition: postgresqlha.enabled
2116
- name: redis
2217
version: ~19.6.0
2318
repository: "https://charts.bitnami.com/bitnami"

helm/defectdojo/templates/_helpers.tpl

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ Create chart name and version as used by the chart label.
3636
Determine the hostname to use for PostgreSQL/Redis.
3737
*/}}
3838
{{- define "postgresql.hostname" -}}
39-
{{- if eq .Values.database "postgresql" -}}
4039
{{- if .Values.postgresql.enabled -}}
4140
{{- if eq .Values.postgresql.architecture "replication" -}}
4241
{{- printf "%s-%s-%s" .Release.Name "postgresql" .Values.postgresql.primary.name | trunc 63 | trimSuffix "-" -}}
@@ -47,16 +46,6 @@ Create chart name and version as used by the chart label.
4746
{{- printf "%s" .Values.postgresql.postgresServer -}}
4847
{{- end -}}
4948
{{- end -}}
50-
{{- end -}}
51-
{{- define "postgresqlha.hostname" -}}
52-
{{- if eq .Values.database "postgresqlha" -}}
53-
{{- if .Values.postgresqlha.enabled -}}
54-
{{- printf "%s-%s" .Release.Name "postgresqlha-pgpool" | trunc 63 | trimSuffix "-" -}}
55-
{{- else -}}
56-
{{- printf "%s" .Values.postgresqlha.postgresServer -}}
57-
{{- end -}}
58-
{{- end -}}
59-
{{- end -}}
6049
{{- define "redis.hostname" -}}
6150
{{- if eq .Values.celery.broker "redis" -}}
6251
{{- if .Values.redis.enabled -}}
@@ -161,13 +150,8 @@ Create chart name and version as used by the chart label.
161150
- name: DD_DATABASE_PASSWORD
162151
valueFrom:
163152
secretKeyRef:
164-
{{- if eq .Values.database "postgresql" }}
165-
name: {{ .Values.postgresql.auth.existingSecret | default "defectdojo-postgresql-specific" }}
166-
key: {{ .Values.postgresql.auth.secretKeys.userPasswordKey | default "postgresql-password" }}
167-
{{- else if eq .Values.database "postgresqlha" }}
168-
name: {{ .Values.postgresqlha.postgresql.existingSecret | default "defectdojo-postgresql-ha-specific" }}
169-
key: postgresql-postgres-password
170-
{{- end }}
153+
name: {{ .Values.postgresql.auth.existingSecret | default "defectdojo-postgresql-specific" }}
154+
key: {{ .Values.postgresql.auth.secretKeys.userPasswordKey | default "postgresql-password" }}
171155
{{- if .Values.extraEnv }}
172156
{{- toYaml .Values.extraEnv | nindent 2 }}
173157
{{- end }}

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ spec:
9696
command: ["/cloud_sql_proxy"]
9797
args:
9898
- "-verbose={{ .Values.cloudsql.verbose }}"
99-
{{- if eq .Values.database "postgresql" }}
10099
- "-instances={{ .Values.cloudsql.instance }}=tcp:{{ .Values.postgresql.primary.service.ports.postgresql }}"
101-
{{- end }}
102100
{{- if .Values.cloudsql.enable_iam_login }}
103101
- "-enable_iam_login"
104102
{{- end }}
@@ -157,13 +155,8 @@ spec:
157155
- name: DD_DATABASE_PASSWORD
158156
valueFrom:
159157
secretKeyRef:
160-
{{- if eq .Values.database "postgresql" }}
161-
name: {{ .Values.postgresql.auth.existingSecret | default "defectdojo-postgresql-specific" }}
162-
key: {{ .Values.postgresql.auth.secretKeys.userPasswordKey | default "postgresql-password" }}
163-
{{- else if eq .Values.database "postgresqlha" }}
164-
name: {{ .Values.postgresqlha.postgresql.existingSecret | default "defectdojo-postgresql-ha-specific" }}
165-
key: postgresql-postgres-password
166-
{{- end }}
158+
name: {{ .Values.postgresql.auth.existingSecret | default "defectdojo-postgresql-specific" }}
159+
key: {{ .Values.postgresql.auth.secretKeys.userPasswordKey | default "postgresql-password" }}
167160
- name: DD_SECRET_KEY
168161
valueFrom:
169162
secretKeyRef:

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ spec:
9494
command: ["/cloud_sql_proxy"]
9595
args:
9696
- "-verbose={{ .Values.cloudsql.verbose }}"
97-
{{- if eq .Values.database "postgresql" }}
9897
- "-instances={{ .Values.cloudsql.instance }}=tcp:{{ .Values.postgresql.primary.service.ports.postgresql }}"
99-
{{- end }}
10098
{{- if .Values.cloudsql.enable_iam_login }}
10199
- "-enable_iam_login"
102100
{{- end }}
@@ -152,13 +150,8 @@ spec:
152150
- name: DD_DATABASE_PASSWORD
153151
valueFrom:
154152
secretKeyRef:
155-
{{- if eq .Values.database "postgresql" }}
156-
name: {{ .Values.postgresql.auth.existingSecret | default "defectdojo-postgresql-specific" }}
157-
key: {{ .Values.postgresql.auth.secretKeys.userPasswordKey | default "postgresql-password" }}
158-
{{- else if eq .Values.database "postgresqlha" }}
159-
name: {{ .Values.postgresqlha.postgresql.existingSecret | default "defectdojo-postgresql-ha-specific" }}
160-
key: postgresql-postgres-password
161-
{{- end }}
153+
name: {{ .Values.postgresql.auth.existingSecret | default "defectdojo-postgresql-specific" }}
154+
key: {{ .Values.postgresql.auth.secretKeys.userPasswordKey | default "postgresql-password" }}
162155
- name: DD_SECRET_KEY
163156
valueFrom:
164157
secretKeyRef:

helm/defectdojo/templates/configmap.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ data:
3636
DD_CELERY_WORKER_AUTOSCALE_MAX: '{{ if eq .Values.celery.worker.appSettings.poolType "prefork" }}{{ .Values.celery.worker.appSettings.autoscaleMax | default "8" }}{{ end }}'
3737
DD_CELERY_WORKER_CONCURRENCY: '{{ if eq .Values.celery.worker.appSettings.poolType "prefork" }}{{ .Values.celery.worker.appSettings.concurrency | default "8" }}{{ end }}'
3838
DD_CELERY_WORKER_PREFETCH_MULTIPLIER: '{{ if eq .Values.celery.worker.appSettings.poolType "prefork" }}{{ .Values.celery.worker.appSettings.prefetchMultiplier | default "128" }}{{ end }}'
39-
DD_DATABASE_ENGINE: django.db.backends.{{ if eq .Values.database "postgresql" }}postgresql{{ end }}{{ if eq .Values.database "postgresqlha" }}postgresql{{ end }}
40-
DD_DATABASE_HOST: {{ if eq .Values.database "postgresql" }}{{ template "postgresql.hostname" . }}{{ end }}{{ if eq .Values.database "postgresqlha" }}{{ template "postgresqlha.hostname" . }}{{ end }}
41-
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 }}'
42-
DD_DATABASE_USER: {{ if eq .Values.database "postgresql" }}{{ .Values.postgresql.auth.username }}{{ end }}{{ if eq .Values.database "postgresqlha" }}{{ .Values.postgresqlha.postgresql.username }}{{ end }}
43-
DD_DATABASE_NAME: {{ if eq .Values.database "postgresql" }}{{ .Values.postgresql.auth.database }}{{ end }}{{ if eq .Values.database "postgresqlha" }}{{ .Values.postgresqlha.postgresql.database }}{{ end }}
39+
DD_DATABASE_ENGINE: django.db.backends.postgresql
40+
DD_DATABASE_HOST: {{ template "postgresql.hostname" . }}
41+
DD_DATABASE_PORT: '{{ .Values.postgresql.primary.service.ports.postgresql }}'
42+
DD_DATABASE_USER: {{ .Values.postgresql.auth.username }}
43+
DD_DATABASE_NAME: {{ .Values.postgresql.auth.database }}
4444
DD_INITIALIZE: '{{ .Values.initializer.run }}'
4545
DD_UWSGI_ENDPOINT: /run/defectdojo/uwsgi.sock
4646
DD_UWSGI_HOST: localhost

helm/defectdojo/templates/django-deployment.yaml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ spec:
116116
command: ["/cloud_sql_proxy"]
117117
args:
118118
- "-verbose={{ .Values.cloudsql.verbose }}"
119-
{{- if eq .Values.database "postgresql" }}
120119
- "-instances={{ .Values.cloudsql.instance }}=tcp:{{ .Values.postgresql.primary.service.ports.postgresql }}"
121-
{{- end }}
122120
{{- if .Values.cloudsql.enable_iam_login }}
123121
- "-enable_iam_login"
124122
{{- end }}
@@ -206,13 +204,8 @@ spec:
206204
- name: DD_DATABASE_PASSWORD
207205
valueFrom:
208206
secretKeyRef:
209-
{{- if eq .Values.database "postgresql" }}
210-
name: {{ .Values.postgresql.auth.existingSecret | default "defectdojo-postgresql-specific" }}
211-
key: {{ .Values.postgresql.auth.secretKeys.userPasswordKey | default "postgresql-password" }}
212-
{{- else if eq .Values.database "postgresqlha" }}
213-
name: {{ .Values.postgresqlha.postgresql.existingSecret | default "defectdojo-postgresql-ha-specific" }}
214-
key: postgresql-postgres-password
215-
{{- end }}
207+
name: {{ .Values.postgresql.auth.existingSecret | default "defectdojo-postgresql-specific" }}
208+
key: {{ .Values.postgresql.auth.secretKeys.userPasswordKey | default "postgresql-password" }}
216209
- name: DD_SECRET_KEY
217210
valueFrom:
218211
secretKeyRef:

helm/defectdojo/templates/initializer-job.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ spec:
7272
command: ["/cloud_sql_proxy"]
7373
args:
7474
- "-verbose={{ .Values.cloudsql.verbose }}"
75-
{{- if eq .Values.database "postgresql" }}
7675
- "-instances={{ .Values.cloudsql.instance }}=tcp:{{ .Values.postgresql.primary.service.ports.postgresql }}"
77-
{{- end }}
7876
{{- if .Values.cloudsql.enable_iam_login }}
7977
- "-enable_iam_login"
8078
{{- end }}
@@ -137,13 +135,8 @@ spec:
137135
- name: DD_DATABASE_PASSWORD
138136
valueFrom:
139137
secretKeyRef:
140-
{{- if eq .Values.database "postgresql" }}
141138
name: {{ .Values.postgresql.auth.existingSecret }}
142139
key: {{ .Values.postgresql.auth.secretKeys.userPasswordKey }}
143-
{{- else if eq .Values.database "postgresqlha" }}
144-
name: {{ .Values.postgresqlha.postgresql.existingSecret }}
145-
key: postgresql-postgres-password
146-
{{- end }}
147140
{{- with .Values.extraEnv }}
148141
{{- toYaml . | nindent 8 }}
149142
{{- end }}

helm/defectdojo/templates/secret-postgresql-ha-pgpool.yaml

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

helm/defectdojo/templates/secret-postgresql-ha.yaml

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

helm/defectdojo/templates/tests/unit-tests.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ spec:
3030
name: {{ $fullName }}
3131
env:
3232
- name: DD_DATABASE_USER
33-
value: {{ if eq .Values.database "postgresql" }}{{ .Values.postgresql.auth.username }}{{ end }}{{ if eq .Values.database "postgresqlha" }}{{ .Values.postgresqlha.postgresql.username }}{{ end }}
33+
value: {{ .Values.postgresql.auth.username }}
3434
- name: DD_CELERY_BROKER_PASSWORD
3535
valueFrom:
3636
secretKeyRef:
@@ -42,13 +42,8 @@ spec:
4242
- name: DD_DATABASE_PASSWORD
4343
valueFrom:
4444
secretKeyRef:
45-
{{- if eq .Values.database "postgresql" }}
4645
name: {{ .Values.postgresql.auth.existingSecret }}
4746
key: {{ .Values.postgresql.auth.secretKeys.userPasswordKey }}
48-
{{- else if eq .Values.database "postgresqlha" }}
49-
name: "{{ .Values.postgresqlha.postgresql.existingSecret }}"
50-
key: postgresql-postgres-password
51-
{{- end }}
5247
- name: DD_DEBUG
5348
value: 'True'
5449
- name: DD_SECRET_KEY

helm/defectdojo/values.yaml

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ createSecret: false
66
createRedisSecret: false
77
# create postgresql secret in defectdojo chart, outside of postgresql chart
88
createPostgresqlSecret: false
9-
# create postgresql-ha secret in defectdojo chart, outside of postgresql-ha chart
10-
createPostgresqlHaSecret: false
11-
# create postgresql-ha-pgpool secret in defectdojo chart, outside of postgresql-ha chart
12-
createPostgresqlHaPgpoolSecret: false
139
# Track configuration (trackConfig): will automatically respin application pods in case of config changes detection
1410
# can be:
1511
# - disabled, default
@@ -52,9 +48,6 @@ networkPolicy:
5248
# port: 443
5349
annotations: {}
5450

55-
# Configuration value to select database type
56-
# Set the "enable" field to true of the database type you select (if you want to use internal database) and false of the one you don't select
57-
database: postgresql
5851
# Primary hostname of instance
5952
host: defectdojo.default.minikube.local
6053

@@ -441,42 +434,6 @@ postgresql:
441434
# the line below:
442435
# postgresServer: "127.0.0.1"
443436

444-
postgresqlha:
445-
enabled: false
446-
global:
447-
pgpool:
448-
existingSecret: defectdojo-postgresql-ha-pgpool
449-
serviceAccount:
450-
create: true
451-
postgresql:
452-
replicaCount: 3
453-
username: defectdojo
454-
password: ""
455-
repmgrPassword: ""
456-
database: defectdojo
457-
existingSecret: defectdojo-postgresql-ha-specific
458-
securityContext:
459-
enabled: true
460-
fsGroup: 1001
461-
containerSecurityContext:
462-
enabled: true
463-
runAsUser: 1001
464-
pgpool:
465-
replicaCount: 3
466-
adminPassword: ""
467-
securityContext:
468-
enabled: true
469-
fsGroup: 1001
470-
volumePermissions:
471-
enabled: true
472-
securityContext:
473-
runAsUser: 1001
474-
persistence:
475-
enabled: true
476-
service:
477-
ports:
478-
postgresql: 5432
479-
480437
# Google CloudSQL support in GKE via gce-proxy
481438
cloudsql:
482439
# To use CloudSQL in GKE set 'enable: true'

0 commit comments

Comments
 (0)