Commit 1d95df5a by gitlawr Committed by Alena Prokharchyk

Fix nginx user permissions in nginx-alpine image

Problem: Fails to run nginx proxies, because user home directory is not owned by nginx user inside newer nginx-alpine images Solution: Mount emptyDir to the user home directory(/var/cache/nginx) so that it is writable by the nginx user. Also update UID from 100 to 101 to be consistent with upstream changes(https://github.com/nginxinc/docker-nginx/issues/218)
parent 6a2d834f
...@@ -106,11 +106,13 @@ spec: ...@@ -106,11 +106,13 @@ spec:
volumeMounts: volumeMounts:
- mountPath: /nginx/ - mountPath: /nginx/
name: grafana-nginx name: grafana-nginx
- mountPath: /var/cache/nginx
name: nginx-home
{{- if and .Values.resources .Values.resources.proxy }} {{- if and .Values.resources .Values.resources.proxy }}
resources: resources:
{{ toYaml .Values.resources.proxy | indent 10 }} {{ toYaml .Values.resources.proxy | indent 10 }}
securityContext: securityContext:
runAsUser: 100 runAsUser: 101
runAsGroup: 101 runAsGroup: 101
{{- end }} {{- end }}
nodeSelector: nodeSelector:
...@@ -167,3 +169,5 @@ spec: ...@@ -167,3 +169,5 @@ spec:
- name: grafana-provisionings - name: grafana-provisionings
configMap: configMap:
name: {{ template "app.provisionings.fullname" . }} name: {{ template "app.provisionings.fullname" . }}
- name: nginx-home
emptyDir: {}
...@@ -33,11 +33,13 @@ spec: ...@@ -33,11 +33,13 @@ spec:
{{ toYaml .Values.resources.proxy | indent 6 }} {{ toYaml .Values.resources.proxy | indent 6 }}
{{- end }} {{- end }}
securityContext: securityContext:
runAsUser: 100 runAsUser: 101
runAsGroup: 101 runAsGroup: 101
volumeMounts: volumeMounts:
- mountPath: /nginx - mountPath: /nginx
name: configmap-{{ template "app.nginx.fullname" . }} name: configmap-{{ template "app.nginx.fullname" . }}
- mountPath: /var/cache/nginx
name: nginx-home
{{- if eq .Values.level "cluster" }} {{- if eq .Values.level "cluster" }}
- name: prometheus-agent - name: prometheus-agent
command: command:
...@@ -169,6 +171,9 @@ spec: ...@@ -169,6 +171,9 @@ spec:
storage: {{ .Values.persistence.size | quote }} storage: {{ .Values.persistence.size | quote }}
{{- end }} {{- end }}
{{- end }} {{- end }}
volumes:
- name: nginx-home
emptyDir: {}
version: "{{ .Values.image.tag }}" version: "{{ .Values.image.tag }}"
affinity: affinity:
podAntiAffinity: podAntiAffinity:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment