Skip to content

Commit 0188367

Browse files
authored
Merge pull request #1 from discord-gophers/helm
support existing secrets
2 parents e30edf3 + 441967a commit 0188367

File tree

4 files changed

+37
-4
lines changed

4 files changed

+37
-4
lines changed

charts/noncer/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.0.3
18+
version: 0.1.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/noncer/templates/deployment.yaml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,34 @@ spec:
3737
- -port
3838
- "{{ .Values.email.port }}"
3939
- -pass
40-
- "{{ .Values.email.password }}"
40+
- "$(PASSWORD)"
4141
- -period
4242
- "{{ .Values.bot.period }}"
4343
- -webhook
44-
- "{{ .Values.bot.webhook }}"
44+
- "$(WEBHOOK)"
4545
{{- range .Values.bot.allowList}}
4646
- -allowlist
4747
- "{{ . }}"
48-
{{- end }}
48+
{{- end }}
49+
env:
50+
- name: PASSWORD
51+
valueFrom:
52+
secretKeyRef:
53+
{{- if .Values.existingSecret }}
54+
name: "{{ .Values.existingSecret }}"
55+
{{- else }}
56+
name: "{{ include "noncer.name" . }}"
57+
{{- end }}
58+
key: password
59+
- name: WEBHOOK
60+
valueFrom:
61+
secretKeyRef:
62+
{{- if .Values.existingSecret }}
63+
name: "{{ .Values.existingSecret }}"
64+
{{- else }}
65+
name: "{{ include "noncer.name" . }}"
66+
{{- end }}
67+
key: webhook
4968
resources:
5069
{{- toYaml .Values.resources | nindent 12 }}
5170
{{- with .Values.nodeSelector }}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{- if not .Values.existingSecret -}}
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: "{{ include "noncer.name" . }}"
6+
type: Opaque
7+
data:
8+
password: {{ .Values.email.password | required ".Values.email.password is required." | b64enc }}
9+
webhook: {{ .Values.bot.webhook | required ".Values.bot.webhook is required" | b64enc }}
10+
{{- end -}}

charts/noncer/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ image:
44
# Overrides the image tag whose default is the chart appVersion.
55
tag: ""
66

7+
# The bot can be provided with an existing secret that contains both the password and the webhook.
8+
# Otherwise a secret will be created
9+
existingSecret: ""
10+
711
email:
812
user: ""
913
password: ""

0 commit comments

Comments
 (0)