Skip to content

Commit c3d68ad

Browse files
authored
feat: remove wait-for-postgres init container from jobs (#586)
1 parent cc466a4 commit c3d68ad

6 files changed

Lines changed: 8 additions & 70 deletions

File tree

charts/zitadel/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: zitadel
33
description: A Helm chart for ZITADEL
44
type: application
55
appVersion: v4.13.0
6-
version: 9.30.0
6+
version: 9.31.0
77
kubeVersion: '>= 1.30.0-0'
88
home: https://zitadel.com
99
sources:

charts/zitadel/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Zitadel
44

5-
![Version: 9.30.0](https://img.shields.io/badge/Version-9.30.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v4.13.0](https://img.shields.io/badge/AppVersion-v4.13.0-informational?style=flat-square)
5+
![Version: 9.31.0](https://img.shields.io/badge/Version-9.31.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v4.13.0](https://img.shields.io/badge/AppVersion-v4.13.0-informational?style=flat-square)
66

77
## A Better Identity and Access Management Solution
88

@@ -382,9 +382,6 @@ Kubernetes: `>= 1.30.0-0`
382382
| startupProbe.failureThreshold | int | `30` | Number of consecutive failures before marking startup as failed and restarting the container. With periodSeconds=1 and failureThreshold=30, the container has 30 seconds to start. |
383383
| startupProbe.periodSeconds | int | `1` | How often (in seconds) to perform the startup check. |
384384
| tolerations | []Toleration | `[]` | Tolerations allow pods to be scheduled on nodes with matching taints. Taints are used to repel pods from nodes; tolerations allow exceptions. Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ |
385-
| tools.busybox.image.pullPolicy | string | `""` | Image pull policy. Defaults to the Kubernetes default for the given tag. |
386-
| tools.busybox.image.repository | string | `"busybox"` | The image repository for busybox. |
387-
| tools.busybox.image.tag | string | `"1.37"` | The busybox image tag. |
388385
| tools.kubectl.image.pullPolicy | string | `""` | The pull policy for the kubectl image. If left empty, Kubernetes applies its default policy depending on whether the tag is mutable or fixed. |
389386
| tools.kubectl.image.repository | string | `"alpine/k8s"` | The name of the image repository that contains the kubectl image. The chart automatically prepends the registry (docker.io by default) for compatibility with CRI-O v1.34+ which enforces fully qualified names. |
390387
| tools.kubectl.image.tag | string | `""` | The image tag to use for the kubectl image. It should be left empty to automatically default to the Kubernetes cluster version |

charts/zitadel/templates/job_init.yaml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,8 @@ spec:
3434
{{- toYaml .Values.podSecurityContext | nindent 8 }}
3535
enableServiceLinks: false
3636
restartPolicy: Never
37-
{{- if or .Values.postgresql.enabled .Values.zitadel.initContainers .Values.initJob.initContainers }}
37+
{{- if or .Values.zitadel.initContainers .Values.initJob.initContainers }}
3838
initContainers:
39-
{{- if .Values.postgresql.enabled }}
40-
- name: wait-for-postgresql
41-
image: {{ .Values.tools.busybox.image.repository }}:{{ .Values.tools.busybox.image.tag }}
42-
command:
43-
- sh
44-
- -c
45-
- |
46-
TIMEOUT=300; elapsed=0
47-
until nc -z {{ include "zitadel.postgresqlHost" . }} 5432; do
48-
if [ "$elapsed" -ge "$TIMEOUT" ]; then
49-
echo "ERROR: timed out waiting for postgresql after ${TIMEOUT}s"; exit 1
50-
fi
51-
echo "waiting for postgresql... (${elapsed}s elapsed)"; sleep 2; elapsed=$((elapsed + 2))
52-
done
53-
{{- end }}
5439
{{- with .Values.zitadel.initContainers }}
5540
{{- toYaml . | nindent 8 }}
5641
{{- end }}
@@ -114,6 +99,8 @@ spec:
11499
- name: ZITADEL_DATABASE_{{ $dbEnv }}_USER_SSL_KEY
115100
value: /db-ssl-user-crt/tls.key
116101
{{- end}}
102+
- name: ZITADEL_DATABASE_{{ $dbEnv }}_AWAITINITIALCONN
103+
value: "5m"
117104
{{- with .Values.env }}
118105
{{- toYaml . | nindent 12 }}
119106
{{- end }}

charts/zitadel/templates/job_setup.yaml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,8 @@ spec:
4949
{{- toYaml .Values.podSecurityContext | nindent 8 }}
5050
enableServiceLinks: false
5151
restartPolicy: Never
52-
{{- if or .Values.postgresql.enabled .Values.zitadel.initContainers .Values.setupJob.initContainers }}
52+
{{- if or .Values.zitadel.initContainers .Values.setupJob.initContainers }}
5353
initContainers:
54-
{{- if .Values.postgresql.enabled }}
55-
- name: wait-for-postgresql
56-
image: {{ .Values.tools.busybox.image.repository }}:{{ .Values.tools.busybox.image.tag }}
57-
command:
58-
- sh
59-
- -c
60-
- |
61-
TIMEOUT=300; elapsed=0
62-
until nc -z {{ include "zitadel.postgresqlHost" . }} 5432; do
63-
if [ "$elapsed" -ge "$TIMEOUT" ]; then
64-
echo "ERROR: timed out waiting for postgresql after ${TIMEOUT}s"; exit 1
65-
fi
66-
echo "waiting for postgresql... (${elapsed}s elapsed)"; sleep 2; elapsed=$((elapsed + 2))
67-
done
68-
{{- end }}
6954
{{- with .Values.zitadel.initContainers }}
7055
{{- toYaml . | nindent 8 }}
7156
{{- end }}
@@ -137,6 +122,8 @@ spec:
137122
- name: ZITADEL_DATABASE_{{ $dbEnv }}_USER_SSL_KEY
138123
value: /db-ssl-user-crt/tls.key
139124
{{- end}}
125+
- name: ZITADEL_DATABASE_{{ $dbEnv }}_AWAITINITIALCONN
126+
value: "5m"
140127
{{- with .Values.env }}
141128
{{- toYaml . | nindent 12 }}
142129
{{- end }}

charts/zitadel/values.schema.json

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,28 +1434,6 @@
14341434
"tools": {
14351435
"type": "object",
14361436
"properties": {
1437-
"busybox": {
1438-
"type": "object",
1439-
"properties": {
1440-
"image": {
1441-
"type": "object",
1442-
"properties": {
1443-
"pullPolicy": {
1444-
"description": "Image pull policy. Defaults to the Kubernetes default for the given tag.",
1445-
"type": "string"
1446-
},
1447-
"repository": {
1448-
"description": "The image repository for busybox.",
1449-
"type": "string"
1450-
},
1451-
"tag": {
1452-
"description": "The busybox image tag.",
1453-
"type": "string"
1454-
}
1455-
}
1456-
}
1457-
}
1458-
},
14591437
"kubectl": {
14601438
"type": "object",
14611439
"properties": {

charts/zitadel/values.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,17 +1395,6 @@ tools:
13951395
# cpu: 50m
13961396
# memory: 32Mi
13971397

1398-
# Configuration for the busybox image used by the wait-for-postgresql initContainer.
1399-
# Override when running in air-gapped or restricted-registry environments.
1400-
busybox:
1401-
image:
1402-
# -- The image repository for busybox.
1403-
repository: "busybox"
1404-
# -- The busybox image tag.
1405-
tag: "1.37"
1406-
# -- Image pull policy. Defaults to the Kubernetes default for the given tag.
1407-
pullPolicy: ""
1408-
14091398
# Configuration for the kubectl helper image used by init containers and jobs
14101399
# for lightweight Kubernetes API operations. This image is used by the setup
14111400
# job's machinekey containers and the cleanup job.

0 commit comments

Comments
 (0)