From be42af3e7f94bf4b2311c8fa680fdfe087e98ee7 Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Wed, 16 Feb 2022 14:47:06 -0300 Subject: [PATCH] Add nginx configmap --- .../v0.1.0/templates/nginx-configmap.yaml | 38 +++++++++++++++++++ .../v0.1.0/templates/nginx-deployment.yaml | 8 ++++ 2 files changed, 46 insertions(+) create mode 100644 charts/mailproxy/v0.1.0/templates/nginx-configmap.yaml diff --git a/charts/mailproxy/v0.1.0/templates/nginx-configmap.yaml b/charts/mailproxy/v0.1.0/templates/nginx-configmap.yaml new file mode 100644 index 0000000..718f971 --- /dev/null +++ b/charts/mailproxy/v0.1.0/templates/nginx-configmap.yaml @@ -0,0 +1,38 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "mailproxy.fullname" . }}-nginxconf +data: + phpfpm-conf: |- + upstream backend { + server {{ include "mailproxy.fullname" . }}-mailauth:9000; + } + + server { + listen 8080 default_server; + + server_name localhost; + + access_log /dev/stdout; + error_log /dev/stderr; + + root /var/www/html; + index index.php; + + location ~ /\.ht { + deny all; + } + + location ~* ^.+.(css|js|jpeg|jpg|gif|png|ico) { + expires 30d; + } + + location ~ \.php$ { + fastcgi_pass backend; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } + } + + \ No newline at end of file diff --git a/charts/mailproxy/v0.1.0/templates/nginx-deployment.yaml b/charts/mailproxy/v0.1.0/templates/nginx-deployment.yaml index c665120..a66f8e7 100644 --- a/charts/mailproxy/v0.1.0/templates/nginx-deployment.yaml +++ b/charts/mailproxy/v0.1.0/templates/nginx-deployment.yaml @@ -44,6 +44,10 @@ spec: httpGet: path: / port: http + volumeMounts: + - mountPath: /etc/nginx/conf.d/phpfpm.conf + subPath: phpfpm-conf + name: nginxconf resources: {{- toYaml .Values.nginx.resources | nindent 12 }} {{- with .Values.nodeSelector }} @@ -58,3 +62,7 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + volumes: + - name: nginxconf + configMap: + name: {{ include "mailproxy.fullname" . }}-nginxconf