Skip to content
Snippets Groups Projects
Commit 8910f6fe authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

config nginx as configmap

parent 8fae94a8
No related branches found
No related tags found
No related merge requests found
Pipeline #117820 passed with warnings with stages
in 7 minutes and 21 seconds
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
data:
default.conf: |
server {
listen 8080;
server_name localhost;
location /wiki {
alias /etc/nginx/html/;
index index.html index.htm;
try_files $uri $uri/ $uri/index.html /index.html =404;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
alias /etc/nginx/html/;
}
}
\ No newline at end of file
...@@ -49,6 +49,13 @@ spec: ...@@ -49,6 +49,13 @@ spec:
port: http port: http
resources: resources:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- mountPath: /tmp
name: tmp
- name: nginx-config
mountPath: /etc/nginx/conf.d/
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
...@@ -61,3 +68,10 @@ spec: ...@@ -61,3 +68,10 @@ spec:
tolerations: tolerations:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
volumes:
- emptyDir: {}
name: tmp
- name: nginx-config
configMap:
name: nginx-config
...@@ -2,7 +2,7 @@ server_tokens off; ...@@ -2,7 +2,7 @@ server_tokens off;
server { server {
listen 8080; listen 8080;
server_name localhost; server_name localhost;
location /wiki/ { location /wiki {
alias /etc/nginx/html/; alias /etc/nginx/html/;
index index.html index.htm; index index.html index.htm;
try_files $uri $uri/ $uri/index.html /index.html; try_files $uri $uri/ $uri/index.html /index.html;
......
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