Skip to content

Commit

Permalink
Add customQueriesSecret
Browse files Browse the repository at this point in the history
  • Loading branch information
dragoangel committed Aug 26, 2024
1 parent d3d0006 commit 2d0b38d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions charts/cluster/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ spec:
- name: {{ include "cluster.fullname" . }}-monitoring
key: custom-queries
{{- end }}
{{- if not (empty .Values.cluster.monitoring.customQueriesSecret) }}
{{- with .Values.cluster.monitoring.customQueriesSecret }}
customQueriesSecret:
{{- toYaml . | nindent 6 }}
{{ end }}
{{- end }}
{{- if not (empty .Values.cluster.monitoring.podMonitor.relabelings) }}
{{- with .Values.cluster.monitoring.podMonitor.relabelings }}
podMonitorRelabelings:
Expand Down
3 changes: 3 additions & 0 deletions charts/cluster/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@
"disableDefaultQueries": {
"type": "boolean"
},
"customQueriesSecret": {
"type": "array"
},
"customQueries": {
"type": "array"
},
Expand Down
5 changes: 5 additions & 0 deletions charts/cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ cluster:
# Set it to true if you don't want to inject default queries into the cluster.
disableDefaultQueries: false
# -- Custom Prometheus metrics
# Will be stored in the ConfigMap
customQueries: []
# - name: "pg_cache_hit_ratio"
# query: "SELECT current_database() as datname, sum(heap_blks_hit) / (sum(heap_blks_hit) + sum(heap_blks_read)) as ratio FROM pg_statio_user_tables;"
Expand All @@ -198,6 +199,10 @@ cluster:
# - ratio:
# usage: GAUGE
# description: "Cache hit ratio"
# -- The list of secrets containing the custom queries
customQueriesSecret: []
# - name: custom-queries-secret
# key: custom-queries

# -- Configuration of the PostgreSQL server.
# See: https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-PostgresConfiguration
Expand Down

0 comments on commit 2d0b38d

Please sign in to comment.