mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-12-02 09:00:18 +01:00
templatized env & args redundancy
This commit is contained in:
parent
e49de34786
commit
182ab89d1e
2 changed files with 32 additions and 37 deletions
|
@ -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: /
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue