Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

[timescale-multinode]feat: Add possibility to specify internal ip range #311

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ spec:
echo "*:*:*:postgres:${POSTGRES_PASSWORD_DATA_NODE}" > "${PGDATA}/../.pgpass"
chown postgres:postgres "${PGDATA}/../.pgpass" "${PGDATA}/postgresql_helm_customizations.conf"
chmod 0600 "${PGDATA}/../.pgpass"
{{- if .Values.internalIpRange }}
echo "Adding {{ .Values.internalIpRange }} in pg_hba.conf"
grep -qxF "host all all {{ .Values.internalIpRange }} trust" "pg_hba.conf" \
|| echo "host all all {{ .Values.internalIpRange }} trust" >> pg_hba.conf
{{- end }}
volumeMounts:
- name: storage-volume
mountPath: "{{ .Values.persistentVolume.mountPath }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ spec:
echo "Writing custom PostgreSQL Parameters to ${PGDATA}/postgresql_helm_customizations.conf"
echo "cluster_name = '$(hostname)'" > "${PGDATA}/postgresql_helm_customizations.conf"
echo "${POSTGRESQL_CUSTOM_PARAMETERS}" | sort >> "${PGDATA}/postgresql_helm_customizations.conf"
{{- if .Values.internalIpRange }}
echo "Adding {{ .Values.internalIpRange }} in pg_hba.conf"
grep -qxF "host all all {{ .Values.internalIpRange }} trust" "pg_hba.conf" \
|| echo "host all all {{ .Values.internalIpRange }} trust" >> pg_hba.conf
{{- end }}
# The TimescaleDB extension should not be available by default, as this interferes with the bootstrapping
# done by the access nodes. Therefore we drop the extensions from template1
echo "DROP EXTENSION timescaledb" | /docker-entrypoint.sh postgres --single -D "${PGDATA}" template1
Expand Down
3 changes: 3 additions & 0 deletions charts/timescaledb-multinode/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,6 @@ serviceAccount:
# The name of the ServiceAccount to use.
# If not set and create is true, a name is generated using the fullname template
name:

# This allows to specify the internal ip range of your cluster to add them to pg_hba.conf
internalIpRange: