Skip to content

Commit

Permalink
feat(helm): Add secret annotations (#11860)
Browse files Browse the repository at this point in the history
* feat(helm): Add secret annotations

Allow adding annotations to secret resources.

* Update helm/defectdojo/Chart.yaml

Co-authored-by: kiblik <[email protected]>

* Update helm/defectdojo/values.yaml

Co-authored-by: kiblik <[email protected]>

* Update helm/defectdojo/templates/extra-secret.yaml

Co-authored-by: kiblik <[email protected]>

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

Co-authored-by: kiblik <[email protected]>

* Update helm/defectdojo/templates/secret-postgresql.yaml

Co-authored-by: kiblik <[email protected]>

* Update helm/defectdojo/templates/secret-redis.yaml

Co-authored-by: kiblik <[email protected]>

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

Co-authored-by: kiblik <[email protected]>

* Update helm/defectdojo/templates/secret.yaml

Co-authored-by: kiblik <[email protected]>

---------

Co-authored-by: Alexander Chebotov <[email protected]>
Co-authored-by: kiblik <[email protected]>
  • Loading branch information
3 people authored Feb 27, 2025
1 parent e761ef6 commit 0a08c0d
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 0 deletions.
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.secrets.annotations .Values.annotations }}
annotations:
{{- with .Values.secrets.annotations }}
{{- 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.secrets.annotations }}
{{- 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.secrets.annotations }}
{{- 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.secrets.annotations }}
{{- 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.secrets.annotations }}
{{- 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.secrets.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
type: Opaque
data:
{{- if .Values.admin.password }}
Expand Down
4 changes: 4 additions & 0 deletions helm/defectdojo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ monitoring:

annotations: {}

secrets:
# Add annotations for secret resources
annotations: {}

# Components
celery:
broker: redis
Expand Down

0 comments on commit 0a08c0d

Please sign in to comment.