Skip to content

Commit

Permalink
Merge pull request #97 from OlivierCharuel/master
Browse files Browse the repository at this point in the history
feat(pgbouncer): ability to disable service-account creation if alrea…
  • Loading branch information
pmint93 authored Feb 1, 2024
2 parents 2127f99 + 8450660 commit dd29584
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/pgbouncer/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: pgbouncer
version: "0.3.0"
version: "0.4.0"
description: A Helm chart for Pgbouncer
type: application
home: https://github.com/pmint93/helm-charts
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,8 +72,9 @@ The following table lists the configurable parameters of the chart and their def
| affinity | object | `{}` | Affinity settings for pod assignment |
| serviceAccount | object | `{enable: false}` | Service account's definition |
| serviceAccount.enable | bool | `false` | Service account's section flag |
| serviceAccount.name | string | `""` | Service account's name |
| serviceAccount.name | string | `"pgbouncer"` | Service account's name |
| serviceAccount.annotations | object | `{}` | Service account's annotations |
| sidecars | list | `[]` | Sidecars raw definition |
| serviceAccount.existingServiceAccountName | string | `""` | Do not create a KSA but use an existing one |

To better understand PgBouncer configuration, please refer to [this document](https://www.pgbouncer.org/config.html)
2 changes: 1 addition & 1 deletion charts/pgbouncer/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.serviceAccount.enable }}
serviceAccountName: {{ .Values.serviceAccount.name }}
serviceAccountName: {{ .Values.serviceAccount.existingServiceAccountName | default .Values.serviceAccount.name }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/pgbouncer/templates/serviceAccount.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.serviceAccount.enable }}
{{- if and (not .Values.serviceAccount.existingServiceAccountName) .Values.serviceAccount.enable }}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down
3 changes: 2 additions & 1 deletion charts/pgbouncer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ affinity: {}

serviceAccount:
enable: false
# name: saName
name: pgbouncer
# existingServiceAccountName: ""
# annotations:
# iam.gke.io/gcp-service-account: [email protected]

Expand Down

0 comments on commit dd29584

Please sign in to comment.