From b25cfd77502392118b7b87921938b527e491068c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Wallschl=C3=A4ger?= Date: Tue, 18 Jun 2024 15:35:56 +0200 Subject: [PATCH] Issue #157 feature properly setup liveness and readyness probes for all containers (#179) [Fixes #157] Feature: properly setup liveness and readyness probes for all containers --- .../templates/geonode/geonode-deploy.yaml | 20 ++++++++++++++++--- .../templates/geoserver/geoserver-deploy.yaml | 4 +--- .../geonode/templates/nginx/nginx-deploy.yaml | 15 ++++++++++---- .../geonode/templates/pycsw/pycsw-deploy.yaml | 20 ++++++++++++------- 4 files changed, 42 insertions(+), 17 deletions(-) diff --git a/charts/geonode/templates/geonode/geonode-deploy.yaml b/charts/geonode/templates/geonode/geonode-deploy.yaml index 44220a6..59bbe23 100644 --- a/charts/geonode/templates/geonode/geonode-deploy.yaml +++ b/charts/geonode/templates/geonode/geonode-deploy.yaml @@ -84,9 +84,10 @@ spec: dockerize -stdout /var/log/geonode.log /usr/local/bin/uwsgi --ini /usr/src/geonode/uwsgi.ini ports: - - containerPort: 8000 - - containerPort: 8001 - + - name: http + containerPort: 8000 + - name: http-monitor + containerPort: 8001 envFrom: - configMapRef: name: {{ include "geonode_pod_name" . }}-env @@ -155,6 +156,19 @@ spec: readOnly: true {{ end }} + startupProbe: + httpGet: + path: / + port: http-monitor + failureThreshold: 10 + periodSeconds: 10 + + livenessProbe: + httpGet: + path: / + port: http-monitor + initialDelaySeconds: 90 + periodSeconds: 10 resources: requests: memory: {{ .Values.geonode.resources.requests.memory }} diff --git a/charts/geonode/templates/geoserver/geoserver-deploy.yaml b/charts/geonode/templates/geoserver/geoserver-deploy.yaml index fbca8ec..a00baba 100644 --- a/charts/geonode/templates/geoserver/geoserver-deploy.yaml +++ b/charts/geonode/templates/geoserver/geoserver-deploy.yaml @@ -82,14 +82,12 @@ spec: readinessProbe: tcpSocket: port: {{ .Values.geoserver.port }} - initialDelaySeconds: 60 periodSeconds: 5 failureThreshold: 15 - livenessProbe: tcpSocket: port: {{ .Values.geoserver.port }} - initialDelaySeconds: 180 + initialDelaySeconds: 90 periodSeconds: 5 failureThreshold: 15 diff --git a/charts/geonode/templates/nginx/nginx-deploy.yaml b/charts/geonode/templates/nginx/nginx-deploy.yaml index ab52fca..f69419b 100644 --- a/charts/geonode/templates/nginx/nginx-deploy.yaml +++ b/charts/geonode/templates/nginx/nginx-deploy.yaml @@ -28,12 +28,11 @@ spec: image: "{{ .Values.nginx.image.name }}:{{ .Values.nginx.image.tag }}" imagePullPolicy: {{ .Values.nginx.imagePullPolicy }} ports: + - name: http {{- if (eq .Values.geonode.general.externalScheme "https" )}} - - containerPort: 443 - name: https + containerPort: 443 {{- else }} - - containerPort: 80 - name: http + containerPort: 80 {{- end }} volumeMounts: @@ -46,6 +45,14 @@ spec: - name: nginx-confd mountPath: /etc/nginx/conf.d + # this will fail as long as statics are not build by the geonode sts + livenessProbe: + httpGet: + path: / + port: http + initialDelaySeconds: 15 + timeoutSeconds: 5 + resources: requests: memory: {{ .Values.nginx.resources.requests.memory }} diff --git a/charts/geonode/templates/pycsw/pycsw-deploy.yaml b/charts/geonode/templates/pycsw/pycsw-deploy.yaml index 4e7b518..a43dfdb 100644 --- a/charts/geonode/templates/pycsw/pycsw-deploy.yaml +++ b/charts/geonode/templates/pycsw/pycsw-deploy.yaml @@ -57,7 +57,8 @@ spec: value: "postgresql://$(GEONODE_DATABASE):$(GEONODE_DATABASE_PASSWORD)@$(DATABASE_HOST):$(DATABASE_PORT)/$(GEONODE_DATABASE)" ports: - - containerPort: {{ .Values.pycsw.port }} + - name: http + containerPort: {{ .Values.pycsw.port }} volumeMounts: - name: pycsw-cfg mountPath: "/etc/pycsw/pycsw.cfg" @@ -67,6 +68,17 @@ spec: mountPath: /etc/pycsw/pycsw-mappings.py subPath: pycsw-mappings.py readOnly: true + readinessProbe: + httpGet: + path: / + port: http + timeoutSeconds: 5 + livenessProbe: + httpGet: + path: / + port: http + initialDelaySeconds: 10 + timeoutSeconds: 5 resources: requests: memory: {{ .Values.pycsw.resources.requests.memory }} @@ -74,12 +86,6 @@ spec: limits: memory: {{ .Values.pycsw.resources.limits.memory }} cpu: {{ .Values.pycsw.resources.limits.cpu }} - # livenessProbe: - # httpGet: - # path: / - # port: {{ .Values.pycsw.port }} - # initialDelaySeconds: 3 - # periodSeconds: 10 volumes: - name: pycsw-cfg