Skip to content

Commit

Permalink
Merge pull request #209 from one-acre-fund/feature/nocodb-add-init-co…
Browse files Browse the repository at this point in the history
…ntainers

feat(deployment): add init containers to wait for Minio and Redis readiness
  • Loading branch information
samaroon authored Nov 10, 2024
2 parents 4bea138 + f365ede commit 23a4852
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/nocodb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.4.1
version: 0.4.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
2 changes: 1 addition & 1 deletion charts/nocodb/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# nocodb

![Version: 0.4.1](https://img.shields.io/badge/Version-0.4.1-informational?style=flat-square)
![Version: 0.4.2](https://img.shields.io/badge/Version-0.4.2-informational?style=flat-square)
![AppVersion: 0.257.2](https://img.shields.io/badge/AppVersion-0.257.2-informational?style=flat-square)

A Helm chart for Kubernetes
Expand Down
37 changes: 34 additions & 3 deletions charts/nocodb/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ spec:
{{- if .Values.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- end }}

# Init container to wait for the database
{{- if or .Values.postgresql.enabled .Values.externalDatabase.create }}
initContainers:
{{- if or .Values.postgresql.enabled .Values.externalDatabase.create }}
- name: wait-for-database
image: postgres:alpine
env:
Expand All @@ -79,6 +77,39 @@ spec:
done;
echo "Database is ready.";
{{- end }}
{{- if or .Values.minio.enabled .Values.externalMinio.create }}
- name: wait-for-minio
image: busybox
command:
- sh
- -c
- |
until wget -qO- {{ include "nocodb.minio.endpoint" . }}/minio/health/ready; do
echo "Waiting for minio...";
sleep 2;
done;
echo "Minio is ready.";
{{- end }}
{{- if .Values.redis.enabled }}
- name: wait-for-redis
image: redis:alpine
env:
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "nocodb.redis.secretName" . }}
key: {{ include "nocodb.redis.passwordKey" . }}
command:
- sh
- -c
- |
export REDISCLI_AUTH="$REDIS_PASSWORD"
until redis-cli -h "{{ include "nocodb.redis.fullname" . }}-master" -p "{{ .Values.redis.master.service.ports.redis }}" ping; do
echo "Waiting for redis...";
sleep 2;
done;
echo "Redis is ready.";
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{- if .Values.containerSecurityContext.enabled }}
Expand Down

0 comments on commit 23a4852

Please sign in to comment.