diff --git a/chart/keel/templates/deployment.yaml b/chart/keel/templates/deployment.yaml index 264ef16f..e4534d54 100644 --- a/chart/keel/templates/deployment.yaml +++ b/chart/keel/templates/deployment.yaml @@ -21,7 +21,15 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} command: ["/bin/keel"] + volumeMounts: + - name: google + mountPath: "/google" + readOnly: true env: +{{- if .Values.googleApplicationCredentials }} + - name: GOOGLE_APPLICATION_CREDENTIALS + value: /google/google-application-credentials.json +{{- end }} {{- if .Values.polling.enabled }} # Enable polling - name: POLL @@ -104,3 +112,9 @@ spec: {{- end }} nodeSelector: {{ toYaml .Values.nodeSelector | indent 8 }} +{{- if .Values.googleApplicationCredentials }} + volumes: + - name: google + secret: + secretName: {{ template "name" . }}-google +{{- end }} \ No newline at end of file diff --git a/chart/keel/templates/secrets-google.yaml b/chart/keel/templates/secrets-google.yaml new file mode 100644 index 00000000..0b651028 --- /dev/null +++ b/chart/keel/templates/secrets-google.yaml @@ -0,0 +1,15 @@ +{{- if .Values.googleApplicationCredentials }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "name" . }}-google + namespace: kube-system + labels: + app: {{ template "name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +type: Opaque +data: + google-application-credentials.json: {{ .Values.googleApplicationCredentials | b64enc | quote }} +{{- end }} \ No newline at end of file diff --git a/chart/keel/values.yaml b/chart/keel/values.yaml index 8ddad372..d0552a80 100644 --- a/chart/keel/values.yaml +++ b/chart/keel/values.yaml @@ -99,3 +99,6 @@ resources: # NodeSelector nodeSelector: {} + +# json of service account +# googleApplicationCredentials: \ No newline at end of file