Skip to content
Draft
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
18 changes: 18 additions & 0 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,24 @@ spec:
# Pod-level security context - runs as non-root user for security
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if and .Values.postgresql.enabled .Values.initContainers.waitForPostgres.enabled }}
# Init container waits for PostgreSQL to be ready before starting Inngest
initContainers:
- name: wait-for-postgres
image: "{{ .Values.initContainers.waitForPostgres.image.repository }}:{{ .Values.initContainers.waitForPostgres.image.tag | default .Values.postgresql.image.tag }}"
command:
- sh
- -c
- |
echo "Waiting for PostgreSQL to be ready..."
until pg_isready -h {{ include "inngest.postgresql.fullname" . }} -p {{ .Values.postgresql.service.port }} -U {{ .Values.postgresql.auth.username }} -d {{ .Values.postgresql.auth.database }}; do
echo "PostgreSQL is not ready yet. Retrying in 2 seconds..."
sleep 2
done
echo "PostgreSQL is ready!"
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
containers:
# Main Inngest application container
- name: {{ .Chart.Name }}
Expand Down
10 changes: 10 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ ingress:
hosts:
- chart-example.local # Change to your domain

# Init container to wait for PostgreSQL to be ready before starting Inngest
# Only applies when postgresql.enabled is true (internal PostgreSQL)
# For external PostgreSQL, ensure your database is available before deploying
initContainers:
waitForPostgres:
enabled: true # Set to false to disable the init container
image:
repository: postgres
tag: "" # Uses postgresql.image.tag by default for consistency

# Liveness probe configuration for the main Inngest container
# Increase initialDelaySeconds when connecting to external databases that take longer to initialize
livenessProbe:
Expand Down