diff --git a/charts/playgroundbot/Chart.yaml b/charts/playgroundbot/Chart.yaml index 5b04dcd..4a87cb4 100644 --- a/charts/playgroundbot/Chart.yaml +++ b/charts/playgroundbot/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.6 +version: 0.1.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/playgroundbot/templates/deployment.yaml b/charts/playgroundbot/templates/deployment.yaml index e9a99dd..93a7e56 100644 --- a/charts/playgroundbot/templates/deployment.yaml +++ b/charts/playgroundbot/templates/deployment.yaml @@ -34,7 +34,11 @@ spec: - name: DISCORD_TOKEN valueFrom: secretKeyRef: + {{- if .Values.existingSecret }} + name: "{{ .Values.existingSecret }}" + {{- else }} name: {{ include "playgroundbot.fullname" . }} + {{- end }} key: token resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/charts/playgroundbot/templates/secret.yaml b/charts/playgroundbot/templates/secret.yaml index 6d690cc..c4fe2b7 100644 --- a/charts/playgroundbot/templates/secret.yaml +++ b/charts/playgroundbot/templates/secret.yaml @@ -1,3 +1,4 @@ +{{- if not .Values.existingSecret -}} apiVersion: v1 kind: Secret metadata: @@ -6,4 +7,5 @@ metadata: {{- include "playgroundbot.labels" . | nindent 4 }} type: Opaque data: - token: {{ .Values.botToken | required "botToken is required" | b64enc }} \ No newline at end of file + token: {{ .Values.botToken | required "botToken is required" | b64enc }} +{{- end -}} \ No newline at end of file diff --git a/charts/playgroundbot/values.yaml b/charts/playgroundbot/values.yaml index bc0e33f..4efa881 100644 --- a/charts/playgroundbot/values.yaml +++ b/charts/playgroundbot/values.yaml @@ -6,6 +6,9 @@ image: botToken: "" +# an existing secret containing the token, otherwise one will be created +existingSecret: "" + imagePullSecrets: [] nameOverride: "" fullnameOverride: ""