Skip to content

Commit 169eddb

Browse files
yashmehrotramoshloop
authored andcommitted
chore: add pganalyze sidecar
1 parent d0ff9d4 commit 169eddb

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

chart/templates/postgres.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ spec:
2424
configMap:
2525
name: postgresql-conf
2626
optional: true
27+
- name: logs
28+
emptyDir: {}
29+
2730
initContainers:
2831
- command:
2932
- sh
@@ -60,9 +63,43 @@ spec:
6063
- name: postgresql
6164
mountPath: /var/lib/postgresql/data
6265
subPath: postgres
66+
- name: logs
67+
mountPath: /var/log/postgresql
6368
envFrom:
6469
- secretRef:
6570
name: {{ .Values.db.secretKeyRef.name }}
71+
72+
{{- if .Values.db.pganalyze.enabled }}
73+
- name: pganalyze-collector
74+
image: quay.io/pganalyze/collector:stable
75+
env:
76+
- name: DB_HOST
77+
value: localhost
78+
- name: DB_NAME
79+
value: mission_control
80+
- name: DB_USERNAME
81+
value: pganalyze
82+
- name: DB_PASSWORD
83+
valueFrom:
84+
secretRef:
85+
name: {{ .Values.db.pganalyze.secretName }}
86+
key: DB_PASSWORD
87+
- name: PGA_API_KEY
88+
valueFrom:
89+
secretRef:
90+
name: {{ .Values.db.pganalyze.secretName }}
91+
key: PGA_API_KEY
92+
- name: PGA_ENABLE_LOG_EXPLAIN
93+
value: "true"
94+
- name: LOG_LOCATION
95+
value: /var/log/postgresql
96+
97+
volumeMounts:
98+
- name: logs
99+
mountPath: /var/log/postgresql
100+
101+
{{- end }}
102+
66103
volumeClaimTemplates:
67104
- metadata:
68105
name: postgresql

chart/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ db:
108108
resources:
109109
requests:
110110
memory: 4Gi
111+
112+
pganalyze:
113+
enabled: false
114+
secretName: pganalyze
115+
111116
smtp:
112117
secretRef:
113118
name: incident-commander-smtp

0 commit comments

Comments
 (0)