Skip to content

Commit 8ea9eec

Browse files
committed
chore: additional docs wrt replicas and clean up of some conditions
1 parent c4fceed commit 8ea9eec

4 files changed

Lines changed: 24 additions & 7 deletions

File tree

deploy/helm/postgresql-trino-gateway/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,17 @@ expose the gateway outside the cluster:
6262
3. An L4-aware ingress (e.g. nginx with `tcp-services`) or a
6363
`Gateway` resource using a TCPRoute.
6464

65+
## Scaling
66+
67+
`replicaCount` defaults to `1` and should not be raised without solving
68+
sticky routing first. The cancel registry and other per-connection
69+
state are in-memory per pod; a PG `CancelRequest` must land on the same
70+
replica as the original connection to work, and the plain `ClusterIP`
71+
Service this chart creates does not guarantee that (no
72+
`sessionAffinity`, round-robin by default). Running multiple replicas
73+
today means query cancellation silently no-ops for connections routed
74+
to the wrong pod.
75+
6576
## Probes
6677

6778
Both readiness and liveness use TCP socket probes against the listening

deploy/helm/postgresql-trino-gateway/templates/NOTES.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- $tlsEnabled := include "postgresql-trino-gateway.tlsEnabled" . }}
12
{{ .Chart.Name }} {{ .Chart.AppVersion }} installed as release {{ .Release.Name }}.
23

34
Gateway is listening on port {{ .Values.service.port }}, forwarding to:
@@ -8,7 +9,7 @@ Gateway is listening on port {{ .Values.service.port }}, forwarding to:
89
Auth posture:
910
{{- if .Values.auth.enabled }}
1011
- Cleartext password challenge to PG clients, forwarded to Trino as Basic auth.
11-
{{- if eq (include "postgresql-trino-gateway.tlsEnabled" .) "true" }}
12+
{{- if $tlsEnabled }}
1213
- Listener TLS: enabled (plaintext clients refused at handshake).
1314
{{- else }}
1415
- Listener TLS: NOT configured. The gateway will refuse to start.
@@ -20,15 +21,15 @@ Auth posture:
2021

2122
Connect from inside the cluster:
2223

23-
psql -h {{ include "postgresql-trino-gateway.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local \
24+
{{ if $tlsEnabled }}PGSSLMODE=require {{ end }}psql -h {{ include "postgresql-trino-gateway.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local \
2425
-p {{ .Values.service.port }} \
2526
-U {{ .Values.trino.user }} \
2627
-d {{ .Values.trino.catalog }}
2728

2829
Connect from outside (port-forward):
2930

3031
kubectl --namespace {{ .Release.Namespace }} port-forward svc/{{ include "postgresql-trino-gateway.fullname" . }} {{ .Values.service.port }}:{{ .Values.service.port }}
31-
psql -h 127.0.0.1 -p {{ .Values.service.port }} -U {{ .Values.trino.user }} -d {{ .Values.trino.catalog }}
32+
{{ if $tlsEnabled }}PGSSLMODE=require {{ end }}psql -h 127.0.0.1 -p {{ .Values.service.port }} -U {{ .Values.trino.user }} -d {{ .Values.trino.catalog }}
3233

3334
For Power BI Report Server in DirectQuery mode, point the PostgreSQL
3435
connector at the Service host/port above (or expose via an L4

deploy/helm/postgresql-trino-gateway/templates/deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ spec:
7070
{{- if .Values.auth.enabled }}
7171
- --auth
7272
{{- end }}
73-
{{- if and (not .Values.auth.enabled) .Values.auth.allowInsecureListener }}
73+
{{- if not .Values.auth.enabled }}
7474
- --allow-insecure-listener
7575
{{- end }}
76-
{{- if eq (include "postgresql-trino-gateway.tlsEnabled" .) "true" }}
76+
{{- if include "postgresql-trino-gateway.tlsEnabled" . }}
7777
- --tls-cert=/stackable/listener-tls/tls.crt
7878
- --tls-key=/stackable/listener-tls/tls.key
7979
{{- end }}
@@ -96,13 +96,13 @@ spec:
9696
{{- end }}
9797
resources:
9898
{{- toYaml .Values.resources | nindent 12 }}
99-
{{- if eq (include "postgresql-trino-gateway.tlsEnabled" .) "true" }}
99+
{{- if include "postgresql-trino-gateway.tlsEnabled" . }}
100100
volumeMounts:
101101
- name: listener-tls
102102
mountPath: /stackable/listener-tls
103103
readOnly: true
104104
{{- end }}
105-
{{- if eq (include "postgresql-trino-gateway.tlsEnabled" .) "true" }}
105+
{{- if include "postgresql-trino-gateway.tlsEnabled" . }}
106106
volumes:
107107
- name: listener-tls
108108
{{- if .Values.tls.secretClass }}

deploy/helm/postgresql-trino-gateway/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
---
22
# Default values for postgresql-trino-gateway.
33

4+
# The cancel registry and per-connection state are in-memory (see the
5+
# project README). Running more than one replica requires sticky-by-
6+
# connection routing AND the PG CancelRequest landing on the same
7+
# replica as the original connection — the Service alone does not
8+
# guarantee this. Do not raise this without also solving that.
49
replicaCount: 1
510

611
image:

0 commit comments

Comments
 (0)