Skip to content
Snippets Groups Projects
Commit 7f03313c authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

mount env as secret

parent 449dc8fd
No related branches found
No related tags found
No related merge requests found
...@@ -96,4 +96,5 @@ deploy: ...@@ -96,4 +96,5 @@ deploy:
before_script: before_script:
- kubectl config use-context $CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:maps-deployment - kubectl config use-context $CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:maps-deployment
script: script:
- helm -n $KUBE_NAMESPACE upgrade --install $DEPLOYMENT_CHART_NAME maps/ --set nginx.image.repository=$CI_REGISTRY_IMAGE/nginx --set nginx.image.tag=$IMAGE_TAG --set fpm.image.repository=$CI_REGISTRY_IMAGE/fpm --set fpm.image.tag=$IMAGE_TAG - kubectl -n $KUBE_NAMESPACE create secret generic $DEPLOYMENT_CHART_NAME --from-file=.env=$ENV_PRODUCTION --dry-run=client --save-config -o yaml | kubectl apply -f -
- helm -n $KUBE_NAMESPACE upgrade --install $DEPLOYMENT_CHART_NAME maps/ --set nginx.image.repository=$CI_REGISTRY_IMAGE/nginx --set secretName=$DEPLOYMENT_CHART_NAME --set nginx.image.tag=$IMAGE_TAG --set fpm.image.repository=$CI_REGISTRY_IMAGE/fpm --set fpm.image.tag=$IMAGE_TAG
...@@ -48,8 +48,12 @@ spec: ...@@ -48,8 +48,12 @@ spec:
port: fpm port: fpm
resources: resources:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.fpm.volumeMounts }}
volumeMounts: volumeMounts:
- name: env
mountPath: "/html/.env"
subPath: .env
readOnly: true
{{- with .Values.fpm.volumeMounts }}
{{- toYaml . | nindent 12 }} {{- toYaml . | nindent 12 }}
{{- end }} {{- end }}
- name: nginx - name: nginx
...@@ -75,8 +79,15 @@ spec: ...@@ -75,8 +79,15 @@ spec:
volumeMounts: volumeMounts:
{{- toYaml . | nindent 12 }} {{- toYaml . | nindent 12 }}
{{- end }} {{- end }}
{{- with .Values.volumes }}
volumes: volumes:
- name: env
secret:
secretName: {{ .Values.secretName }}
items:
- key: .env
path: .env
{{- with .Values.volumes }}
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment