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
17 changes: 14 additions & 3 deletions charts/posthog/templates/_pgbouncer.tpl
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
{{/* Common pgbouncer helpers used by PostHog */}}
{{/* Common PgBouncer helpers used by PostHog */}}

{{/*
Set pgbouncer host
Set PgBouncer FQDN
*/}}
{{- define "posthog.pgbouncer.fqdn" -}}
{{- $fullname := include "posthog.fullname" . -}}
{{- $serviceName := printf "%s-pgbouncer" $fullname -}}
{{- $releaseNamespace := .Release.Namespace -}}
{{- $clusterDomain := .Values.clusterDomain -}}
{{- printf "%s.%s.svc.%s" $serviceName $releaseNamespace $clusterDomain -}}
{{- end -}}

{{/*
Set PgBouncer host
*/}}
{{- define "posthog.pgbouncer.host" -}}
{{- template "posthog.fullname" . }}-pgbouncer
{{- end -}}

{{/*
Set pgbouncer port
Set PgBouncer port
*/}}
{{- define "posthog.pgbouncer.port" -}}
6543
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
done
{{ end }}

until (nc -vz "{{ include "posthog.pgbouncer.host" . }}.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local" {{ include "posthog.pgbouncer.port" . }});
until (nc -vz "{{ include "posthog.pgbouncer.fqdn" . }}" {{ include "posthog.pgbouncer.port" . }});
do
echo "waiting for PgBouncer"; sleep 1;
done
Expand Down
4 changes: 4 additions & 0 deletions charts/posthog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2579,3 +2579,7 @@ busybox:
## - myRegistryKeySecretName
##
pullSecrets: []


# -- Kubernetes cluster domain name
clusterDomain: cluster.local