2# Copyright © contributors to CloudNativePG, established as
3# CloudNativePG a Series of LF Projects, LLC.
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
9# http://www.apache.org/licenses/LICENSE-2.0
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
17# SPDX-License-Identifier: Apache-2.0
19# Default values for CloudNativePG.
20# This is a YAML-formatted file.
21# Please declare variables to be passed to your templates.
25 repository: chainreg.biz/chainguard-private/cloudnative-pg
26 pullPolicy: IfNotPresent
27 # -- Overrides the image tag whose default is the chart appVersion.
28 tag: 1.30.1-r0@sha256:2bdff44601463e256bb1a001e6256d4c460e53246c3f62ba7e0cf59173bcc90a
35# -- Update strategy for the operator.
36# ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy
45 # -- Specifies whether the CRDs should be created when installing the chart.
47# -- The webhook configuration.
57 initialDelaySeconds: 3
59 initialDelaySeconds: 3
63# Operator configuration.
65 # -- Specifies whether the secret should be created.
67 # -- The name of the configmap/secret to use.
68 name: cnpg-controller-manager-config
69 # -- Specifies whether it should be stored in a secret, instead of a configmap.
71 # -- This option determines if the operator is responsible for observing
72 # events across the entire Kubernetes cluster or if its focus should be
73 # narrowed down to the specific namespace within which it has been deployed.
75 # -- The content of the configmap/secret, see
76 # https://cloudnative-pg.io/documentation/current/operator_conf/#available-options
77 # for all the available options.
79 # INHERITED_ANNOTATIONS: categories
80 # INHERITED_LABELS: environment, workload, app
81 # WATCH_NAMESPACE: namespace-a,namespace-b
83 # -- The maximum number of concurrent reconciles. Defaults to 10.
84 maxConcurrentReconciles: 10
85# -- Additional arguments to be added to the operator's args list.
87# -- Array containing extra environment variables which can be templated.
91# value: "{{ .Release.Name }}"
93# value: "mySpecialKey"
96 # -- Specifies whether the service account should be created.
98 # -- The name of the service account to use.
99 # If not set and create is true, a name is generated using the fullname template.
102 # -- Specifies whether ClusterRole and ClusterRoleBinding should be created.
104 # -- Aggregate ClusterRoles to Kubernetes default user-facing roles.
105 # Ref: https://kubernetes.io/docs/reference/access-authn-authz/rbac/#user-facing-roles
106 aggregateClusterRoles: false
107# -- Annotations to be added to all other resources.
109# -- Annotations to be added to the pod.
111# -- Labels to be added to the pod.
113# -- Container Security Context.
114containerSecurityContext:
115 allowPrivilegeEscalation: false
116 readOnlyRootFilesystem: true
124# -- Security Context for the whole pod.
130# -- Priority indicates the importance of a Pod relative to other Pods.
134 # -- The name of the Webhook Service.
135 name: cnpg-webhook-service
136 # DO NOT CHANGE THE SERVICE NAME as it is currently used to generate the certificate
137 # and can not be configured
140 # -- Set the ip family policy to configure dual-stack see [Configure dual-stack](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services)
142 # -- Sets the families that should be supported and the order in which they should be applied to ClusterIP as well. Can be IPv4 and/or IPv6.
145# If you want to specify resources, uncomment the following
146# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
156 # -- EmptyDir options for the scratch-data volume.
158# -- Nodeselector for the operator to be installed.
160# -- Topology Spread Constraints for the operator to be installed.
161topologySpreadConstraints: []
162# -- Tolerations for the operator to be installed.
164# -- Affinity for the operator to be installed.
167 # -- Specifies whether the monitoring should be enabled. Requires Prometheus Operator CRDs.
168 podMonitorEnabled: false
169 # -- Metrics relabel configurations to apply to samples before ingestion.
170 podMonitorMetricRelabelings: []
171 # -- Relabel configurations to apply to samples before scraping.
172 podMonitorRelabelings: []
173 # -- Additional labels for the podMonitor
174 podMonitorAdditionalLabels: {}
177 # -- Allows overriding the namespace where the ConfigMap will be created, defaulting to the same one as the Release.
179 # -- The name of the ConfigMap containing the dashboard.
180 configMapName: "cnpg-grafana-dashboard"
181 # -- Label that ConfigMaps should have to be loaded as dashboards. DEPRECATED: Use labels instead.
182 sidecarLabel: "grafana_dashboard"
183 # -- Label value that ConfigMaps should have to be loaded as dashboards. DEPRECATED: Use labels instead.
184 sidecarLabelValue: "1"
185 # -- Labels that ConfigMaps should have to get configured in Grafana.
187 # -- Annotations that ConfigMaps can have to get configured in Grafana.
189# Default monitoring queries
190monitoringQueriesConfigMap:
191 # -- The name of the default monitoring configmap.
192 name: cnpg-default-monitoring
193 # -- A string representation of a YAML defining monitoring queries.
199 , sa.application_name
201 , COALESCE(sa.count, 0) AS total
202 , COALESCE(sa.max_tx_secs, 0) AS max_tx_duration_seconds
203 FROM ( VALUES ('active')
205 , ('idle in transaction')
206 , ('idle in transaction (aborted)')
207 , ('fastpath function call')
214 , COALESCE(application_name, '') AS application_name
215 , pg_catalog.count(*)
216 , COALESCE(EXTRACT (EPOCH FROM (pg_catalog.max(pg_catalog.now() OPERATOR(pg_catalog.-) xact_start))), 0) AS max_tx_secs
217 FROM pg_catalog.pg_stat_activity
218 GROUP BY datname, state, usename, application_name
219 ) sa ON states.state OPERATOR(pg_catalog.=) sa.state
220 WHERE sa.usename IS NOT NULL
224 description: "Name of the database"
227 description: "Name of the user"
230 description: "Name of the application"
233 description: "State of the backend"
236 description: "Number of backends"
237 - max_tx_duration_seconds:
239 description: "Maximum duration of a transaction in seconds"
243 SELECT pg_catalog.count(*) AS total
244 FROM pg_catalog.pg_locks blocked_locks
245 JOIN pg_catalog.pg_locks blocking_locks
246 ON blocking_locks.locktype OPERATOR(pg_catalog.=) blocked_locks.locktype
247 AND blocking_locks.database IS NOT DISTINCT FROM blocked_locks.database
248 AND blocking_locks.relation IS NOT DISTINCT FROM blocked_locks.relation
249 AND blocking_locks.page IS NOT DISTINCT FROM blocked_locks.page
250 AND blocking_locks.tuple IS NOT DISTINCT FROM blocked_locks.tuple
251 AND blocking_locks.virtualxid IS NOT DISTINCT FROM blocked_locks.virtualxid
252 AND blocking_locks.transactionid IS NOT DISTINCT FROM blocked_locks.transactionid
253 AND blocking_locks.classid IS NOT DISTINCT FROM blocked_locks.classid
254 AND blocking_locks.objid IS NOT DISTINCT FROM blocked_locks.objid
255 AND blocking_locks.objsubid IS NOT DISTINCT FROM blocked_locks.objsubid
256 AND blocking_locks.pid OPERATOR(pg_catalog.<>) blocked_locks.pid
257 JOIN pg_catalog.pg_stat_activity blocking_activity ON blocking_activity.pid OPERATOR(pg_catalog.=) blocking_locks.pid
258 WHERE NOT blocked_locks.granted
262 description: "Total number of backends that are currently waiting on other queries"
267 , pg_catalog.pg_database_size(datname) AS size_bytes
268 , pg_catalog.age(datfrozenxid) AS xid_age
269 , pg_catalog.mxid_age(datminmxid) AS mxid_age
270 FROM pg_catalog.pg_database
275 description: "Name of the database"
278 description: "Disk space used by the database"
281 description: "Number of transactions from the frozen XID to the current one"
284 description: "Number of multiple transactions (Multixact) from the frozen XID to the current one"
288 SELECT EXTRACT(EPOCH FROM pg_postmaster_start_time) AS start_time
289 FROM pg_catalog.pg_postmaster_start_time()
293 description: "Time at which postgres started (based on epoch)"
298 NOT pg_catalog.pg_is_in_recovery()
299 OR pg_catalog.pg_last_wal_receive_lsn() OPERATOR(pg_catalog.=) pg_catalog.pg_last_wal_replay_lsn())
302 EXTRACT(EPOCH FROM (pg_catalog.now() OPERATOR(pg_catalog.-) pg_catalog.pg_last_xact_replay_timestamp())))
304 pg_catalog.pg_is_in_recovery() AS in_recovery,
305 EXISTS (TABLE pg_catalog.pg_stat_wal_receiver) AS is_wal_receiver_up,
306 (SELECT pg_catalog.count(*) FROM pg_catalog.pg_stat_replication) AS streaming_replicas
310 description: "Replication lag behind primary in seconds"
313 description: "Whether the instance is in recovery"
314 - is_wal_receiver_up:
316 description: "Whether the instance wal_receiver is up"
317 - streaming_replicas:
319 description: "Number of streaming replicas connected to the instance"
321 pg_replication_slots:
327 (CASE pg_catalog.pg_is_in_recovery()
328 WHEN TRUE THEN pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_last_wal_receive_lsn(), restart_lsn)
329 ELSE pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), restart_lsn)
330 END) as pg_wal_lsn_diff
331 FROM pg_catalog.pg_replication_slots
336 description: "Name of the replication slot"
339 description: "Type of the replication slot"
342 description: "Name of the database"
345 description: "Flag indicating whether the slot is active"
348 description: "Replication lag in bytes"
352 SELECT archived_count
354 , COALESCE(EXTRACT(EPOCH FROM (pg_catalog.now() OPERATOR(pg_catalog.-) last_archived_time)), -1) AS seconds_since_last_archival
355 , COALESCE(EXTRACT(EPOCH FROM (pg_catalog.now() OPERATOR(pg_catalog.-) last_failed_time)), -1) AS seconds_since_last_failure
356 , COALESCE(EXTRACT(EPOCH FROM last_archived_time), -1) AS last_archived_time
357 , COALESCE(EXTRACT(EPOCH FROM last_failed_time), -1) AS last_failed_time
358 , COALESCE(CAST(CAST('x' OPERATOR(pg_catalog.||) pg_catalog.right(pg_catalog.split_part(last_archived_wal, '.', 1), 16) AS pg_catalog.bit(64)) AS pg_catalog.int8), -1) AS last_archived_wal_start_lsn
359 , COALESCE(CAST(CAST('x' OPERATOR(pg_catalog.||) pg_catalog.right(pg_catalog.split_part(last_failed_wal, '.', 1), 16) AS pg_catalog.bit(64)) AS pg_catalog.int8), -1) AS last_failed_wal_start_lsn
360 , EXTRACT(EPOCH FROM stats_reset) AS stats_reset_time
361 FROM pg_catalog.pg_stat_archiver
363 SELECT NOT pg_catalog.pg_is_in_recovery()
364 OR pg_catalog.current_setting('archive_mode') OPERATOR(pg_catalog.=) 'always'
368 description: "Number of WAL files that have been successfully archived"
371 description: "Number of failed attempts for archiving WAL files"
372 - seconds_since_last_archival:
374 description: "Seconds since the last successful archival operation"
375 - seconds_since_last_failure:
377 description: "Seconds since the last failed archival operation"
378 - last_archived_time:
380 description: "Epoch of the last time WAL archiving succeeded"
383 description: "Epoch of the last time WAL archiving failed"
384 - last_archived_wal_start_lsn:
386 description: "Archived WAL start LSN"
387 - last_failed_wal_start_lsn:
389 description: "Last failed WAL LSN"
392 description: "Time at which these statistics were last reset"
395 runonserver: "<17.0.0"
397 SELECT checkpoints_timed
399 , checkpoint_write_time
400 , checkpoint_sync_time
405 , buffers_backend_fsync
407 FROM pg_catalog.pg_stat_bgwriter
411 description: "Number of scheduled checkpoints that have been performed"
414 description: "Number of requested checkpoints that have been performed"
415 - checkpoint_write_time:
417 description: "Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk, in milliseconds"
418 - checkpoint_sync_time:
420 description: "Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk, in milliseconds"
421 - buffers_checkpoint:
423 description: "Number of buffers written during checkpoints"
426 description: "Number of buffers written by the background writer"
429 description: "Number of times the background writer stopped a cleaning scan because it had written too many buffers"
432 description: "Number of buffers written directly by a backend"
433 - buffers_backend_fsync:
435 description: "Number of times a backend had to execute its own fsync call (normally the background writer handles those even when the backend does its own write)"
438 description: "Number of buffers allocated"
441 runonserver: ">=17.0.0"
442 name: pg_stat_bgwriter
447 , EXTRACT(EPOCH FROM stats_reset) AS stats_reset_time
448 FROM pg_catalog.pg_stat_bgwriter
452 description: "Number of buffers written by the background writer"
455 description: "Number of times the background writer stopped a cleaning scan because it had written too many buffers"
458 description: "Number of buffers allocated"
461 description: "Time at which these statistics were last reset"
463 pg_stat_checkpointer:
464 runonserver: ">=17.0.0"
466 SELECT num_timed AS checkpoints_timed
467 , num_requested AS checkpoints_req
468 , restartpoints_timed
474 , EXTRACT(EPOCH FROM stats_reset) AS stats_reset_time
475 FROM pg_catalog.pg_stat_checkpointer
479 description: "Number of scheduled checkpoints that have been performed"
482 description: "Number of requested checkpoints that have been performed"
483 - restartpoints_timed:
485 description: "Number of scheduled restartpoints due to timeout or after a failed attempt to perform it"
488 description: "Number of requested restartpoints that have been performed"
489 - restartpoints_done:
491 description: "Number of restartpoints that have been performed"
494 description: "Total amount of time that has been spent in the portion of processing checkpoints and restartpoints where files are written to disk, in milliseconds"
497 description: "Total amount of time that has been spent in the portion of processing checkpoints and restartpoints where files are synchronized to disk, in milliseconds"
500 description: "Number of buffers written during checkpoints and restartpoints"
503 description: "Time at which these statistics were last reset"
523 FROM pg_catalog.pg_stat_database
527 description: "Name of this database"
530 description: "Number of transactions in this database that have been committed"
533 description: "Number of transactions in this database that have been rolled back"
536 description: "Number of disk blocks read in this database"
539 description: "Number of times disk blocks were found already in the buffer cache, so that a read was not necessary (this only includes hits in the PostgreSQL buffer cache, not the operating system's file system cache)"
542 description: "Number of rows returned by queries in this database"
545 description: "Number of rows fetched by queries in this database"
548 description: "Number of rows inserted by queries in this database"
551 description: "Number of rows updated by queries in this database"
554 description: "Number of rows deleted by queries in this database"
557 description: "Number of queries canceled due to conflicts with recovery in this database"
560 description: "Number of temporary files created by queries in this database"
563 description: "Total amount of data written to temporary files by queries in this database"
566 description: "Number of deadlocks detected in this database"
569 description: "Time spent reading data file blocks by backends in this database, in milliseconds"
572 description: "Time spent writing data file blocks by backends in this database, in milliseconds"
578 , COALESCE(application_name, '') AS application_name
579 , COALESCE(client_addr::text, '') AS client_addr
580 , COALESCE(client_port::text, '') AS client_port
581 , EXTRACT(EPOCH FROM backend_start) AS backend_start
582 , COALESCE(pg_catalog.age(backend_xmin), 0) AS backend_xmin_age
583 , pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), sent_lsn) AS sent_diff_bytes
584 , pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), write_lsn) AS write_diff_bytes
585 , pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), flush_lsn) AS flush_diff_bytes
586 , COALESCE(pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), replay_lsn),0) AS replay_diff_bytes
587 , COALESCE((EXTRACT(EPOCH FROM write_lag)),0)::float AS write_lag_seconds
588 , COALESCE((EXTRACT(EPOCH FROM flush_lag)),0)::float AS flush_lag_seconds
589 , COALESCE((EXTRACT(EPOCH FROM replay_lag)),0)::float AS replay_lag_seconds
590 FROM pg_catalog.pg_stat_replication
594 description: "Name of the replication user"
597 description: "Name of the application"
600 description: "Client IP address"
603 description: "Client TCP port"
606 description: "Time when this process was started"
609 description: "The age of this standby's xmin horizon"
612 description: "Difference in bytes from the last write-ahead log location sent on this connection"
615 description: "Difference in bytes from the last write-ahead log location written to disk by this standby server"
618 description: "Difference in bytes from the last write-ahead log location flushed to disk by this standby server"
621 description: "Difference in bytes from the last write-ahead log location replayed into the database on this standby server"
624 description: "Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written it"
627 description: "Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written and flushed it"
628 - replay_lag_seconds:
630 description: "Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written, flushed and applied it"
635 CASE setting WHEN 'on' THEN '1' WHEN 'off' THEN '0' ELSE setting END AS setting
636 FROM pg_catalog.pg_settings
637 WHERE vartype IN ('integer', 'real', 'bool')
642 description: "Name of the setting"
645 description: "Setting value"
650 pg_catalog.current_database() as datname,
655 WHEN default_version OPERATOR(pg_catalog.=) installed_version THEN 0
657 END AS update_available
658 FROM pg_catalog.pg_available_extensions
659 WHERE installed_version IS NOT NULL
663 description: "Name of the database"
666 description: "Extension name"
669 description: "Default version"
672 description: "Installed version"
675 description: "An update is available"