-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add PgBouncer * Helm-Docs update * Remove serviceAccount * Helm-Docs update * Add PGBOUNCER_DATABASE * Make pgbouncer optional * Helm-Docs update * Bump chart version * Helm-Docs update * Fix "nil pointer evaluating interface" * Apply suggestions from code review * Apply suggestions from code review * Update charts/studio/templates/secret-studio.yaml Co-authored-by: Marcin Jasion <5058132+mjasion@users.noreply.github.com> --------- Co-authored-by: jesper7 <jesper7@users.noreply.github.com> Co-authored-by: Helio Machado <0x2b3bfa0+git@googlemail.com> Co-authored-by: 0x2b3bfa0 <0x2b3bfa0@users.noreply.github.com> Co-authored-by: Marcin Jasion <5058132+mjasion@users.noreply.github.com>
- Loading branch information
1 parent
a70e3cc
commit b80dff6
Showing
9 changed files
with
233 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{{- if ((.Values.pgBouncer).enabled) -}} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{.Release.Name}}-pgbouncer | ||
labels: | ||
{{- include "pgbouncer.labels" . | nindent 4 }} | ||
spec: | ||
{{- if not .Values.pgBouncer.autoscaling.enabled }} | ||
replicas: {{ .Values.pgBouncer.replicaCount }} | ||
{{- end }} | ||
selector: | ||
matchLabels: | ||
{{- include "pgbouncer.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
annotations: | ||
checksum/secret-pgbouncer: {{ include (print $.Template.BasePath "/secret-pgbouncer.yaml") . | sha256sum }} | ||
{{- include "studio.checksum" . | indent 8 }} | ||
{{- with .Values.pgBouncer.podAnnotations }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "pgbouncer.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
serviceAccountName: {{ .Values.pgBouncer.serviceAccountName }} | ||
securityContext: | ||
{{- with .Values.pgBouncer.podSecurityContext }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: pgbouncer | ||
securityContext: | ||
{{- toYaml .Values.pgBouncer.securityContext | nindent 12 }} | ||
image: "{{ .Values.pgBouncer.image.repository }}:{{ .Values.pgBouncer.image.tag }}" | ||
imagePullPolicy: {{ .Values.pgBouncer.image.pullPolicy }} | ||
resources: | ||
{{- toYaml .Values.pgBouncer.resources | nindent 12 }} | ||
env: | ||
- name: PGBOUNCER_PORT | ||
value: "6432" | ||
envFrom: | ||
- secretRef: | ||
name: pgbouncer | ||
{{- if .Values.pgBouncer.envFromSecret }} | ||
- secretRef: | ||
name: {{ .Values.pgBouncer.envFromSecret }} | ||
{{- end }} | ||
ports: | ||
- name: pgbouncer | ||
containerPort: 6432 | ||
protocol: TCP | ||
{{- with .Values.pgBouncer.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.pgBouncer.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.pgBouncer.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{{- if ((.Values.pgBouncer).enabled) -}} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: pgbouncer | ||
{{ if (not (hasKey .Values "ci")) }} # Add annotation if we're not in CI execution. | ||
annotations: | ||
helm.sh/resource-policy: "keep" | ||
argocd.argoproj.io/sync-options: Delete=false | ||
{{- end }} | ||
labels: | ||
{{- include "studio.labels" . | nindent 4 }} | ||
type: Opaque | ||
stringData: | ||
POSTGRESQL_USERNAME: {{ .Values.global.postgres.user | quote }} | ||
POSTGRESQL_PASSWORD: {{ .Values.global.postgres.password | quote }} | ||
POSTGRESQL_DATABASE: {{ .Values.global.postgres.databaseName | quote }} | ||
POSTGRESQL_HOST: {{ .Values.global.postgres.host | quote }} | ||
POSTGRESQL_PORT: {{ .Values.global.postgres.port | quote }} | ||
PGBOUNCER_DATABASE: {{ .Values.global.postgres.databaseName | quote }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{{- if ((.Values.pgBouncer).enabled) -}} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: pgbouncer | ||
labels: | ||
{{- include "pgbouncer.labels" . | nindent 4 }} | ||
spec: | ||
type: {{ .Values.pgBouncer.service.type }} | ||
ports: | ||
- port: {{ .Values.pgBouncer.service.port }} | ||
targetPort: pgbouncer | ||
protocol: TCP | ||
name: pgbouncer | ||
selector: | ||
{{- include "pgbouncer.selectorLabels" . | nindent 4 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters