Preliminary version. The functionality may change, but the basic features will be preserved. Compatibility with future versions is ensured, but may require additional migration actions.

The Deckhouse Kubernetes Platform installs CRDs but does not remove them when a module is disabled. If you no longer need the created CRDs, delete them.

Postgres

Scope: Namespaced
Version: v1alpha1

Postgres is the Schema for the postgres API
  • apiVersion
    string
    APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
  • kind
    string
    Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
  • metadata
    object
  • spec
    object
    PostgresSpec defines the desired state of Postgres
    • spec.cluster
      object
      Struct that specified Cluster settings, such as Topology and Replication
      • spec.cluster.replication
        string

        Setting Replication specifies number and type of replicas The possible values are:

        • Availability: cluster with Master + 1 async Replica
        • Consistency: cluster with Master + 1 sync Replica
        • ConsistencyAndAvailability: cluster with Master + 1 sync Replica + 1 async Replica

        Default: ConsistencyAndAvailability

        Allowed values: Availability, Consistency, ConsistencyAndAvailability

      • spec.cluster.topology
        string

        Topology setting specifies how to schedule the cluster

        • Zonal: cluster will be scheduled to one zone. If possible
        • TransZonal: cluster will be scheduled to separated zone. If possible
        • Ignored: cluster will be scheduled with default k8s schedule rules, only node separation will be provided

        Example:

        topology: Ignored
        
    • spec.configuration
      object
      Configuration parameters of Postgres
      • spec.configuration.maxConnections
        integer

        Determines the maximum number of concurrent connections to the database server. This parameter can only be set at server start.

        PostgreSQL sizes certain resources based directly on the value of max_connections. Increasing its value leads to higher allocation of those resources, including shared memory.

        Example:

        maxConnections: 100
        
      • spec.configuration.sharedBuffers
        integer or string

        Sets the amount of memory the database server uses for shared memory buffers. This setting must be at least 128 kilobytes. However, settings significantly higher than the minimum are usually needed for good performance. This parameter can only be set at server start.

        If you have a dedicated database server with 1GB or more of RAM, a reasonable value for shared_buffers is 25% of the memory in your system. There are some workloads where even larger settings for shared_buffers are effective, but because PostgreSQL also relies on the operating system cache, it is unlikely that an allocation of more than 25% of RAM to shared_buffers will work better than a smaller amount. Larger settings for shared_buffers usually require a corresponding increase in max_wal_size, in order to spread out the process of writing large quantities of new or changed data over a longer period of time.

        On systems with less than 1GB of RAM, a smaller percentage of RAM is appropriate, so as to leave adequate space for the operating system. Must be set with k8s based units as Gi/Mi/Ki/M/G

        Pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$

        Example:

        sharedBuffers: 250Mi
        
      • spec.configuration.walKeepSize
        integer or string

        Specifies the minimum size of past WAL files kept in the pg_wal directory, in case a standby server needs to fetch them for streaming replication. If a standby server connected to the sending server falls behind by more than wal_keep_size megabytes, the sending server might remove a WAL segment still needed by the standby, in which case the replication connection will be terminated. Downstream connections will also eventually fail as a result. (However, the standby server can recover by fetching the segment from archive, if WAL archiving is in use.)

        This sets only the minimum size of segments retained in pg_wal; the system might need to retain more segments for WAL archival or to recover from a checkpoint. I f wal_keep_size is zero (the default), the system doesn’t keep any extra segments for standby purposes, so the number of old WAL segments available to standby servers is a function of the location of the previous checkpoint and status of WAL archiving. Must be set with k8s based units as Gi/Mi/Ki/M/G

        Pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$

        Example:

        walKeepSize: 512Mi
        
      • spec.configuration.workMem
        integer or string

        Sets the base maximum amount of memory to be used by a query operation (such as a sort or hash table) before writing to temporary disk files. If this value is specified without units, it is taken as kilobytes. The default value is four megabytes (4MB). Note that a complex query might perform several sort and hash operations at the same time, with each operation generally being allowed to use as much memory as this value specifies before it starts to write data into temporary files. Also, several running sessions could be doing such operations concurrently. Therefore, the total memory used could be many times the value of work_mem; it is necessary to keep this fact in mind when choosing the value. Sort operations are used for ORDER BY, DISTINCT, and merge joins. Hash tables are used in hash joins, hash-based aggregation, memoize nodes and hash-based processing of IN subqueries.

        Hash-based operations are generally more sensitive to memory availability than equivalent sort-based operations. The memory limit for a hash table is computed by multiplying work_mem by hash_mem_multiplier. This makes it possible for hash-based operations to use an amount of memory that exceeds the usual work_mem base amount. Must be set with k8s based units as Gi/Mi/Ki/M/G

        Pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$

        Example:

        workMem: 4Mi
        
    • spec.databases
      array of objects
      List of postgres logical Databases
      • spec.databases.name
        string
        Name of the logical database to be created

        Example:

        name: mydb
        
    • spec.instance
      object

      Required value

      Resources requirements of every generated Pod. Please refer to https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ for more information.
      • spec.instance.cpu
        object

        Required value

        • spec.instance.cpu.coreFraction
          integer

          Required value

          CoreFraction is the multiplier for requests of the cores limits

          Example:

          coreFraction: 50
          
        • spec.instance.cpu.cores
          integer

          Required value

      • spec.instance.memory
        object

        Required value

        • spec.instance.memory.size
          integer or string

          Required value

          Pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$

          Example:

          size: 1Gi
          
      • spec.instance.persistentVolumeClaim
        object

        Required value

        • spec.instance.persistentVolumeClaim.size
          string

          Required value

          Default: 1Gi

          Example:

          size: 1Gi
          
        • spec.instance.persistentVolumeClaim.storageClassName
          string
          Name of storage class that will be used as storage for instances. If empty, will be used storageClass that marked as defaulted in k8s cluster. Setting sets up once, and can not be changed during update.

          Example:

          storageClassName: local-path
          
    • spec.postgresClassName
      string

      Required value

      Name of PostgresClass Kind, that has to be specified for settings validation

      Default: default

      Example:

      postgresClassName: small
      
    • spec.type
      string
      Type specifies kind of Cluster

      Default: Cluster

      Allowed values: Cluster, Standalone

    • spec.users
      array of objects
      List of internal postgres Users
      • spec.users.hashedPassword
        string
        HashedPassword of the postgresql role You can specify here MD5/SCRAM-SHA-256 hash formated password if you want to make it more secure. You can specify password instead, but we will replace it with MD5/SCRAM-SHA-256 anyways.

        Example:

        hashedPassword: SCRAM-SHA-256$4096:9bdAkxfJ7tMWaVlcOSyKLc8uUbvVi+KBBYXWCE14maM=$g13sNwuKH0VsQnh43WqlQj8KPwS/2smQL1m0JzJkowI=:rImReuq6U7mD4KoJGIDelxsFVlXoB1stP8olJZr5Gl4=
        
      • spec.users.name
        string
        Name of the user that will be created in Postgres

        Example:

        name: myuser
        
      • spec.users.password
        string
        Plain text Password of the postgresql role Note that, we will morph it to hashedPassword, and deleted from Spec If you want to store plain texted password in secret, please specify storeCredsToSecret.

        Example:

        password: "123"
        
      • spec.users.role
        string
        Make user one of existing roles to which this user will be immediately added as a new member. Possible values: ro, rw, monitoring.

        Allowed values: ro, rw, monitoring

        Example:

        role: rw
        
      • spec.users.storeCredsToSecret
        string
        StoreCredsToSecret is the parameter that allows you to store your plain text password into the secret Provide name of the secret that will be created by operator Secret will be created in namespace with plain-text password and connection strings will be added for each created database.

        Example:

        storeCredsToSecret: myuser-secret
        

PostgresClass

Scope: Cluster
Version: v1alpha1

PostgresClass is the Schema for the postgresclasses API
  • apiVersion
    string
    APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
  • kind
    string
    Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
  • metadata
    object
  • spec
    object
    PostgresClassSpec defines the desired state of PostgresClass Resource for cluster admin, that could validate Postgres resources with allowedConfiguration parameters, sizingPolicies, validationRules, etc.
    • spec.configuration
      object
      Configuration parameters of Postgres Any parameters that will be specified here will be used as defaults in chained Postgres Custom Resources
      • spec.configuration.maxConnections
        integer

        Determines the maximum number of concurrent connections to the database server. This parameter can only be set at server start.

        PostgreSQL sizes certain resources based directly on the value of max_connections. Increasing its value leads to higher allocation of those resources, including shared memory.

        Example:

        maxConnections: 100
        
      • spec.configuration.sharedBuffers
        integer or string

        Sets the amount of memory the database server uses for shared memory buffers. This setting must be at least 128 kilobytes. However, settings significantly higher than the minimum are usually needed for good performance. This parameter can only be set at server start.

        If you have a dedicated database server with 1GB or more of RAM, a reasonable value for shared_buffers is 25% of the memory in your system. There are some workloads where even larger settings for shared_buffers are effective, but because PostgreSQL also relies on the operating system cache, it is unlikely that an allocation of more than 25% of RAM to shared_buffers will work better than a smaller amount. Larger settings for shared_buffers usually require a corresponding increase in max_wal_size, in order to spread out the process of writing large quantities of new or changed data over a longer period of time.

        On systems with less than 1GB of RAM, a smaller percentage of RAM is appropriate, so as to leave adequate space for the operating system. Must be set with k8s based units as Gi/Mi/Ki/M/G

        Pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$

        Example:

        sharedBuffers: 250Mi
        
      • spec.configuration.walKeepSize
        integer or string

        Specifies the minimum size of past WAL files kept in the pg_wal directory, in case a standby server needs to fetch them for streaming replication. If a standby server connected to the sending server falls behind by more than wal_keep_size megabytes, the sending server might remove a WAL segment still needed by the standby, in which case the replication connection will be terminated. Downstream connections will also eventually fail as a result. (However, the standby server can recover by fetching the segment from archive, if WAL archiving is in use.)

        This sets only the minimum size of segments retained in pg_wal; the system might need to retain more segments for WAL archival or to recover from a checkpoint. I f wal_keep_size is zero (the default), the system doesn’t keep any extra segments for standby purposes, so the number of old WAL segments available to standby servers is a function of the location of the previous checkpoint and status of WAL archiving. Must be set with k8s based units as Gi/Mi/Ki/M/G

        Pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$

        Example:

        walKeepSize: 512Mi
        
      • spec.configuration.workMem
        integer or string

        Sets the base maximum amount of memory to be used by a query operation (such as a sort or hash table) before writing to temporary disk files. If this value is specified without units, it is taken as kilobytes. The default value is four megabytes (4MB). Note that a complex query might perform several sort and hash operations at the same time, with each operation generally being allowed to use as much memory as this value specifies before it starts to write data into temporary files. Also, several running sessions could be doing such operations concurrently. Therefore, the total memory used could be many times the value of work_mem; it is necessary to keep this fact in mind when choosing the value. Sort operations are used for ORDER BY, DISTINCT, and merge joins. Hash tables are used in hash joins, hash-based aggregation, memoize nodes and hash-based processing of IN subqueries.

        Hash-based operations are generally more sensitive to memory availability than equivalent sort-based operations. The memory limit for a hash table is computed by multiplying work_mem by hash_mem_multiplier. This makes it possible for hash-based operations to use an amount of memory that exceeds the usual work_mem base amount. Must be set with k8s based units as Gi/Mi/Ki/M/G

        Pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$

        Example:

        workMem: 4Mi
        
    • spec.nodeAffinity
      object
      NodeAffinity of the postgres pods
      • spec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution
        array of objects
        The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding “weight” to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.
        • spec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference
          object
          A node selector term, associated with the corresponding weight.
          • spec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchExpressions
            array of objects
            A list of node selector requirements by node’s labels.
            • spec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchExpressions.key
              string
              The label key that the selector applies to.
            • spec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchExpressions.operator
              string
              Represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
            • spec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchExpressions.values
              array of strings
              An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.
          • spec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFields
            array of objects
            A list of node selector requirements by node’s fields.
            • spec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFields.key
              string
              The label key that the selector applies to.
            • spec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFields.operator
              string
              Represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
            • spec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFields.values
              array of strings
              An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.
        • spec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.weight
          integer
          Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.
      • spec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution
        object
        If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.
        • spec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms
          array of objects

          Required value

          Required. A list of node selector terms. The terms are ORed.
          • spec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions
            array of objects
            A list of node selector requirements by node’s labels.
            • spec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions.key
              string
              The label key that the selector applies to.
            • spec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions.operator
              string
              Represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
            • spec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions.values
              array of strings
              An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.
          • spec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchFields
            array of objects
            A list of node selector requirements by node’s fields.
            • spec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchFields.key
              string
              The label key that the selector applies to.
            • spec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchFields.operator
              string
              Represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
            • spec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchFields.values
              array of strings
              An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.
    • spec.nodeSelector
      object
      Allows a PG cluster pods to be assigned to specified nodes. The same as in the spec.nodeSelector parameter for Kubernetes Pods.
    • spec.overridableConfiguration
      array of strings
      Array of the PostgresSql configurations that allowed to be changed by user Will override all existed in Configuration fields
    • spec.sizingPolicies
      array of objects

      Required value

      SizingPolicy is an array that defines a policy for allocating computational resources to instances of Postgres. The cores.min - cores.max ranges for different elements of the list must not overlap.
      • spec.sizingPolicies.coreFractions
        array of integers
        CoreFraction is the multiplier for requests of the cores limits. It is array of uints

        Example:

        coreFractions:
        - 10
        - 30
        - 50
        - 100
        
      • spec.sizingPolicies.cores
        object
        Cores structure uses to specify range of applicable cores range
        • spec.sizingPolicies.cores.max
          integer

          Required value

          Higher limit for Cores setting

          Example:

          max: 6
          
        • spec.sizingPolicies.cores.min
          integer

          Required value

          Lower limit for Cores setting

          Example:

          min: 1
          
      • spec.sizingPolicies.memory
        object
        Memory structure uses to specify range of applicable memory settings and a step
        • spec.sizingPolicies.memory.max
          integer or string

          Required value

          Higher limit for Memory setting

          Pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$

          Example:

          max: 5Gi
          
        • spec.sizingPolicies.memory.min
          integer or string

          Required value

          Lower limit for Memory setting

          Pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$

          Example:

          min: 128Mi
          
        • spec.sizingPolicies.memory.step
          integer or string
          Divider for Memory setting, it must be divisible without remainder

          Pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$

          Example:

          step: 100Mi
          
    • spec.tolerations
      array of objects
      Tolerations of the postgres pods
      • spec.tolerations.effect
        string
        Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
      • spec.tolerations.key
        string
        Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.
      • spec.tolerations.operator
        string
        Operator represents a key’s relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.
      • spec.tolerations.tolerationSeconds
        integer
        TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.
      • spec.tolerations.value
        string
        Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.
    • spec.topology
      object

      Required value

      Description of the permitted postgres Topology
      • spec.topology.allowedTopologies
        array of strings

        Required value

        AllowedTopologies is an array of the Topology types that allowed to use

        • Zonal: cluster will be scheduled to one zone. If possible
        • TransZonal: cluster will be scheduled to separated zone. If possible
        • Ignored: cluster will be scheduled with default k8s schedule rules, only node separation will be provided
        • spec.topology.allowedTopologies.Element of the array
          string

          Allowed values: Ignored, Zonal, TransZonal

      • spec.topology.allowedZones
        array of strings
        AllowedZones is an array of the Zones that allowed to use

        Default: []

      • spec.topology.defaultTopology
        string

        Required value

        DefaultTopology that will be used by all the chained Postgres services
    • spec.validations
      array of objects
      Validation formulas that allows check all the set-up configurations CEL language supported only
      • spec.validations.message
        string
        Message that will be shown in case of fail of the rule

        Example:

        message: '''maxConnections should be greater than 100''\'
        
      • spec.validations.rule
        string

        Rule that will validate Postgres Configuration There are predefined variables that can be used:

        • configuration.maxConnections
        • configuration.workMem
        • configuration.sharedBuffers
        • configuration.walKeepSize
        • instance.memory.size
        • instance.cpu.cores

        Example:

        rule: configuration.maxConnections > 100
        

PostgresSnapshot

Scope: Namespaced
Version: v1alpha1

PostgresSnapshot is the Schema for the postgressnapshots API