Skip to content

Commit a8b5a91

Browse files
Address feedback
1 parent 831fcf7 commit a8b5a91

5 files changed

Lines changed: 26 additions & 7 deletions

File tree

charts/cnpg-database/templates/cluster.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ spec:
1717
imageName: "{{ .Values.postgres.image.repository }}:{{ .Values.postgres.image.tag }}"
1818
enablePDB: {{ .Values.postgres.enablePDB }}
1919
enableSuperuserAccess: {{ .Values.postgres.enableSuperuserAccess }}
20-
monitoring:
21-
enablePodMonitor: {{ .Values.postgres.enablePodMonitor }}
2220
{{- with .Values.postgres.resources }}
2321
resources:
2422
{{- toYaml . | nindent 4 }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if .Values.podMonitor.enabled }}
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/datreeio/CRDs-catalog/refs/heads/main/monitoring.coreos.com/podmonitor_v1.json
3+
apiVersion: monitoring.coreos.com/v1
4+
kind: PodMonitor
5+
metadata:
6+
name: {{ include "cnpg-database.fullname" . }}
7+
spec:
8+
selector:
9+
matchLabels:
10+
cnpg.io/cluster: {{ include "cnpg-database.fullname" . }}
11+
podMetricsEndpoints:
12+
- port: metrics
13+
{{- end }}

charts/cnpg-database/templates/secret-s3.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@ spec:
1212
encryptedData:
1313
S3_ACCESS_KEY: {{.Values.backup.s3.accessKey }}
1414
S3_SECRET_KEY: {{.Values.backup.s3.secretKey }}
15+
template:
16+
metadata:
17+
annotations:
18+
cnpg.io/reload: "true"
1519
{{- end }}

charts/cnpg-database/templates/secrets-users.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ spec:
1313
password: {{ .password | quote }}
1414
template:
1515
metadata:
16-
name: {{ printf "%s-creds-%s" (include "cnpg-database.fullname" $) .username | replace "." "-" | trunc 63 | quote }}
16+
annotations:
17+
cnpg.io/reload: "true"
1718
type: kubernetes.io/basic-auth
1819
data:
1920
username: {{ .username | quote }}

charts/cnpg-database/values.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ postgres:
99

1010
enablePDB: true
1111
enableSuperuserAccess: true
12-
enablePodMonitor: true
1312

1413
resources:
1514
requests:
@@ -19,7 +18,7 @@ postgres:
1918
memory: "512Mi"
2019
cpu: "50m"
2120

22-
# Storage configuration, see https://cloudnative-pg.io/documentation/current/storage/
21+
# Storage configuration, see https://cloudnative-pg.io/docs/current/storage/
2322
storage:
2423
class: standard
2524
data:
@@ -29,7 +28,7 @@ postgres:
2928
resizeInUseVolume: true
3029
size: 10Gi
3130

32-
# Bootstrap the PostgreSQL: https://cloudnative-pg.io/documentation/current/bootstrap/
31+
# Bootstrap the PostgreSQL: https://cloudnative-pg.io/docs/current/bootstrap/
3332
bootstrap:
3433
database: db
3534
owner: user
@@ -38,7 +37,7 @@ postgres:
3837
# Name of the S3 backup to recover from. Uses S3 settings from backup section.
3938
name: ""
4039

41-
# Parameters passed to PostgreSQL: https://cloudnative-pg.io/documentation/current/postgresql_conf/
40+
# Parameters passed to PostgreSQL: https://cloudnative-pg.io/docs/current/postgresql_conf/
4241
parameters: {}
4342

4443
groups: []
@@ -89,6 +88,10 @@ backup:
8988
maxParallel: 8
9089
encryption: AES256
9190

91+
# See https://cloudnative-pg.io/docs/current/monitoring/#monitoring-with-the-prometheus-operator
92+
podMonitor:
93+
enabled: true
94+
9295
# CNPG deploys services for the database by default. This is just here if you require an extra service.
9396
additionalService:
9497
enabled: false

0 commit comments

Comments
 (0)