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
-
stringapiVersionAPIVersion 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
-
stringkindKind 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
-
objectmetadata
-
objectspecPostgresSpec defines the desired state of Postgres
-
objectspec.clusterStruct that specified Cluster settings, such as Topology and Replication
-
stringspec.cluster.replication
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:
ConsistencyAndAvailabilityAllowed values:
Availability,Consistency,ConsistencyAndAvailability -
stringspec.cluster.topology
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
-
-
objectspec.configurationConfiguration parameters of Postgres
-
integerspec.configuration.maxConnections
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 -
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 -
integer or stringspec.configuration.walKeepSize
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 -
integer or stringspec.configuration.workMem
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
-
-
array of objectsspec.databasesList of postgres logical Databases
-
stringspec.databases.nameName of the logical database to be created
Example:
name: mydb
-
-
objectspec.instance
Required value
Resources requirements of every generated Pod. Please refer to https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ for more information.-
objectspec.instance.cpu
Required value
-
integerspec.instance.cpu.coreFraction
Required value
CoreFraction is the multiplier for requests of the cores limitsExample:
coreFraction: 50 -
integerspec.instance.cpu.cores
Required value
-
-
objectspec.instance.memory
Required value
-
integer or stringspec.instance.memory.size
Required value
Pattern:
^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$Example:
size: 1Gi
-
-
objectspec.instance.persistentVolumeClaim
Required value
-
stringspec.instance.persistentVolumeClaim.size
Required value
Default:
1GiExample:
size: 1Gi -
stringspec.instance.persistentVolumeClaim.storageClassNameName 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
-
-
-
stringspec.postgresClassName
Required value
Name of PostgresClass Kind, that has to be specified for settings validationDefault:
defaultExample:
postgresClassName: small -
stringspec.typeType specifies kind of Cluster
Default:
ClusterAllowed values:
Cluster,Standalone -
array of objectsspec.usersList of internal postgres Users
-
stringspec.users.hashedPasswordHashedPassword 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= -
stringspec.users.nameName of the user that will be created in Postgres
Example:
name: myuser -
stringspec.users.passwordPlain 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" -
stringspec.users.roleMake 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,monitoringExample:
role: rw -
stringspec.users.storeCredsToSecretStoreCredsToSecret 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
-
stringapiVersionAPIVersion 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
-
stringkindKind 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
-
objectmetadata
-
objectspecPostgresClassSpec defines the desired state of PostgresClass Resource for cluster admin, that could validate Postgres resources with allowedConfiguration parameters, sizingPolicies, validationRules, etc.
-
objectspec.configurationConfiguration parameters of Postgres Any parameters that will be specified here will be used as defaults in chained Postgres Custom Resources
-
integerspec.configuration.maxConnections
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 -
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 -
integer or stringspec.configuration.walKeepSize
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 -
integer or stringspec.configuration.workMem
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
-
-
objectspec.nodeAffinityNodeAffinity of the postgres pods
-
array of objectsspec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecutionThe 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.
-
objectspec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preferenceA node selector term, associated with the corresponding weight.
-
array of objectsspec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchExpressionsA list of node selector requirements by node’s labels.
-
stringspec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchExpressions.keyThe label key that the selector applies to.
-
stringspec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchExpressions.operatorRepresents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
-
array of stringsspec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchExpressions.valuesAn 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.
-
-
array of objectsspec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFieldsA list of node selector requirements by node’s fields.
-
stringspec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFields.keyThe label key that the selector applies to.
-
stringspec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFields.operatorRepresents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
-
array of stringsspec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFields.valuesAn 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.
-
-
-
integerspec.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.weightWeight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.
-
-
objectspec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecutionIf 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.
-
array of objectsspec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms
Required value
Required. A list of node selector terms. The terms are ORed.-
array of objectsspec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressionsA list of node selector requirements by node’s labels.
-
stringspec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions.keyThe label key that the selector applies to.
-
stringspec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions.operatorRepresents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
-
array of stringsspec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions.valuesAn 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.
-
-
array of objectsspec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchFieldsA list of node selector requirements by node’s fields.
-
stringspec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchFields.keyThe label key that the selector applies to.
-
stringspec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchFields.operatorRepresents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
-
array of stringsspec.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchFields.valuesAn 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.
-
-
-
-
-
objectspec.nodeSelectorAllows a PG cluster pods to be assigned to specified nodes. The same as in the
spec.nodeSelectorparameter for Kubernetes Pods. -
array of stringsspec.overridableConfigurationArray of the PostgresSql configurations that allowed to be changed by user Will override all existed in Configuration fields
-
array of objectsspec.sizingPolicies
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.-
array of integersspec.sizingPolicies.coreFractionsCoreFraction is the multiplier for requests of the cores limits. It is array of uints
Example:
coreFractions: - 10 - 30 - 50 - 100 -
objectspec.sizingPolicies.coresCores structure uses to specify range of applicable cores range
-
integerspec.sizingPolicies.cores.max
Required value
Higher limit for Cores settingExample:
max: 6 -
integerspec.sizingPolicies.cores.min
Required value
Lower limit for Cores settingExample:
min: 1
-
-
objectspec.sizingPolicies.memoryMemory structure uses to specify range of applicable memory settings and a step
-
integer or stringspec.sizingPolicies.memory.max
Required value
Higher limit for Memory settingPattern:
^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$Example:
max: 5Gi -
integer or stringspec.sizingPolicies.memory.min
Required value
Lower limit for Memory settingPattern:
^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$Example:
min: 128Mi -
integer or stringspec.sizingPolicies.memory.stepDivider 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
-
-
-
array of objectsspec.tolerationsTolerations of the postgres pods
-
stringspec.tolerations.effectEffect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
-
stringspec.tolerations.keyKey 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.
-
stringspec.tolerations.operatorOperator 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.
-
integerspec.tolerations.tolerationSecondsTolerationSeconds 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.
-
stringspec.tolerations.valueValue is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.
-
-
objectspec.topology
Required value
Description of the permitted postgres Topology-
array of stringsspec.topology.allowedTopologies
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
-
stringspec.topology.allowedTopologies.Element of the array
Allowed values:
Ignored,Zonal,TransZonal
-
array of stringsspec.topology.allowedZonesAllowedZones is an array of the Zones that allowed to use
Default:
[] -
stringspec.topology.defaultTopology
Required value
DefaultTopology that will be used by all the chained Postgres services
-
-
array of objectsspec.validationsValidation formulas that allows check all the set-up configurations CEL language supported only
-
stringspec.validations.messageMessage that will be shown in case of fail of the rule
Example:
message: '''maxConnections should be greater than 100''\' -
stringspec.validations.rule
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
-
stringapiVersionAPIVersion 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
-
stringkindKind 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
-
objectmetadata
-
objectspecPostgresSnapshotSpec defines the desired state of PostgresSnapshot
-
stringspec.postgresName
Required value
Name of Postgres Managed Service
-