diff --git a/charts/transfersh/templates/deployment.yaml b/charts/transfersh/templates/deployment.yaml index acc6b95..d1ac52a 100644 --- a/charts/transfersh/templates/deployment.yaml +++ b/charts/transfersh/templates/deployment.yaml @@ -19,42 +19,21 @@ spec: app.kubernetes.io/name: {{ include "transfersh.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} spec: + {{- $keyRefSource := .Values.argValues.source.type -}} + {{- $keyRefName := .Values.argValues.source.name -}} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- range .Values.argValues.paramNames }} env: - - name: HTTP_AUTH_USER + - name: {{ . | upper }} valueFrom: - secretKeyRef: - name: transfersh-secrets - key: HTTP_AUTH_USER - - name: HTTP_AUTH_PASS - valueFrom: - secretKeyRef: - name: transfersh-secrets - key: HTTP_AUTH_PASS - - name: AWS_ACCESS_KEY - valueFrom: - secretKeyRef: - name: transfersh-secrets - key: AWS_ACCESS_KEY - - name: AWS_SECRET_KEY - valueFrom: - secretKeyRef: - name: transfersh-secrets - key: AWS_SECRET_KEY - - name: AWS_BUCKET_NAME - valueFrom: - secretKeyRef: - name: transfersh-secrets - key: AWS_BUCKET_NAME - - name: AWS_BUCKET_REGION - valueFrom: - secretKeyRef: - name: transfersh-secrets - key: AWS_BUCKET_REGION - args: ["--http-auth-user","$(HTTP_AUTH_USER)","--http-auth-pass","$(HTTP_AUTH_PASS)","--provider","s3","--aws-access-key","$(AWS_ACCESS_KEY)","--aws-secret-key","$(AWS_SECRET_KEY)","--bucket","$(AWS_BUCKET_NAME)","--s3-region","$(AWS_BUCKET_REGION)","--proxy-path",""] + {{ $keyRefSource }}: + name: {{ $keyRefName }} + key: {{ . | upper }} + {{- end }} + args: [ {{- range .Values.argValues.paramNames }} {{ printf "%s%s" $.Values.argIdentifier . | quote}},{{ printf "%s%s%s" "$(" . ")" | upper | quote}},{{- end }} ] livenessProbe: httpGet: path: / diff --git a/charts/transfersh/values.yaml b/charts/transfersh/values.yaml index 8d111ea..215310b 100644 --- a/charts/transfersh/values.yaml +++ b/charts/transfersh/values.yaml @@ -1,9 +1,5 @@ -# Default values for transfersh. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - +--- replicaCount: 1 - image: repository: dutchcoders/transfer.sh tag: latest @@ -18,11 +14,31 @@ service: externalPort: 80 internalPort: 8080 +errorValues: + varValue : UltraBadValue + +argIdentifier: "--" + +argValues : { + "source" :{ + "type" : "secretKeyRef", + "name" : "transfersh-secrets" + }, + "paramNames" :[ + "http-auth-user", + "http-auth-pass", + "provider", + "aws-access-key", + "aws-secret-key", + "bucket", + "s3-region", + "proxy-path" + ] + } + ingress: enabled: false annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" path: / hosts: - transfersh.local