1-
21apiVersion : apps/v1
32kind : Deployment
43metadata :
@@ -17,44 +16,58 @@ spec:
1716 checksum/config : {{ include (print $.Template.BasePath "/nginx/nginx-conf.yaml") . | sha256sum }}
1817 spec :
1918 terminationGracePeriodSeconds : 3
20-
2119{{- if not (empty .Values.nginx.imagePullSecret) }}
2220 imagePullSecrets :
2321 - name : {{ .Values.nginx.imagePullSecret }}
2422{{ end }}
25-
23+ securityContext :
24+ runAsNonRoot : true
25+ runAsUser : {{ .Values.nginx.securityContext.runAsUser }}
26+ fsGroup : {{ .Values.nginx.securityContext.runAsUser }}
2627 containers :
2728 - name : {{ .Values.nginx.container_name }}
2829 image : " {{ .Values.nginx.image.name }}:{{ .Values.nginx.image.tag }}"
2930 imagePullPolicy : {{ .Values.nginx.imagePullPolicy }}
3031 ports :
3132 - name : http
32- containerPort : 80
33-
33+ containerPort : 8080
34+ securityContext :
35+ runAsUser : {{ .Values.nginx.securityContext.runAsUser }}
36+ runAsNonRoot : {{ .Values.nginx.securityContext.runAsNonRoot }}
37+ allowPrivilegeEscalation : {{ .Values.nginx.securityContext.allowPrivilegeEscalation }}
38+ readOnlyRootFilesystem : true
39+ capabilities :
40+ drop :
41+ - ALL
42+ seccompProfile :
43+ type : RuntimeDefault
3444 volumeMounts :
35- - name : " {{ include " persistant_volume_name" . }}"
45+ - name : pvc-statics
3646 mountPath : /mnt/volumes/statics
37- subPath : statics
38- - name : geonode-favicon
39- mountPath : /mnt/volumes/statics/static/geonode/img/favicon.ico
40- subPath : favicon.ico
4147 - name : nginx-confd
4248 mountPath : /etc/nginx/conf.d
43-
44- # this will fail as long as statics are not build by the geonode sts
49+ # Writable scratch directories for nginx
50+ - name : nginx-cache
51+ mountPath : /var/cache/nginx
52+ - name : nginx-run
53+ mountPath : /var/run
54+ - name : nginx-tmp
55+ mountPath : /tmp
4556 livenessProbe :
4657 {{- toYaml $.Values.nginx.livenessProbe | nindent 10 }}
47-
4858 resources :
4959 {{- toYaml $.Values.nginx.resources | nindent 10 }}
50-
5160 volumes :
5261 - name : nginx-confd
5362 configMap :
5463 name : {{ .Release.Name }}-nginx-confd
55- - name : geonode-favicon
56- configMap :
57- name : {{ .Release.Name }}-geonode-favicon
58- - name : " {{ include " persistant_volume_name" . }}"
64+ - name : pvc-statics
5965 persistentVolumeClaim :
60- claimName : pvc-{{ .Release.Name }}-geonode
66+ claimName : {{ include "pvc_statics_name" . }}
67+ # emptyDir for all nginx scratch directories
68+ - name : nginx-cache
69+ emptyDir : {}
70+ - name : nginx-run
71+ emptyDir : {}
72+ - name : nginx-tmp
73+ emptyDir : {}
0 commit comments