Skip to content

Commit

Permalink
[Fixes #157] Feature: properly setup liveness and readyness probes fo…
Browse files Browse the repository at this point in the history
…r all containers
  • Loading branch information
Marcel Wallschlaeger committed May 30, 2024
1 parent 1dcf0a3 commit 5cb7b43
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 19 deletions.
21 changes: 17 additions & 4 deletions charts/geonode/templates/geonode/geonode-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ spec:
- -c
- |
# install dockerize...
export DOCKERIZE_VERSION=v0.7.0
wget -q https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
Expand All @@ -84,9 +85,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
Expand Down Expand Up @@ -154,7 +156,17 @@ spec:
mountPath: "/usr/src/geonode/geonode/fixtures"
readOnly: true
{{ end }}

readinessProbe:
httpGet:
path: /
port: http-monitor
timeoutSeconds: 5
livenessProbe:
httpGet:
path: /
port: http-monitor
initialDelaySeconds: 60
timeoutSeconds: 10
resources:
requests:
memory: {{ .Values.geonode.resources.requests.memory }}
Expand All @@ -172,6 +184,7 @@ spec:
- -c
- |
# install dockerize...
export DOCKERIZE_VERSION=v0.7.0
wget -q https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
Expand Down
4 changes: 1 addition & 3 deletions charts/geonode/templates/geoserver/geoserver-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
19 changes: 14 additions & 5 deletions charts/geonode/templates/nginx/nginx-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -45,7 +44,17 @@ spec:
subPath: favicon.ico
- name: nginx-confd
mountPath: /etc/nginx/conf.d

readinessProbe:
httpGet:
path: /static
port: http
timeoutSeconds: 2
livenessProbe:
httpGet:
path: /static
port: http
initialDelaySeconds: 65
timeoutSeconds: 5
resources:
requests:
memory: {{ .Values.nginx.resources.requests.memory }}
Expand Down
20 changes: 13 additions & 7 deletions charts/geonode/templates/pycsw/pycsw-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -67,19 +68,24 @@ spec:
mountPath: /etc/pycsw/pycsw-mappings.py
subPath: pycsw-mappings.py
readOnly: true
readinessProbe:
httpGet:
path: /
port: http
timeoutSeconds: 2
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 5
timeoutSeconds: 5
resources:
requests:
memory: {{ .Values.pycsw.resources.requests.memory }}
cpu: {{ .Values.pycsw.resources.requests.cpu }}
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
Expand Down

0 comments on commit 5cb7b43

Please sign in to comment.