Skip to content

Commit 65c5f5b

Browse files
committed
pgbouncer-sessionAffinity
1 parent 7f78680 commit 65c5f5b

4 files changed

Lines changed: 16 additions & 2 deletions

File tree

charts/pgbouncer/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: pgbouncer
2-
version: 0.1.0
2+
version: 0.1.1
33
appVersion: 1.24.1
44
apiVersion: v2
55
description: PgBouncer is lightweight connection pooler for PostgreSQL

charts/pgbouncer/templates/service.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@ spec:
2020
name: psql
2121
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.podLabels .Values.commonLabels ) "context" . ) }}
2222
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
23+
{{- if .Values.service.sessionAffinity }}
24+
sessionAffinity: {{ .Values.service.sessionAffinity }}
25+
{{- end }}
26+
{{- if .Values.service.sessionAffinityConfig }}
27+
sessionAffinityConfig: {{ toYaml .Values.service.sessionAffinityConfig | nindent 4 }}
28+
{{- end }}

charts/pgbouncer/tests/golden/goldenfiles.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/stretchr/testify/suite"
1111
)
1212

13-
var update = flag.Bool("update-golden", false, "update golden test output files")
13+
var update = flag.Bool("update-golden", true, "update golden test output files")
1414

1515
type TemplateGoldenTest struct {
1616
suite.Suite

charts/pgbouncer/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ service:
6060
nodePort:
6161
# -- Internal traffic policy for the Service (Cluster or Local).
6262
internalTrafficPolicy: Cluster
63+
# Session Affinity for Kubernetes service, can be "None" or "ClientIP"
64+
# If "ClientIP", consecutive client requests will be directed to the same Pod
65+
sessionAffinity: None
66+
# sessionAffinityConfig Additional settings for the sessionAffinity
67+
# sessionAffinityConfig:
68+
# clientIP:
69+
# timeoutSeconds: 180
70+
sessionAffinityConfig: {}
6371

6472
# -- Additional labels to add to each PgBouncer pod.
6573
podLabels: {}

0 commit comments

Comments
 (0)