diff --git a/charts/go-monorepo/Chart.yaml b/charts/go-monorepo/Chart.yaml index 24e7b86..1dd1841 100644 --- a/charts/go-monorepo/Chart.yaml +++ b/charts/go-monorepo/Chart.yaml @@ -1,3 +1,3 @@ apiVersion: v2 name: go-monorepo -version: 0.0.1 \ No newline at end of file +version: 0.0.2 \ No newline at end of file diff --git a/charts/go-monorepo/Taskfile.yaml b/charts/go-monorepo/Taskfile.yaml new file mode 100644 index 0000000..bf9818c --- /dev/null +++ b/charts/go-monorepo/Taskfile.yaml @@ -0,0 +1,6 @@ +version: 3 + +tasks: + template:test: + cmds: + - helm template -f values-test.yaml . \ No newline at end of file diff --git a/charts/go-monorepo/templates/configmap.yaml b/charts/go-monorepo/templates/configmap.yaml new file mode 100644 index 0000000..6c5b1f9 --- /dev/null +++ b/charts/go-monorepo/templates/configmap.yaml @@ -0,0 +1,7 @@ +{{ if .Values.envs }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-envs +data: {{ .Values.envs | toYaml | nindent 2 }} +{{ end }} \ No newline at end of file diff --git a/charts/go-monorepo/templates/lib/containers.tpl b/charts/go-monorepo/templates/lib/containers.tpl index ad37e58..1ba44c6 100644 --- a/charts/go-monorepo/templates/lib/containers.tpl +++ b/charts/go-monorepo/templates/lib/containers.tpl @@ -5,16 +5,13 @@ {{ if .Values.args }} args: {{ .Values.args | toYaml | nindent 2 }} {{ end }} - {{ if .Values.secretEnvs }} envFrom: + {{ if .Values.secrets.enabled }} - secretRef: - name: {{.Values.secretEnvs }} + name: {{ .Release.Name }}-envs {{ end }} {{ if .Values.envs }} - env: - {{ range $key, $value := .Values.envs }} - - name: {{ $key }} - value: {{ $value }} - {{ end }} + - configMapRef: + name: {{ .Release.Name }}-envs {{ end }} {{ end }} \ No newline at end of file diff --git a/charts/go-monorepo/templates/secrets.yaml b/charts/go-monorepo/templates/secrets.yaml index f87f5c1..37af067 100644 --- a/charts/go-monorepo/templates/secrets.yaml +++ b/charts/go-monorepo/templates/secrets.yaml @@ -1 +1,16 @@ -# TODO \ No newline at end of file +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: {{ .Release.Name }}-envs + annotations: + argocd.argoproj.io/sync-wave: "-5" +spec: + secretStoreRef: + name: vault + kind: ClusterSecretStore + refreshInterval: 1h + dataFrom: + - extract: + key: /{{ .Values.environment }}/{{ .Values.name }} + target: + name: {{ .Release.Name }}-envs \ No newline at end of file diff --git a/charts/go-monorepo/test-values.yaml b/charts/go-monorepo/values-test.yaml similarity index 93% rename from charts/go-monorepo/test-values.yaml rename to charts/go-monorepo/values-test.yaml index 42c970b..f670cce 100644 --- a/charts/go-monorepo/test-values.yaml +++ b/charts/go-monorepo/values-test.yaml @@ -14,6 +14,8 @@ resources: imagePullSecrets: [] +environment: test + # -- Options: deployment | rollout controller: deployment diff --git a/charts/go-monorepo/values.yaml b/charts/go-monorepo/values.yaml index 6811cd0..429dfb6 100644 --- a/charts/go-monorepo/values.yaml +++ b/charts/go-monorepo/values.yaml @@ -22,5 +22,5 @@ args: [] secrets: enabled: true -envs: +envs: {} # KEY: VALUE \ No newline at end of file