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-fips
26 pullPolicy: IfNotPresent
27 # -- Overrides the image tag whose default is the chart appVersion.
28 tag: latest@sha256:4f6b4dc7103b6090e06e03140fbdb3e9144f41ba005014a6212a3c470054fa89
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:'.
155# -- Nodeselector for the operator to be installed.
157# -- Topology Spread Constraints for the operator to be installed.
158topologySpreadConstraints: []
159# -- Tolerations for the operator to be installed.
161# -- Affinity for the operator to be installed.
164 # -- Specifies whether the monitoring should be enabled. Requires Prometheus Operator CRDs.
165 podMonitorEnabled: false
166 # -- Metrics relabel configurations to apply to samples before ingestion.
167 podMonitorMetricRelabelings: []
168 # -- Relabel configurations to apply to samples before scraping.
169 podMonitorRelabelings: []
170 # -- Additional labels for the podMonitor
171 podMonitorAdditionalLabels: {}
174 # -- Allows overriding the namespace where the ConfigMap will be created, defaulting to the same one as the Release.
176 # -- The name of the ConfigMap containing the dashboard.
177 configMapName: "cnpg-grafana-dashboard"
178 # -- Label that ConfigMaps should have to be loaded as dashboards. DEPRECATED: Use labels instead.
179 sidecarLabel: "grafana_dashboard"
180 # -- Label value that ConfigMaps should have to be loaded as dashboards. DEPRECATED: Use labels instead.
181 sidecarLabelValue: "1"
182 # -- Labels that ConfigMaps should have to get configured in Grafana.
184 # -- Annotations that ConfigMaps can have to get configured in Grafana.
186# Default monitoring queries
187monitoringQueriesConfigMap:
188 # -- The name of the default monitoring configmap.
189 name: cnpg-default-monitoring
190 # -- A string representation of a YAML defining monitoring queries.
196 , sa.application_name
198 , COALESCE(sa.count, 0) AS total
199 , COALESCE(sa.max_tx_secs, 0) AS max_tx_duration_seconds
200 FROM ( VALUES ('active')
202 , ('idle in transaction')
203 , ('idle in transaction (aborted)')
204 , ('fastpath function call')
211 , COALESCE(application_name, '') AS application_name
212 , pg_catalog.count(*)
213 , COALESCE(EXTRACT (EPOCH FROM (pg_catalog.max(pg_catalog.now() OPERATOR(pg_catalog.-) xact_start))), 0) AS max_tx_secs
214 FROM pg_catalog.pg_stat_activity
215 GROUP BY datname, state, usename, application_name
216 ) sa ON states.state OPERATOR(pg_catalog.=) sa.state
217 WHERE sa.usename IS NOT NULL
221 description: "Name of the database"
224 description: "Name of the user"
227 description: "Name of the application"
230 description: "State of the backend"
233 description: "Number of backends"
234 - max_tx_duration_seconds:
236 description: "Maximum duration of a transaction in seconds"
240 SELECT pg_catalog.count(*) AS total
241 FROM pg_catalog.pg_locks blocked_locks
242 JOIN pg_catalog.pg_locks blocking_locks
243 ON blocking_locks.locktype OPERATOR(pg_catalog.=) blocked_locks.locktype
244 AND blocking_locks.database IS NOT DISTINCT FROM blocked_locks.database
245 AND blocking_locks.relation IS NOT DISTINCT FROM blocked_locks.relation
246 AND blocking_locks.page IS NOT DISTINCT FROM blocked_locks.page
247 AND blocking_locks.tuple IS NOT DISTINCT FROM blocked_locks.tuple
248 AND blocking_locks.virtualxid IS NOT DISTINCT FROM blocked_locks.virtualxid
249 AND blocking_locks.transactionid IS NOT DISTINCT FROM blocked_locks.transactionid
250 AND blocking_locks.classid IS NOT DISTINCT FROM blocked_locks.classid
251 AND blocking_locks.objid IS NOT DISTINCT FROM blocked_locks.objid
252 AND blocking_locks.objsubid IS NOT DISTINCT FROM blocked_locks.objsubid
253 AND blocking_locks.pid OPERATOR(pg_catalog.<>) blocked_locks.pid
254 JOIN pg_catalog.pg_stat_activity blocking_activity ON blocking_activity.pid OPERATOR(pg_catalog.=) blocking_locks.pid
255 WHERE NOT blocked_locks.granted
259 description: "Total number of backends that are currently waiting on other queries"
264 , pg_catalog.pg_database_size(datname) AS size_bytes
265 , pg_catalog.age(datfrozenxid) AS xid_age
266 , pg_catalog.mxid_age(datminmxid) AS mxid_age
267 FROM pg_catalog.pg_database
272 description: "Name of the database"
275 description: "Disk space used by the database"
278 description: "Number of transactions from the frozen XID to the current one"
281 description: "Number of multiple transactions (Multixact) from the frozen XID to the current one"
285 SELECT EXTRACT(EPOCH FROM pg_postmaster_start_time) AS start_time
286 FROM pg_catalog.pg_postmaster_start_time()
290 description: "Time at which postgres started (based on epoch)"
295 NOT pg_catalog.pg_is_in_recovery()
296 OR pg_catalog.pg_last_wal_receive_lsn() OPERATOR(pg_catalog.=) pg_catalog.pg_last_wal_replay_lsn())
299 EXTRACT(EPOCH FROM (pg_catalog.now() OPERATOR(pg_catalog.-) pg_catalog.pg_last_xact_replay_timestamp())))
301 pg_catalog.pg_is_in_recovery() AS in_recovery,
302 EXISTS (TABLE pg_catalog.pg_stat_wal_receiver) AS is_wal_receiver_up,
303 (SELECT pg_catalog.count(*) FROM pg_catalog.pg_stat_replication) AS streaming_replicas
307 description: "Replication lag behind primary in seconds"
310 description: "Whether the instance is in recovery"
311 - is_wal_receiver_up:
313 description: "Whether the instance wal_receiver is up"
314 - streaming_replicas:
316 description: "Number of streaming replicas connected to the instance"
318 pg_replication_slots:
324 (CASE pg_catalog.pg_is_in_recovery()
325 WHEN TRUE THEN pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_last_wal_receive_lsn(), restart_lsn)
326 ELSE pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), restart_lsn)
327 END) as pg_wal_lsn_diff
328 FROM pg_catalog.pg_replication_slots
333 description: "Name of the replication slot"
336 description: "Type of the replication slot"
339 description: "Name of the database"
342 description: "Flag indicating whether the slot is active"
345 description: "Replication lag in bytes"
349 SELECT archived_count
351 , COALESCE(EXTRACT(EPOCH FROM (pg_catalog.now() OPERATOR(pg_catalog.-) last_archived_time)), -1) AS seconds_since_last_archival
352 , COALESCE(EXTRACT(EPOCH FROM (pg_catalog.now() OPERATOR(pg_catalog.-) last_failed_time)), -1) AS seconds_since_last_failure
353 , COALESCE(EXTRACT(EPOCH FROM last_archived_time), -1) AS last_archived_time
354 , COALESCE(EXTRACT(EPOCH FROM last_failed_time), -1) AS last_failed_time
355 , 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
356 , 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
357 , EXTRACT(EPOCH FROM stats_reset) AS stats_reset_time
358 FROM pg_catalog.pg_stat_archiver
360 SELECT NOT pg_catalog.pg_is_in_recovery()
361 OR pg_catalog.current_setting('archive_mode') OPERATOR(pg_catalog.=) 'always'
365 description: "Number of WAL files that have been successfully archived"
368 description: "Number of failed attempts for archiving WAL files"
369 - seconds_since_last_archival:
371 description: "Seconds since the last successful archival operation"
372 - seconds_since_last_failure:
374 description: "Seconds since the last failed archival operation"
375 - last_archived_time:
377 description: "Epoch of the last time WAL archiving succeeded"
380 description: "Epoch of the last time WAL archiving failed"
381 - last_archived_wal_start_lsn:
383 description: "Archived WAL start LSN"
384 - last_failed_wal_start_lsn:
386 description: "Last failed WAL LSN"
389 description: "Time at which these statistics were last reset"
392 runonserver: "<17.0.0"
394 SELECT checkpoints_timed
396 , checkpoint_write_time
397 , checkpoint_sync_time
402 , buffers_backend_fsync
404 FROM pg_catalog.pg_stat_bgwriter
408 description: "Number of scheduled checkpoints that have been performed"
411 description: "Number of requested checkpoints that have been performed"
412 - checkpoint_write_time:
414 description: "Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk, in milliseconds"
415 - checkpoint_sync_time:
417 description: "Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk, in milliseconds"
418 - buffers_checkpoint:
420 description: "Number of buffers written during checkpoints"
423 description: "Number of buffers written by the background writer"
426 description: "Number of times the background writer stopped a cleaning scan because it had written too many buffers"
429 description: "Number of buffers written directly by a backend"
430 - buffers_backend_fsync:
432 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)"
435 description: "Number of buffers allocated"
438 runonserver: ">=17.0.0"
439 name: pg_stat_bgwriter
444 , EXTRACT(EPOCH FROM stats_reset) AS stats_reset_time
445 FROM pg_catalog.pg_stat_bgwriter
449 description: "Number of buffers written by the background writer"
452 description: "Number of times the background writer stopped a cleaning scan because it had written too many buffers"
455 description: "Number of buffers allocated"
458 description: "Time at which these statistics were last reset"
460 pg_stat_checkpointer:
461 runonserver: ">=17.0.0"
463 SELECT num_timed AS checkpoints_timed
464 , num_requested AS checkpoints_req
465 , restartpoints_timed
471 , EXTRACT(EPOCH FROM stats_reset) AS stats_reset_time
472 FROM pg_catalog.pg_stat_checkpointer
476 description: "Number of scheduled checkpoints that have been performed"
479 description: "Number of requested checkpoints that have been performed"
480 - restartpoints_timed:
482 description: "Number of scheduled restartpoints due to timeout or after a failed attempt to perform it"
485 description: "Number of requested restartpoints that have been performed"
486 - restartpoints_done:
488 description: "Number of restartpoints that have been performed"
491 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"
494 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"
497 description: "Number of buffers written during checkpoints and restartpoints"
500 description: "Time at which these statistics were last reset"
520 FROM pg_catalog.pg_stat_database
524 description: "Name of this database"
527 description: "Number of transactions in this database that have been committed"
530 description: "Number of transactions in this database that have been rolled back"
533 description: "Number of disk blocks read in this database"
536 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)"
539 description: "Number of rows returned by queries in this database"
542 description: "Number of rows fetched by queries in this database"
545 description: "Number of rows inserted by queries in this database"
548 description: "Number of rows updated by queries in this database"
551 description: "Number of rows deleted by queries in this database"
554 description: "Number of queries canceled due to conflicts with recovery in this database"
557 description: "Number of temporary files created by queries in this database"
560 description: "Total amount of data written to temporary files by queries in this database"
563 description: "Number of deadlocks detected in this database"
566 description: "Time spent reading data file blocks by backends in this database, in milliseconds"
569 description: "Time spent writing data file blocks by backends in this database, in milliseconds"
575 , COALESCE(application_name, '') AS application_name
576 , COALESCE(client_addr::text, '') AS client_addr
577 , COALESCE(client_port::text, '') AS client_port
578 , EXTRACT(EPOCH FROM backend_start) AS backend_start
579 , COALESCE(pg_catalog.age(backend_xmin), 0) AS backend_xmin_age
580 , pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), sent_lsn) AS sent_diff_bytes
581 , pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), write_lsn) AS write_diff_bytes
582 , pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), flush_lsn) AS flush_diff_bytes
583 , COALESCE(pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), replay_lsn),0) AS replay_diff_bytes
584 , COALESCE((EXTRACT(EPOCH FROM write_lag)),0)::float AS write_lag_seconds
585 , COALESCE((EXTRACT(EPOCH FROM flush_lag)),0)::float AS flush_lag_seconds
586 , COALESCE((EXTRACT(EPOCH FROM replay_lag)),0)::float AS replay_lag_seconds
587 FROM pg_catalog.pg_stat_replication
591 description: "Name of the replication user"
594 description: "Name of the application"
597 description: "Client IP address"
600 description: "Client TCP port"
603 description: "Time when this process was started"
606 description: "The age of this standby's xmin horizon"
609 description: "Difference in bytes from the last write-ahead log location sent on this connection"
612 description: "Difference in bytes from the last write-ahead log location written to disk by this standby server"
615 description: "Difference in bytes from the last write-ahead log location flushed to disk by this standby server"
618 description: "Difference in bytes from the last write-ahead log location replayed into the database on this standby server"
621 description: "Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written it"
624 description: "Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written and flushed it"
625 - replay_lag_seconds:
627 description: "Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written, flushed and applied it"
632 CASE setting WHEN 'on' THEN '1' WHEN 'off' THEN '0' ELSE setting END AS setting
633 FROM pg_catalog.pg_settings
634 WHERE vartype IN ('integer', 'real', 'bool')
639 description: "Name of the setting"
642 description: "Setting value"
647 pg_catalog.current_database() as datname,
652 WHEN default_version OPERATOR(pg_catalog.=) installed_version THEN 0
654 END AS update_available
655 FROM pg_catalog.pg_available_extensions
656 WHERE installed_version IS NOT NULL
660 description: "Name of the database"
663 description: "Extension name"
666 description: "Default version"
669 description: "Installed version"
672 description: "An update is available"