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
5 changes: 4 additions & 1 deletion charts/pgbouncer/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
tests/
tests/*
!tests/
!tests/service_nodeport_test.yaml
scripts/
.DS_Store
2 changes: 1 addition & 1 deletion charts/pgbouncer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: pgbouncer
description: A Helm chart for deploying PgBouncer, a PostgreSQL connection pooler, on Kubernetes
type: application
version: 4.1.4
version: 4.1.5
appVersion: 1.25.1
kubeVersion: ">= 1.31.0-0"
icon: https://icoretech.github.io/helm/charts/pgbouncer/logo.png
Expand Down
3 changes: 2 additions & 1 deletion charts/pgbouncer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The following table lists the configurable parameters of the PgBouncer chart and
| pgbouncerExporter.image.pullPolicy | string | `"IfNotPresent"` | Exporter image pull policy |
| pgbouncerExporter.image.registry | string | `""` | Exporter image registry |
| pgbouncerExporter.image.repository | string | `"prometheuscommunity/pgbouncer-exporter"` | Exporter image repository |
| pgbouncerExporter.image.tag | string | `"v0.10.2"` | Exporter image tag |
| pgbouncerExporter.image.tag | string | `"v0.12.0"` | Exporter image tag |
| pgbouncerExporter.imagePullSecrets | list | `[]` | Array of imagePullSecrets to use for pulling the pgbouncer-exporter image. |
| pgbouncerExporter.log.format | string | `"logfmt"` | Exporter log format (logfmt or json) |
| pgbouncerExporter.log.level | string | `"info"` | Exporter log level (debug, info, warn, error) |
Expand All @@ -93,6 +93,7 @@ The following table lists the configurable parameters of the PgBouncer chart and
| runtimeClassName | string | `""` | Runtime class for the PgBouncer pods (e.g. gvisor). |
| securityContext | object | `{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true,"runAsGroup":70,"runAsNonRoot":true,"runAsUser":70}` | Pod security context for the main PgBouncer container. By default, this forces the container to run without root privileges and with a read-only root filesystem. |
| service.annotations | object | `{}` | Annotations for the Service. |
| service.externalTrafficPolicy | string | `nil` | External traffic policy for the Service (Cluster or Local). Set to null to omit it. |
| service.internalTrafficPolicy | string | `"Cluster"` | Internal traffic policy for the Service (Cluster or Local). |
| service.nodePort | string | `nil` | Set service nodePort, can be null |
| service.port | int | `5432` | The service port for PgBouncer. |
Expand Down
3 changes: 3 additions & 0 deletions charts/pgbouncer/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ metadata:
{{- end }}
spec:
type: {{ .Values.service.type }}
{{- with .Values.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ . }}
{{- end }}
internalTrafficPolicy: {{ .Values.service.internalTrafficPolicy | default "Cluster" }}
ports:
- port: {{ .Values.service.port }}
Expand Down
47 changes: 47 additions & 0 deletions charts/pgbouncer/tests/service_nodeport_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
suite: service nodeport
templates:
- service.yaml
tests:
- it: defaults to ClusterIP without nodePort
set:
config.existingAdminSecret: ""
config.adminUser: admin
config.adminPassword: changeme
asserts:
- equal:
path: spec.type
value: ClusterIP
- notExists:
path: spec.externalTrafficPolicy
- notExists:
path: spec.ports[0].nodePort

- it: NodePort renders explicit nodePort
set:
config.existingAdminSecret: ""
config.adminUser: admin
config.adminPassword: changeme
service.type: NodePort
service.nodePort: 30054
asserts:
- equal:
path: spec.type
value: NodePort
- equal:
path: spec.ports[0].nodePort
value: 30054

- it: renders externalTrafficPolicy when explicitly set
set:
config.existingAdminSecret: ""
config.adminUser: admin
config.adminPassword: changeme
service.type: LoadBalancer
service.externalTrafficPolicy: Local
asserts:
- equal:
path: spec.type
value: LoadBalancer
- equal:
path: spec.externalTrafficPolicy
value: Local
2 changes: 2 additions & 0 deletions charts/pgbouncer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ service:
port: 5432
# -- Set service nodePort, can be null
nodePort:
# -- External traffic policy for the Service (Cluster or Local). Set to null to omit it.
externalTrafficPolicy:
# -- Internal traffic policy for the Service (Cluster or Local).
internalTrafficPolicy: Cluster
# -- Session Affinity for Kubernetes service, can be "None" or "ClientIP"
Expand Down
Loading