diff --git a/README.md b/README.md index eb3c896dd983a2d165ffc7835930b98a9997c0a3..fe9f157c942753d1d2c656693dc1c107c104cfe3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ # 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 diff --git a/apply-all-c4c.bat b/apply-all-c4c.bat new file mode 100644 index 0000000000000000000000000000000000000000..b6692229c9f5ab1cb5423afd6aa518468ae1aeea --- /dev/null +++ b/apply-all-c4c.bat @@ -0,0 +1 @@ +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 diff --git a/apply-all.bat b/apply-all.bat index 715c6bf89e6518e876efee213b971fed8bf4342f..7b24024102bd35bab4be205876a0ff598e37d74b 100644 --- a/apply-all.bat +++ b/apply-all.bat @@ -1 +1 @@ -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 diff --git a/backend-deployment.yaml b/backend-deployment.yaml index 5a28930714b1c6cb1e1b4baf077cfafcdd2048bf..0a2aee2832fc5cabed207085b58708c0e184a78a 100644 --- a/backend-deployment.yaml +++ b/backend-deployment.yaml @@ -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: diff --git a/config-maps.yaml b/config-maps.yaml index 74432b2aa8a4e5264e4d5faf3c4d47a870f63e07..a16c13fd577b63721f213754f26ac44ad03996bd 100644 --- a/config-maps.yaml +++ b/config-maps.yaml @@ -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; - } - - 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 + \ No newline at end of file diff --git a/frontend-deployment.yaml b/frontend-deployment.yaml index 3ffa4432b21663d2df27214540c466dd58ed76b9..102ffd0098bc52a1aa91d9a7d2bab4ab0b5f4c08 100644 --- a/frontend-deployment.yaml +++ b/frontend-deployment.yaml @@ -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: diff --git a/restart-c4c.bat b/restart-c4c.bat new file mode 100644 index 0000000000000000000000000000000000000000..8211b60a9dd3a5506d376523452182e41ac11166 --- /dev/null +++ b/restart-c4c.bat @@ -0,0 +1,2 @@ +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 diff --git a/restart.bat b/restart.bat new file mode 100644 index 0000000000000000000000000000000000000000..741d24c14c3420f9d274ea1a16b61a7031dd3b17 --- /dev/null +++ b/restart.bat @@ -0,0 +1,2 @@ +kubectl -n mdata rollout restart deployment maed-exporter-backend +kubectl -n mdata rollout restart deployment maed-exporter-frontend \ No newline at end of file diff --git a/services.yaml b/services.yaml index 1c78642e1e6705229910ac036e8cec9b62405b31..ef30527cea2ea55ba6b5954b4c8270340153ff23 100644 --- a/services.yaml +++ b/services.yaml @@ -29,5 +29,4 @@ spec: ports: - protocol: TCP port: 8090 - targetPort: 8090 - type: NodePort \ No newline at end of file + targetPort: 8090 \ No newline at end of file