Skip to content
Snippets Groups Projects
Commit 97aded5c authored by Leah Tacke genannt Unterberg's avatar Leah Tacke genannt Unterberg
Browse files

fixed nginx proxy misconfiguration

parent f9c1d0a8
No related branches found
No related tags found
No related merge requests found
# maed-exporter-deployment
This project contains the specification of a kubernetes deployment of the [maed-exporter-app](https://git-ce.rwth-aachen.de/machine-data/maed-exporter/maed-exporter-app).
The environment variable config for the frontend <> backend connection needs to be fixed.
\ No newline at end of file
It is configured such that the `maed-exporter-frontend-svc` can be exposed to a kubernetes ingress/gateway.
\ No newline at end of file
kubectl -n mdata --context=c4c apply -f .\backend-deployment.yaml -f .\frontend-deployment.yaml -f .\config-maps.yaml -f .\services.yaml
\ No newline at end of file
kubectl apply -f .\backend-deployment.yaml -f .\frontend-deployment.yaml -f .\config-maps.yaml -f .\services.yaml -n mdata
\ No newline at end of file
kubectl -n mdata apply -f .\backend-deployment.yaml -f .\frontend-deployment.yaml -f .\config-maps.yaml -f .\services.yaml
\ No newline at end of file
......@@ -44,7 +44,7 @@ spec:
path: /health
port: 8080
initialDelaySeconds: 30
periodSeconds: 15
periodSeconds: 60
timeoutSeconds: 2
failureThreshold: 3
readinessProbe:
......@@ -52,7 +52,7 @@ spec:
path: /health
port: 8080
initialDelaySeconds: 30
periodSeconds: 10
periodSeconds: 60
timeoutSeconds: 2
failureThreshold: 3
volumes:
......
......@@ -20,6 +20,9 @@ metadata:
app.kubernetes.io/name: maed-exporter-app
data:
# hash $cookie_simple_session consistent;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto $scheme;
default.conf.template: |
upstream api {
hash $cookie_simple_session consistent;
......@@ -47,34 +50,7 @@ data:
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
}
}
default.conf: |
upstream api {
hash $cookie_simple_session consistent;
server maed-exporter-backend-svc.mdata.svc.cluster.local:8080 max_fails=3 fail_timeout=30s;
}
\ No newline at end of file
server {
listen ${FRONTEND_PORT};
location / {
index index.html;
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html =404;
}
location /health {
access_log off;
add_header 'Content-Type' 'application/json';
return 200 '{"status":"healthy"}';
}
location /api {
proxy_pass http://api;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
\ No newline at end of file
......@@ -47,16 +47,16 @@ spec:
httpGet:
path: /health
port: 8090
initialDelaySeconds: 10
periodSeconds: 15
initialDelaySeconds: 15
periodSeconds: 60
timeoutSeconds: 2
failureThreshold: 3
readinessProbe:
httpGet:
path: /health
port: 8090
initialDelaySeconds: 5
periodSeconds: 10
initialDelaySeconds: 15
periodSeconds: 60
timeoutSeconds: 2
failureThreshold: 3
volumes:
......
kubectl -n mdata --context=c4c rollout restart deployment maed-exporter-backend
kubectl -n mdata --context=c4c rollout restart deployment maed-exporter-frontend
\ No newline at end of file
kubectl -n mdata rollout restart deployment maed-exporter-backend
kubectl -n mdata rollout restart deployment maed-exporter-frontend
\ No newline at end of file
......@@ -30,4 +30,3 @@ spec:
- protocol: TCP
port: 8090
targetPort: 8090
\ No newline at end of file
type: NodePort
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment