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: cgr.dev/chainguard-private/cloudnative-pg-fips
26 pullPolicy: IfNotPresent
27 # -- Overrides the image tag whose default is the chart appVersion.
28 tag: latest@sha256:1a7b98c02ae10770e72b1d906e14776200daab09b609f8ac81180dc92773ee0e
35# -- Update strategy for the operator.
36# ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy
44 # -- Specifies whether the CRDs should be created when installing the chart.
46# -- The webhook configuration.
56 initialDelaySeconds: 3
58 initialDelaySeconds: 3
62# Operator configuration.
64 # -- Specifies whether the secret should be created.
66 # -- The name of the configmap/secret to use.
67 name: cnpg-controller-manager-config
68 # -- Specifies whether it should be stored in a secret, instead of a configmap.
70 # -- This option determines if the operator is responsible for observing
71 # events across the entire Kubernetes cluster or if its focus should be
72 # narrowed down to the specific namespace within which it has been deployed.
74 # -- The content of the configmap/secret, see
75 # https://cloudnative-pg.io/documentation/current/operator_conf/#available-options
76 # for all the available options.
78 # INHERITED_ANNOTATIONS: categories
79 # INHERITED_LABELS: environment, workload, app
80 # WATCH_NAMESPACE: namespace-a,namespace-b
81 # -- The maximum number of concurrent reconciles. Defaults to 10.
82 maxConcurrentReconciles: 10
83# -- Additional arguments to be added to the operator's args list.
85# -- Array containing extra environment variables which can be templated.
88# value: "{{ .Release.Name }}"
90# value: "mySpecialKey"
93 # -- Specifies whether the service account should be created.
95 # -- The name of the service account to use.
96 # If not set and create is true, a name is generated using the fullname template.
99 # -- Specifies whether ClusterRole and ClusterRoleBinding should be created.
101 # -- Aggregate ClusterRoles to Kubernetes default user-facing roles.
102 # Ref: https://kubernetes.io/docs/reference/access-authn-authz/rbac/#user-facing-roles
103 aggregateClusterRoles: false
104# -- Annotations to be added to all other resources.
106# -- Annotations to be added to the pod.
108# -- Labels to be added to the pod.
110# -- Container Security Context.
111containerSecurityContext:
112 allowPrivilegeEscalation: false
113 readOnlyRootFilesystem: true
121# -- Security Context for the whole pod.
127# -- Priority indicates the importance of a Pod relative to other Pods.
131 # -- DO NOT CHANGE THE SERVICE NAME as it is currently used to generate the certificate
132 # and can not be configured
133 name: cnpg-webhook-service
135 # -- Set the ip family policy to configure dual-stack see [Configure dual-stack](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services)
137 # -- 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.
140# If you want to specify resources, uncomment the following
141# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
150# -- Nodeselector for the operator to be installed.
152# -- Topology Spread Constraints for the operator to be installed.
153topologySpreadConstraints: []
154# -- Tolerations for the operator to be installed.
156# -- Affinity for the operator to be installed.
159 # -- Specifies whether the monitoring should be enabled. Requires Prometheus Operator CRDs.
160 podMonitorEnabled: false
161 # -- Metrics relabel configurations to apply to samples before ingestion.
162 podMonitorMetricRelabelings: []
163 # -- Relabel configurations to apply to samples before scraping.
164 podMonitorRelabelings: []
165 # -- Additional labels for the podMonitor
166 podMonitorAdditionalLabels: {}
169 # -- Allows overriding the namespace where the ConfigMap will be created, defaulting to the same one as the Release.
171 # -- The name of the ConfigMap containing the dashboard.
172 configMapName: "cnpg-grafana-dashboard"
173 # -- Label that ConfigMaps should have to be loaded as dashboards. DEPRECATED: Use labels instead.
174 sidecarLabel: "grafana_dashboard"
175 # -- Label value that ConfigMaps should have to be loaded as dashboards. DEPRECATED: Use labels instead.
176 sidecarLabelValue: "1"
177 # -- Labels that ConfigMaps should have to get configured in Grafana.
179 # -- Annotations that ConfigMaps can have to get configured in Grafana.
181# Default monitoring queries
182monitoringQueriesConfigMap:
183 # -- The name of the default monitoring configmap.
184 name: cnpg-default-monitoring
185 # -- A string representation of a YAML defining monitoring queries.
191 , sa.application_name
193 , COALESCE(sa.count, 0) AS total
194 , COALESCE(sa.max_tx_secs, 0) AS max_tx_duration_seconds
195 FROM ( VALUES ('active')
197 , ('idle in transaction')
198 , ('idle in transaction (aborted)')
199 , ('fastpath function call')
206 , COALESCE(application_name, '') AS application_name
208 , COALESCE(EXTRACT (EPOCH FROM (max(now() - xact_start))), 0) AS max_tx_secs
209 FROM pg_catalog.pg_stat_activity
210 GROUP BY datname, state, usename, application_name
211 ) sa ON states.state = sa.state
212 WHERE sa.usename IS NOT NULL
216 description: "Name of the database"
219 description: "Name of the user"
222 description: "Name of the application"
225 description: "State of the backend"
228 description: "Number of backends"
229 - max_tx_duration_seconds:
231 description: "Maximum duration of a transaction in seconds"
235 SELECT count(*) AS total
236 FROM pg_catalog.pg_locks blocked_locks
237 JOIN pg_catalog.pg_locks blocking_locks
238 ON blocking_locks.locktype = blocked_locks.locktype
239 AND blocking_locks.database IS NOT DISTINCT FROM blocked_locks.database
240 AND blocking_locks.relation IS NOT DISTINCT FROM blocked_locks.relation
241 AND blocking_locks.page IS NOT DISTINCT FROM blocked_locks.page
242 AND blocking_locks.tuple IS NOT DISTINCT FROM blocked_locks.tuple
243 AND blocking_locks.virtualxid IS NOT DISTINCT FROM blocked_locks.virtualxid
244 AND blocking_locks.transactionid IS NOT DISTINCT FROM blocked_locks.transactionid
245 AND blocking_locks.classid IS NOT DISTINCT FROM blocked_locks.classid
246 AND blocking_locks.objid IS NOT DISTINCT FROM blocked_locks.objid
247 AND blocking_locks.objsubid IS NOT DISTINCT FROM blocked_locks.objsubid
248 AND blocking_locks.pid != blocked_locks.pid
249 JOIN pg_catalog.pg_stat_activity blocking_activity ON blocking_activity.pid = blocking_locks.pid
250 WHERE NOT blocked_locks.granted
254 description: "Total number of backends that are currently waiting on other queries"
259 , pg_catalog.pg_database_size(datname) AS size_bytes
260 , pg_catalog.age(datfrozenxid) AS xid_age
261 , pg_catalog.mxid_age(datminmxid) AS mxid_age
262 FROM pg_catalog.pg_database
267 description: "Name of the database"
270 description: "Disk space used by the database"
273 description: "Number of transactions from the frozen XID to the current one"
276 description: "Number of multiple transactions (Multixact) from the frozen XID to the current one"
280 SELECT EXTRACT(EPOCH FROM pg_postmaster_start_time) AS start_time
281 FROM pg_catalog.pg_postmaster_start_time()
285 description: "Time at which postgres started (based on epoch)"
290 NOT pg_catalog.pg_is_in_recovery()
291 OR pg_catalog.pg_last_wal_receive_lsn() = pg_catalog.pg_last_wal_replay_lsn())
294 EXTRACT(EPOCH FROM (now() - pg_catalog.pg_last_xact_replay_timestamp())))
296 pg_catalog.pg_is_in_recovery() AS in_recovery,
297 EXISTS (TABLE pg_stat_wal_receiver) AS is_wal_receiver_up,
298 (SELECT count(*) FROM pg_catalog.pg_stat_replication) AS streaming_replicas
302 description: "Replication lag behind primary in seconds"
305 description: "Whether the instance is in recovery"
306 - is_wal_receiver_up:
308 description: "Whether the instance wal_receiver is up"
309 - streaming_replicas:
311 description: "Number of streaming replicas connected to the instance"
313 pg_replication_slots:
319 (CASE pg_catalog.pg_is_in_recovery()
320 WHEN TRUE THEN pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_last_wal_receive_lsn(), restart_lsn)
321 ELSE pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), restart_lsn)
322 END) as pg_wal_lsn_diff
323 FROM pg_catalog.pg_replication_slots
328 description: "Name of the replication slot"
331 description: "Type of the replication slot"
334 description: "Name of the database"
337 description: "Flag indicating whether the slot is active"
340 description: "Replication lag in bytes"
344 SELECT archived_count
346 , COALESCE(EXTRACT(EPOCH FROM (now() - last_archived_time)), -1) AS seconds_since_last_archival
347 , COALESCE(EXTRACT(EPOCH FROM (now() - last_failed_time)), -1) AS seconds_since_last_failure
348 , COALESCE(EXTRACT(EPOCH FROM last_archived_time), -1) AS last_archived_time
349 , COALESCE(EXTRACT(EPOCH FROM last_failed_time), -1) AS last_failed_time
350 , COALESCE(CAST(CAST('x'||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
351 , COALESCE(CAST(CAST('x'||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
352 , EXTRACT(EPOCH FROM stats_reset) AS stats_reset_time
353 FROM pg_catalog.pg_stat_archiver
355 SELECT NOT pg_catalog.pg_is_in_recovery()
356 OR pg_catalog.current_setting('archive_mode') = 'always'
360 description: "Number of WAL files that have been successfully archived"
363 description: "Number of failed attempts for archiving WAL files"
364 - seconds_since_last_archival:
366 description: "Seconds since the last successful archival operation"
367 - seconds_since_last_failure:
369 description: "Seconds since the last failed archival operation"
370 - last_archived_time:
372 description: "Epoch of the last time WAL archiving succeeded"
375 description: "Epoch of the last time WAL archiving failed"
376 - last_archived_wal_start_lsn:
378 description: "Archived WAL start LSN"
379 - last_failed_wal_start_lsn:
381 description: "Last failed WAL LSN"
384 description: "Time at which these statistics were last reset"
387 runonserver: "<17.0.0"
389 SELECT checkpoints_timed
391 , checkpoint_write_time
392 , checkpoint_sync_time
397 , buffers_backend_fsync
399 FROM pg_catalog.pg_stat_bgwriter
403 description: "Number of scheduled checkpoints that have been performed"
406 description: "Number of requested checkpoints that have been performed"
407 - checkpoint_write_time:
409 description: "Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk, in milliseconds"
410 - checkpoint_sync_time:
412 description: "Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk, in milliseconds"
413 - buffers_checkpoint:
415 description: "Number of buffers written during checkpoints"
418 description: "Number of buffers written by the background writer"
421 description: "Number of times the background writer stopped a cleaning scan because it had written too many buffers"
424 description: "Number of buffers written directly by a backend"
425 - buffers_backend_fsync:
427 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)"
430 description: "Number of buffers allocated"
433 runonserver: ">=17.0.0"
434 name: pg_stat_bgwriter
439 , EXTRACT(EPOCH FROM stats_reset) AS stats_reset_time
440 FROM pg_catalog.pg_stat_bgwriter
444 description: "Number of buffers written by the background writer"
447 description: "Number of times the background writer stopped a cleaning scan because it had written too many buffers"
450 description: "Number of buffers allocated"
453 description: "Time at which these statistics were last reset"
455 pg_stat_checkpointer:
456 runonserver: ">=17.0.0"
458 SELECT num_timed AS checkpoints_timed
459 , num_requested AS checkpoints_req
460 , restartpoints_timed
466 , EXTRACT(EPOCH FROM stats_reset) AS stats_reset_time
467 FROM pg_catalog.pg_stat_checkpointer
471 description: "Number of scheduled checkpoints that have been performed"
474 description: "Number of requested checkpoints that have been performed"
475 - restartpoints_timed:
477 description: "Number of scheduled restartpoints due to timeout or after a failed attempt to perform it"
480 description: "Number of requested restartpoints that have been performed"
481 - restartpoints_done:
483 description: "Number of restartpoints that have been performed"
486 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"
489 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"
492 description: "Number of buffers written during checkpoints and restartpoints"
495 description: "Time at which these statistics were last reset"
515 FROM pg_catalog.pg_stat_database
519 description: "Name of this database"
522 description: "Number of transactions in this database that have been committed"
525 description: "Number of transactions in this database that have been rolled back"
528 description: "Number of disk blocks read in this database"
531 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)"
534 description: "Number of rows returned by queries in this database"
537 description: "Number of rows fetched by queries in this database"
540 description: "Number of rows inserted by queries in this database"
543 description: "Number of rows updated by queries in this database"
546 description: "Number of rows deleted by queries in this database"
549 description: "Number of queries canceled due to conflicts with recovery in this database"
552 description: "Number of temporary files created by queries in this database"
555 description: "Total amount of data written to temporary files by queries in this database"
558 description: "Number of deadlocks detected in this database"
561 description: "Time spent reading data file blocks by backends in this database, in milliseconds"
564 description: "Time spent writing data file blocks by backends in this database, in milliseconds"
570 , COALESCE(application_name, '') AS application_name
571 , COALESCE(client_addr::text, '') AS client_addr
572 , COALESCE(client_port::text, '') AS client_port
573 , EXTRACT(EPOCH FROM backend_start) AS backend_start
574 , COALESCE(pg_catalog.age(backend_xmin), 0) AS backend_xmin_age
575 , pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), sent_lsn) AS sent_diff_bytes
576 , pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), write_lsn) AS write_diff_bytes
577 , pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), flush_lsn) AS flush_diff_bytes
578 , COALESCE(pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), replay_lsn),0) AS replay_diff_bytes
579 , COALESCE((EXTRACT(EPOCH FROM write_lag)),0)::float AS write_lag_seconds
580 , COALESCE((EXTRACT(EPOCH FROM flush_lag)),0)::float AS flush_lag_seconds
581 , COALESCE((EXTRACT(EPOCH FROM replay_lag)),0)::float AS replay_lag_seconds
582 FROM pg_catalog.pg_stat_replication
586 description: "Name of the replication user"
589 description: "Name of the application"
592 description: "Client IP address"
595 description: "Client TCP port"
598 description: "Time when this process was started"
601 description: "The age of this standby's xmin horizon"
604 description: "Difference in bytes from the last write-ahead log location sent on this connection"
607 description: "Difference in bytes from the last write-ahead log location written to disk by this standby server"
610 description: "Difference in bytes from the last write-ahead log location flushed to disk by this standby server"
613 description: "Difference in bytes from the last write-ahead log location replayed into the database on this standby server"
616 description: "Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written it"
619 description: "Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written and flushed it"
620 - replay_lag_seconds:
622 description: "Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written, flushed and applied it"
627 CASE setting WHEN 'on' THEN '1' WHEN 'off' THEN '0' ELSE setting END AS setting
628 FROM pg_catalog.pg_settings
629 WHERE vartype IN ('integer', 'real', 'bool')
634 description: "Name of the setting"
637 description: "Setting value"
642 current_database() as datname,
647 WHEN default_version = installed_version THEN 0
649 END AS update_available
650 FROM pg_catalog.pg_available_extensions
651 WHERE installed_version IS NOT NULL
655 description: "Name of the database"
658 description: "Extension name"
661 description: "Default version"
664 description: "Installed version"
667 description: "An update is available"