Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geoserver: wait for DB and DB user to be available #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions charts/geonode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ Helm Chart for Geonode. Supported versions: Geonode: 4.2.2, Geoserver: 2.23.3-v2
| geoserver.imagePullPolicy | string | `"IfNotPresent"` | geoserver image pull policy |
| geoserver.imagePullSecret | string | `""` | pull secret to use for geoserver image |
| geoserver.init.container_name | string | `"geoserver-wait-for-db"` | init container name |
| geoserver.init.image.name | string | `"jwilder/dockerize"` | |
| geoserver.init.image.tag | string | `"0.6.1"` | |
| geoserver.init.image.name | string | `"postgres"` | |
| geoserver.init.image.tag | string | `"16-alpine"` | |
| geoserver.init.imagePullPolicy | string | `"IfNotPresent"` | |
| geoserver.port | int | `8080` | geoserver port |
| geoserver.resources.limits.cpu | int | `2` | limit cpu as in resource.requests.cpu (https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
Expand Down Expand Up @@ -242,4 +242,4 @@ Helm Chart for Geonode. Supported versions: Geonode: 4.2.2, Geoserver: 2.23.3-v2
| rabbitmq.requests.memory | string | `"1Gi"` | requested memory as in resource.requests.memory (https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
27 changes: 23 additions & 4 deletions charts/geonode/templates/geoserver/geoserver-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,29 @@ spec:
- name: {{ .Values.geoserver.init.container_name }}
image: "{{ .Values.geoserver.init.image.name }}:{{ .Values.geoserver.init.image.tag }}"
imagePullPolicy: {{ .Values.geoserver.init.imagePullPolicy }}
args:
- -timeout=60s
- -wait
- tcp://{{ include "database_hostname" . }}:{{ include "database_port" . }}
envFrom:
- configMapRef:
name: {{ include "geoserver_pod_name" . }}-env
env:
# read auto generated password from secret
- name: GEONODE_GEODATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "database_geodata_password_secret_key_ref" . }}
key: {{ include "database_geodata_password_key_ref" . }}
- name: GEODATABASE_URL
value: "postgres://$(GEONODE_GEODATABASE):$(GEONODE_GEODATABASE_PASSWORD)@$(DATABASE_HOST):$(DATABASE_PORT)/$(GEONODE_GEODATABASE)"
command:
- sh
- -c
- |
printf "INFO: waiting for successful connection to %s\n" "$DATABASE_HOST"
until psql "$GEODATABASE_URL" -c '\q'
do
printf "INFO: trying connecting to DB...\n"
sleep 2
done
printf "INFO: psql succeeded. exiting\n"

{{- if not (empty .Values.geoserver.imagePullSecret) }}
imagePullSecrets:
Expand Down
4 changes: 2 additions & 2 deletions charts/geonode/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ geoserver:
container_name: geoserver-wait-for-db
image:
# init container image
name: jwilder/dockerize
name: postgres
# init container image tag
tag: "0.6.1"
tag: "16-alpine"
# init container image pull policy
imagePullPolicy: "IfNotPresent"

Expand Down