Skip to content
Merged
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
4 changes: 2 additions & 2 deletions Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
name: pgdog
version: v0.71
appVersion: "0.1.47"
version: v0.72
appVersion: "0.1.50"
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ statefulSet:
```

The StatefulSet creates one `ReadWriteOnce` persistent volume claim per replica
and mounts it at `/var/lib/pgdog`. The generated PgDog configuration sets
`two_phase_commit_wal_dir` to that mount point automatically. An explicit
`twoPhaseCommitWalDir` value takes precedence.
and mounts it at `/var/lib/pgdog`. Before PgDog starts, an init container creates
`/var/lib/pgdog/wal` on the volume. The generated PgDog configuration sets
`two_phase_commit_wal_dir` to that directory automatically. An explicit
`twoPhaseCommitWalDir` value still takes precedence.

The claims use the cluster's default `StorageClass`. Ensure one is configured
for dynamic provisioning before enabling `walPvc`. This option has no effect
Expand Down
2 changes: 1 addition & 1 deletion templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ data:
{{- if hasKey .Values "twoPhaseCommitWalDir" }}
two_phase_commit_wal_dir = {{ .Values.twoPhaseCommitWalDir | quote }}
{{- else if and .Values.statefulSet.enabled .Values.statefulSet.walPvc.enabled }}
two_phase_commit_wal_dir = "/var/lib/pgdog"
two_phase_commit_wal_dir = "/var/lib/pgdog/wal"
{{- end }}
{{- if hasKey .Values "twoPhaseCommitWalSegmentSize" }}
two_phase_commit_wal_segment_size = {{ include "pgdog.intval" .Values.twoPhaseCommitWalSegmentSize }}
Expand Down
19 changes: 18 additions & 1 deletion templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,26 @@ spec:
{{- else }}
terminationGracePeriodSeconds: {{ add (div (default 60000 .Values.shutdownTimeout | int64) 1000) 5 }}
{{- end }}
{{- with .Values.extraInitContainers }}
{{- if or (and .Values.statefulSet.enabled .Values.statefulSet.walPvc.enabled) .Values.extraInitContainers }}
initContainers:
{{- if and .Values.statefulSet.enabled .Values.statefulSet.walPvc.enabled }}
- name: create-wal-directory
{{- if .Values.image.name }}
image: {{ .Values.image.name }}
{{- else if .Values.image.digest }}
image: "{{ .Values.image.repository }}@{{ .Values.image.digest }}"
{{- else }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["mkdir", "-p", "/var/lib/pgdog/wal"]
volumeMounts:
- name: wal
mountPath: /var/lib/pgdog
{{- end }}
{{- with .Values.extraInitContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down
4 changes: 2 additions & 2 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ statefulSet:
# enabled switches from Deployment to StatefulSet
enabled: false
# walPvc creates one persistent volume claim per StatefulSet pod.
# The volume is mounted at /var/lib/pgdog. When enabled,
# twoPhaseCommitWalDir defaults to this mount point.
# The volume is mounted at /var/lib/pgdog. An init container creates the
# /var/lib/pgdog/wal directory, which is used by twoPhaseCommitWalDir.
walPvc:
enabled: false
size: 1Gi
Expand Down
Loading