Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(helm): Add secret annotations #11860

Merged
merged 9 commits into from
Feb 27, 2025
2 changes: 1 addition & 1 deletion helm/defectdojo/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: "2.44.0-dev"
description: A Helm chart for Kubernetes to install DefectDojo
name: defectdojo
version: 1.6.175-dev
version: 1.6.176-dev
icon: https://www.defectdojo.org/img/favicon.ico
maintainers:
- name: madchap
Expand Down
9 changes: 9 additions & 0 deletions helm/defectdojo/templates/extra-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ metadata:
{{- with .Values.extraLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if or .Values.secretAnnotations .Values.annotations }}
annotations:
{{- with .Values.secretAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
type: Opaque
data:
{{- range $key, $value := .Values.extraSecrets }}
Expand Down
6 changes: 6 additions & 0 deletions helm/defectdojo/templates/secret-postgresql-ha-pgpool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ metadata:
helm.sh/resource-policy: keep
helm.sh/hook: "pre-install"
helm.sh/hook-delete-policy: "before-hook-creation"
{{- with .Values.secretAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
type: Opaque
data:
{{- if .Values.postgresqlha.pgpool.adminPassword }}
Expand Down
6 changes: 6 additions & 0 deletions helm/defectdojo/templates/secret-postgresql-ha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ metadata:
helm.sh/resource-policy: keep
helm.sh/hook: "pre-install"
helm.sh/hook-delete-policy: "before-hook-creation"
{{- with .Values.secretAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
type: Opaque
data:
{{- if .Values.postgresqlha.postgresql.password }}
Expand Down
6 changes: 6 additions & 0 deletions helm/defectdojo/templates/secret-postgresql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ metadata:
helm.sh/resource-policy: keep
helm.sh/hook: "pre-install"
helm.sh/hook-delete-policy: "before-hook-creation"
{{- with .Values.secretAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
type: Opaque
data:
{{- if .Values.postgresql.auth.password }}
Expand Down
6 changes: 6 additions & 0 deletions helm/defectdojo/templates/secret-redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ metadata:
helm.sh/resource-policy: keep
helm.sh/hook: "pre-install"
helm.sh/hook-delete-policy: "before-hook-creation"
{{- with .Values.secretAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
type: Opaque
data:
{{- if .Values.redis.auth.password }}
Expand Down
6 changes: 6 additions & 0 deletions helm/defectdojo/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ metadata:
helm.sh/resource-policy: keep
helm.sh/hook: "pre-install"
helm.sh/hook-delete-policy: "before-hook-creation"
{{- with .Values.secretAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
type: Opaque
data:
{{- if .Values.admin.password }}
Expand Down
3 changes: 3 additions & 0 deletions helm/defectdojo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ monitoring:

annotations: {}

# Add annotations for secret resources
secretAnnotations: {}

# Components
celery:
broker: redis
Expand Down