Commit f305f10f authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Deployment without proxy. [skip ci]

parent 4842c5b4
Pipeline #54096 skipped
......@@ -10,8 +10,8 @@ metadata:
spec:
type: ClusterIP
ports:
- port: {{ .Values.api.port }}
targetPort: {{ .Values.api.port }}
- port: 8000
targetPort: 8000
protocol: TCP
name: http
selector:
......
......@@ -10,13 +10,19 @@ metadata:
data:
nginx.conf: |
server {
listen 8080;
listen 80;
server_name www.example.com;
location {{ .Values.proxy.external.path }} {
return 301 {{ .Values.proxy.external.path }}/gui;
}
location {{ .Values.proxy.external.path }}/gui {
root /app/;
rewrite ^{{ .Values.proxy.external.path }}/gui/(.*)$ /nomad/$1 break;
try_files $uri {{ .Values.proxy.external.path }}/gui/index.html;
}
location {{ .Values.proxy.external.path }}/gui/service-worker.js {
add_header Last-Modified $date_gmt;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
......@@ -26,6 +32,33 @@ data:
root /app/;
rewrite ^{{ .Values.proxy.external.path }}/gui/service-worker.js /nomad/service-worker.js break;
}
location {{ .Values.proxy.external.path }}/api {
proxy_set_header Host $host;
proxy_pass_request_headers on;
proxy_pass http://{{ include "nomad.fullname" . }}-api:8000;
proxy_connect_timeout {{ .Values.proxy.timeout }};
proxy_send_timeout {{ .Values.proxy.timeout }};
proxy_read_timeout {{ .Values.proxy.timeout }};
send_timeout {{ .Values.proxy.timeout }};
}
location {{ .Values.proxy.external.path }}/api/uploads {
client_max_body_size 35g;
proxy_request_buffering off;
proxy_set_header Host $host;
proxy_pass_request_headers on;
proxy_pass http://{{ include "nomad.fullname" . }}-api:8000;
proxy_connect_timeout {{ .Values.proxy.timeout }};
}
location {{ .Values.proxy.external.path }}/api/raw {
proxy_buffering off;
proxy_set_header Host $host;
proxy_pass_request_headers on;
proxy_pass http://{{ include "nomad.fullname" . }}-api:8000;
proxy_connect_timeout {{ .Values.proxy.timeout }};
}
}
env.js: |
window.nomadEnv = {
......@@ -63,7 +96,7 @@ spec:
image: "{{ .Values.images.frontend.name }}:{{ .Values.images.frontend.tag }}"
command: ["./run.sh", "{{ .Values.proxy.external.path }}"]
ports:
- containerPort: 8080
- containerPort: 80
volumeMounts:
- mountPath: /etc/nginx/conf.d
readOnly: true
......@@ -77,13 +110,13 @@ spec:
livenessProbe:
httpGet:
path: "{{ .Values.proxy.external.path }}/gui/index.html"
port: 8080
port: 80
initialDelaySeconds: 15
periodSeconds: 15
readinessProbe:
httpGet:
path: "{{ .Values.proxy.external.path }}/gui/index.html"
port: 8080
port: 80
initialDelaySeconds: 3
periodSeconds: 3
nodeSelector:
......
......@@ -8,12 +8,16 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
type: ClusterIP
type: NodePort
externalIPs:
- {{ .Values.proxy.nodeIP }}
ports:
- port: {{ .Values.gui.port }}
targetPort: {{ .Values.gui.port }}
- nodePort: {{ .Values.proxy.nodePort }}
port: 80
targetPort: 80
protocol: TCP
name: http
selector:
app.kubernetes.io/name: {{ include "nomad.name" . }}-gui
app.kubernetes.io/instance: {{ .Release.Name }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "nomad.fullname" . }}-proxy-config
labels:
app.kubernetes.io/name: {{ include "nomad.name" . }}-proxy-config
helm.sh/chart: {{ include "nomad.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
nginx.conf: |
server {
listen 80;
server_name www.example.com;
location {{ .Values.proxy.external.path }} {
return 301 {{ .Values.proxy.external.path }}/gui;
}
location {{ .Values.proxy.external.path }}/gui {
proxy_pass http://{{ include "nomad.fullname" . }}-gui:{{ .Values.gui.port }};
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location {{ .Values.proxy.external.path }}/api {
proxy_set_header Host $host;
proxy_pass_request_headers on;
proxy_pass http://{{ include "nomad.fullname" . }}-api:{{ .Values.api.port }};
proxy_connect_timeout {{ .Values.proxy.timeout }};
proxy_send_timeout {{ .Values.proxy.timeout }};
proxy_read_timeout {{ .Values.proxy.timeout }};
send_timeout {{ .Values.proxy.timeout }};
}
location {{ .Values.proxy.external.path }}/api/uploads {
client_max_body_size 35g;
proxy_request_buffering off;
proxy_set_header Host $host;
proxy_pass_request_headers on;
proxy_pass http://{{ include "nomad.fullname" . }}-api:{{ .Values.api.port }};
proxy_connect_timeout {{ .Values.proxy.timeout }};
proxy_send_timeout {{ .Values.proxy.datatimeout }};
proxy_read_timeout {{ .Values.proxy.timeout }};
send_timeout {{ .Values.proxy.timeout }};
}
location {{ .Values.proxy.external.path }}/api/raw {
proxy_buffering off;
proxy_set_header Host $host;
proxy_pass_request_headers on;
proxy_pass http://{{ include "nomad.fullname" . }}-api:{{ .Values.api.port }};
proxy_connect_timeout {{ .Values.proxy.timeout }};
proxy_send_timeout {{ .Values.proxy.timeout }};
proxy_read_timeout {{ .Values.proxy.datatimeout }};
send_timeout {{ .Values.proxy.timeout }};
}
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "nomad.fullname" . }}-proxy
labels:
app.kubernetes.io/name: {{ include "nomad.name" . }}-proxy
helm.sh/chart: {{ include "nomad.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: {{ include "nomad.name" . }}-proxy
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "nomad.name" . }}-proxy
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
containers:
- name: {{ include "nomad.name" . }}-proxy
image: nginx:1.13.9-alpine
ports:
- containerPort: 80
volumeMounts:
- mountPath: /etc/nginx/conf.d
readOnly: true
name: nginx-conf
- mountPath: /var/log/nginx
name: log
nodeSelector:
nomadtype: public
volumes:
- name: nginx-conf
configMap:
name: {{ include "nomad.fullname" . }}-proxy-config
items:
- key: nginx.conf
path: default.conf
- name: log
emptyDir: {}
apiVersion: v1
kind: Service
metadata:
name: {{ include "nomad.fullname" . }}-proxy
labels:
app.kubernetes.io/name: {{ include "nomad.name" . }}-proxy
helm.sh/chart: {{ include "nomad.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
type: NodePort
externalIPs:
- {{ .Values.proxy.nodeIP }}
ports:
- nodePort: {{ .Values.proxy.nodePort }}
port: {{ .Values.proxy.port }}
targetPort: 80
protocol: TCP
name: http
selector:
app.kubernetes.io/name: {{ include "nomad.name" . }}-proxy
app.kubernetes.io/instance: {{ .Release.Name }}
......@@ -30,7 +30,6 @@ api:
https: true
## Number of gunicorn worker. Recommendation is 2xnum_cores+1
worker: 10
port: 8000
console_loglevel: INFO
logstash_loglevel: INFO
## Secret used as cryptographic seed
......@@ -61,8 +60,6 @@ worker:
## Everthing concerning the nomad gui
gui:
replicas: 1
## This port is hard coded into the frontend image, it cannot be really changed
port: 8080
## This variable is used in the GUI to show or hide additional information
debug: false
## URL for matomo(piwik) user tracking
......@@ -72,14 +69,12 @@ gui:
## send matomo(piwik) user tracking data
sendTrackingData: false
## Everything concerning the proxy that combined gui, api, kibana
## Everything concerning the nginx that serves the gui, proxies the api
# It is run via NodePort service
proxy:
port: 80
nodePort: 30001
nodeIP: 130.183.207.104
timeout: 600
datatimeout: 3600
timeout: 120
external:
host: "labdev-nomad.esc.rzg.mpg.de"
port: 80
......
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