Browse Source

Add nginx configmap

master
Fábio Kaiser Rauber 3 years ago
parent
commit
be42af3e7f
  1. 38
      charts/mailproxy/v0.1.0/templates/nginx-configmap.yaml
  2. 8
      charts/mailproxy/v0.1.0/templates/nginx-deployment.yaml

38
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;
}
}

8
charts/mailproxy/v0.1.0/templates/nginx-deployment.yaml

@ -44,6 +44,10 @@ spec:
httpGet: httpGet:
path: / path: /
port: http port: http
volumeMounts:
- mountPath: /etc/nginx/conf.d/phpfpm.conf
subPath: phpfpm-conf
name: nginxconf
resources: resources:
{{- toYaml .Values.nginx.resources | nindent 12 }} {{- toYaml .Values.nginx.resources | nindent 12 }}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
@ -58,3 +62,7 @@ spec:
tolerations: tolerations:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
volumes:
- name: nginxconf
configMap:
name: {{ include "mailproxy.fullname" . }}-nginxconf

Loading…
Cancel
Save