Skip to content

Commit

Permalink
[VDEVOPS-000]: Support for vault ext secrets
Browse files Browse the repository at this point in the history
Signed-off-by: adobrodey <[email protected]>
  • Loading branch information
ADobrodey committed Jun 3, 2024
1 parent e89cf36 commit f060daa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion stable/deployment/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: deployment
version: 1.8.5
version: 1.8.6
description: Typical microservice chart. Supports Ingress controller, horizontal-scalable containers
type: application
dependencies:
Expand Down
9 changes: 4 additions & 5 deletions stable/deployment/templates/external-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ spec:
{{ end -}}

{{- range .Values.sidecarContainers }}
{{- $values := dict "Values" . "Release" $.Release "Template" $.Template -}}
{{- $values := dict "Values" (merge . (dict "global" $.Values.global)) "Release" $.Release "Template" $.Template -}}
{{ if and (hasKey $values.Values "env") (hasKey $values.Values.env "vaultSecret") }}
{{ $name := default $.Release.Name $values.Values.global.serviceName }}
{{ $name := default $.Release.Name $.Values.global.serviceName }}
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
Expand Down Expand Up @@ -73,9 +73,9 @@ spec:
{{ end -}}

{{- range .Values.initContainers }}
{{- $values := dict "Values" . "Release" $.Release "Template" $.Template -}}
{{- $values := dict "Values" (merge . (dict "global" $.Values.global)) "Release" $.Release "Chart" $.Chart "Template" $.Template -}}
{{ if and (hasKey $values.Values "env") (hasKey $values.Values.env "vaultSecret") }}
{{ $name := default $.Release.Name $values.Values.global.serviceName }}
{{ $name := default $.Release.Name $.Values.global.serviceName }}
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
Expand Down Expand Up @@ -111,7 +111,6 @@ spec:
{{ end -}}
{{ end -}}


{{- if .Values.vaultVolumesSupport -}}
{{- $allVolumes := default (dict) .Values.volumes -}}
{{- range $key, $value := $allVolumes }}
Expand Down
2 changes: 1 addition & 1 deletion stable/statefulset/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: statefulset
version: 1.8.5
version: 1.8.6
description: Typical StateFul Set application
type: application
dependencies:
Expand Down
10 changes: 5 additions & 5 deletions stable/statefulset/templates/external-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ spec:
{{ end -}}

{{- range .Values.sidecarContainers }}
{{- $values := dict "Values" . "Release" $.Release "Template" $.Template -}}
{{- $values := dict "Values" (merge . (dict "global" $.Values.global)) "Release" $.Release "Template" $.Template -}}
{{ if and (hasKey $values.Values "env") (hasKey $values.Values.env "vaultSecret") }}
{{ $name := default $.Release.Name $values.Values.global.serviceName }}
{{ $name := default $.Release.Name $.Values.global.serviceName }}
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
Expand Down Expand Up @@ -65,17 +65,17 @@ spec:
{{- else -}}
secret-{{ $.Values.global.product }}/data/
{{- $.Values.global.environment -}}
/k8s/{{ $value.path }}
/k8s/{{ $.Release.Namespace}}/{{ $value.path }}
{{- end }}
property: {{ default $key $value.secret }}
{{ end -}}
{{ end -}}
{{ end -}}

{{- range .Values.initContainers }}
{{- $values := dict "Values" . "Release" $.Release "Template" $.Template -}}
{{- $values := dict "Values" (merge . (dict "global" $.Values.global)) "Release" $.Release "Chart" $.Chart "Template" $.Template -}}
{{ if and (hasKey $values.Values "env") (hasKey $values.Values.env "vaultSecret") }}
{{ $name := default $.Release.Name $values.Values.global.serviceName }}
{{ $name := default $.Release.Name $.Values.global.serviceName }}
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
Expand Down

0 comments on commit f060daa

Please sign in to comment.