# yaml-language-server: $schema=./values.schema.json

# Default values for cnpg-cluster.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

# @param {number} [instances] Number of Postgres instances in the cluster
instances: 1

# @param {string} [logLevel] The instances log level, one of the following values: error, warning, info (default), debug, trace
logLevel: info

# @param {object} [annotations] CNPG cluster annotations
annotations: {}

# @param {object} [image] Docker image for the PG instances
image:
  # @param {string} [repository] CNPG compatible Postgres image. see https://github.com/cloudnative-pg/postgres-containers
  repository: "ghcr.io/cloudnative-pg/postgis"
  # @param {string} [pullPolicy] Docker image pull policy. see https://kubernetes.io/docs/concepts/containers/images#updating-images
  pullPolicy: IfNotPresent
  # @param {string} [tag] Docker image tag
  tag: "15"

# @param {array} [imagePullSecrets] docker image pull secrets. see https://kubernetes.io/fr/docs/tasks/configure-pod-container/pull-image-private-registry/
imagePullSecrets: []

# @param {object,null} [registryCredentials]
registryCredentials:
# Eg:
#   mygitlab:
#     registry: gitlab-registry.example.org
#     email: foo@example.org
#     username: foobar
#     password: secret

# @param {string} [nameOverride] String to partially override cnpg-cluster.fullname template with a string (will prepend the release name)
nameOverride: ""

# @param {string} [fullnameOverride] String to fully override cnpg-cluster.fullname template with a string
fullnameOverride: ""

# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# @param {https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.24.0/_definitions.json#/definitions/io.k8s.api.core.v1.ResourceRequirements} [resources] CPU/Memory resource requests/limits
resources:
  {}
  # limits:
  #   cpu: 100m
  #   memory: 128Mi
  # requests:
  #   cpu: 100m
  #   memory: 128Mi

# @param {object} [nodeSelector] Postgres instances labels for pod assignment
nodeSelector: {}

# Name of the priority class which will be used in every generated Pod, if the PriorityClass specified does not exist, the pod will not be able to schedule. Please refer to https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass for more information
# @param {string} [priorityClassName] Name of the priority class which will be used in every generated Pod
priorityClassName: ""

# @param {array} [tolerations] Postgres instances labels for tolerations pod assignment
tolerations: []

# @param {object} [extraAffinity] Extra configuration for Cluster's affinity resource, see: https://cloudnative-pg.io/documentation/1.17/api_reference/#AffinityConfiguration
extraAffinity: {}

# @param {object} [persistence] Data persistence configuration
persistence:
  # @param {string} [size] Size of each instance storage volume
  size: 8Gi
  # @param {boolean,null} [resizeInUseVolumes] Resize existent PVCs, defaults to true
  resizeInUseVolumes:
  # Applied after evaluating the PVC template, if available.
  # If not specified, generated PVCs will be satisfied by the default storage class
  # @param {string} [storageClass] StorageClass to use for database data,
  storageClass: ""
  # @param {object} [pvcTemplate] Template to be used to generate the Persistent Volume Claim
  pvcTemplate: {}

# @param {object} [backup] Backup configuration
backup:
  # @param {boolean} [enabled] Enable backups
  enabled: false

  # this cron format has the seconds on the left
  # @param {string} [schedule] Schedule the backups, for instance every day at midnight
  schedule: "0 0 0 * * 0"

  # The retention policy is expressed in the form of XXu where XX is a positive integer and
  # u is in [dwm] - days, weeks, months.
  # @param {string} [retentionPolicy] RetentionPolicy is the retention policy to be used for backups and WALs (i.e. '60d').
  retentionPolicy: 30d

  # @param {boolean} [enabled] If the first backup has to be immediately start after creation or not
  immediate: true

  # See: https://cloudnative-pg.io/documentation/1.20/backup_recovery/
  # @param {object,null} [barmanObjectStore] Object store credentials and access config
  barmanObjectStore:
    # destinationPath:
    # endpointURL:
    # s3Credentials:
    #   accessKeyId:
    #     name:
    #     key:
    #   secretAccessKey:
    #     name:
    #     key:
    #   region:
    #     name:
    #     key:

# @param {object} [clusterExtraSpec] Extra configuration for Cluster resource. See: https://cloudnative-pg.io/documentation/1.17/api_reference/#clusterspec
clusterExtraSpec: {}

# @param {object} [scheduledBackups] ScheduledBackup resources to create for this Cluster resource. See: https://cloudnative-pg.io/documentation/1.17/api_reference/#ScheduledBackupSpec
scheduledBackups: {}
# Eg:
#   daily:
#     schedule: "0 0 0 * * *"

# @param {object} [poolers] Pooler resources to create for this Cluster resource. See: https://cloudnative-pg.io/documentation/1.17/api_reference/#PoolerSpec
poolers: {}
# Eg:
#   rw:
#     instances: 3
#     type: rw
#     pgbouncer:
#       poolMode: session
#       parameters:
#         max_client_conn: "1000"
#         default_pool_size: "10"

# @param {number} [minSyncReplicas] Minimum of synchronous replicas. see https://cloudnative-pg.io/documentation/current/replication/#synchronous-replication
minSyncReplicas: 0
# @param {number} [maxSyncReplicas] Maximum of synchronous replicas. see https://cloudnative-pg.io/documentation/current/replication/#synchronous-replication
maxSyncReplicas: 0

# @param {array} [pg_hba] pg_hba entries. See https://www.postgresql.org/docs/9.3/auth-pg-hba-conf.html
pg_hba: []

# Define your parameters on https://pgtune.leopard.in.ua
# @param {https://raw.githubusercontent.com/SocialGouv/json-schemas/main/postgres/parameters.json} [postgresqlParameters] PostgreSQL parameters. See https://www.postgresql.org/docs/9.3/auth-pg-hba-conf.html
postgresqlParameters: {}

# @param {array} [sharedPreloadLibraries] PostgreSQL shared preload libraries. See https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-PostgresConfiguration
sharedPreloadLibraries: {}

# @param {array} [externalClusters] define external clusters for recovery/replication see https://cloudnative-pg.io/documentation/current/api_reference/#externalcluster
externalClusters: []

# @param {object} [replica] Replica mode
replica:
  # @param {boolean} [enabled] Enable replica mode
  enabled: false

# @param {object} [pg_basebackup] Enable pg_basebackup on bootstrap, see https://cloudnative-pg.io/documentation/current/bootstrap/#bootstrap-from-a-live-cluster-pg_basebackup
pg_basebackup:
  # @param {boolean} [enabled] Enable pg_basebackup bootstrap, see https://cloudnative-pg.io/documentation/current/bootstrap/#bootstrap-from-a-live-cluster-pg_basebackup
  enabled: false
  # @param {string,null} [source] externalCluster cluster name for the pg_basebackup
  source:

# @param {https://raw.githubusercontent.com/SocialGouv/json-schemas/main/postgres/extensions.json} [extensions]
extensions: []

postgresqlInitCommandsBeforeExtensions: []
postgresqlInitCommands: []

# @param {string} [dbName] Name of the default database to create
dbName: app
# @param {string} [dbName] Name of the default user to create
dbOwner: app

# @param {object} [monitoring] Monitoring. see https://cloudnative-pg.io/documentation/current/monitoring/
monitoring:
  # @param {boolean} [enablePodMonitor] Enable metrics monitoring. see https://cloudnative-pg.io/documentation/current/monitoring/
  enablePodMonitor: false

# @param {string,null} [superuserSecretName] To force the super user secret name
superuserSecretName:
# @param {string,null} [dbSecretName] To force the DB secret name
dbSecretName:

# @param {object} [recovery] Recovery. see https://cloudnative-pg.io/documentation/current/backup_recovery/#recovery
recovery:
  # @param {boolean} [enabled] Enable recovery
  enabled: false

  # Relative to Postgres server timezone
  # @param {string} [targetTime] Time to restore from, in RFC3339 format https://datatracker.ietf.org/doc/html/rfc3339
  targetTime: ""

  # @param {string,null} [database] Database to restore to
  database:

  # @param {string,null} [owner] Database owner to restore to
  owner:

  # @param {string,null} [secretName] Secret where owner password is set
  secretName:

  # @param {string,null} [externalClusterName] Name for the external cluster to recover from
  externalClusterName:

  # See: https://cloudnative-pg.io/documentation/current/backup_recovery/
  # @param {object,null} [barmanObjectStore] Object store credentials and access config
  barmanObjectStore:
    # destinationPath:
    # endpointURL:
    # name of the recovery server on the s3 backups
    # serverName:
    # s3Credentials:
    #   accessKeyId:
    #     name:
    #     key:
    #   secretAccessKey:
    #     name:
    #     key:
    #   region:
    #     name:
    #     key:

# @param {string[]} [postInitApplicationSQL] List of SQL queries to be executed as a superuser in the application database right after is created - to be used with extreme care (by default empty)
postInitApplicationSQL: []

# Points references to ConfigMaps or Secrets which contain SQL files, the general implementation order to these references is from all Secrets to all ConfigMaps, and inside Secrets or ConfigMaps, the implementation order is same as the order of each array (by default empty
# See https://cloudnative-pg.io/documentation/current/api_reference/#postinitapplicationsqlrefs
# @param {object,null} [postInitApplicationSQLRefs]
postInitApplicationSQLRefs:
  # configMapRefs:
  # - name: post-init-sql-configmap
  #   key: configmap.sql
  # secretRefs:
  # - name: post-init-sql-secret
  #   key: secret.sql
