|
58 | 58 | x-kubernetes-validations: |
59 | 59 | - message: class is immutable |
60 | 60 | rule: self == oldSelf |
| 61 | + connectionPoolerConfig: |
| 62 | + description: |- |
| 63 | + ConnectionPoolerConfig overrides the connection pooler configuration from the class. |
| 64 | + Only takes effect when connection pooling is enabled. |
| 65 | + properties: |
| 66 | + config: |
| 67 | + additionalProperties: |
| 68 | + type: string |
| 69 | + description: |- |
| 70 | + Config contains PgBouncer configuration parameters. |
| 71 | + Passed directly to CNPG Pooler spec.pgbouncer.parameters. |
| 72 | + See: https://cloudnative-pg.io/docs/1.28/connection_pooling/#pgbouncer-configuration-options |
| 73 | + type: object |
| 74 | + instances: |
| 75 | + default: 3 |
| 76 | + description: |- |
| 77 | + Instances is the number of PgBouncer pod replicas. |
| 78 | + Higher values provide better availability and load distribution. |
| 79 | + format: int32 |
| 80 | + maximum: 10 |
| 81 | + minimum: 1 |
| 82 | + type: integer |
| 83 | + mode: |
| 84 | + default: transaction |
| 85 | + description: Mode defines the connection pooling strategy. |
| 86 | + enum: |
| 87 | + - session |
| 88 | + - transaction |
| 89 | + - statement |
| 90 | + type: string |
| 91 | + type: object |
61 | 92 | connectionPoolerEnabled: |
62 | 93 | default: false |
63 | 94 | description: |- |
@@ -128,7 +159,6 @@ spec: |
128 | 159 | type: string |
129 | 160 | type: array |
130 | 161 | postgresVersion: |
131 | | - default: "18" |
132 | 162 | description: |- |
133 | 163 | PostgresVersion is the PostgreSQL version (major or major.minor). |
134 | 164 | Examples: "18" (latest 18.x), "18.1" (specific minor), "17", "16" |
@@ -216,9 +246,22 @@ spec: |
216 | 246 | - class |
217 | 247 | type: object |
218 | 248 | x-kubernetes-validations: |
219 | | - - message: Storage size cannot be removed and can only be increased |
| 249 | + - messageExpression: '!has(self.postgresVersion) ? ''postgresVersion cannot |
| 250 | + be removed once set (was: '' + oldSelf.postgresVersion + '')'' : ''postgresVersion |
| 251 | + major version cannot be downgraded (from: '' + oldSelf.postgresVersion |
| 252 | + + '', to: '' + self.postgresVersion + '')''' |
| 253 | + rule: '!has(oldSelf.postgresVersion) || (has(self.postgresVersion) && |
| 254 | + int(self.postgresVersion.split(''.'')[0]) >= int(oldSelf.postgresVersion.split(''.'')[0]))' |
| 255 | + - messageExpression: '!has(self.storage) ? ''storage cannot be removed |
| 256 | + once set (was: '' + string(oldSelf.storage) + '')'' : ''storage size |
| 257 | + cannot be decreased (from: '' + string(oldSelf.storage) + '', to: |
| 258 | + '' + string(self.storage) + '')''' |
220 | 259 | rule: '!has(oldSelf.storage) || (has(self.storage) && quantity(self.storage).compareTo(quantity(oldSelf.storage)) |
221 | 260 | >= 0)' |
| 261 | + - message: connectionPoolerConfig must be set when connectionPoolerEnabled |
| 262 | + is true |
| 263 | + rule: '!self.connectionPoolerEnabled || self.connectionPoolerConfig |
| 264 | + != null' |
222 | 265 | status: |
223 | 266 | description: PostgresClusterStatus defines the observed state of PostgresCluster. |
224 | 267 | properties: |
@@ -363,6 +406,43 @@ spec: |
363 | 406 | type: string |
364 | 407 | type: object |
365 | 408 | x-kubernetes-map-type: atomic |
| 409 | + resources: |
| 410 | + description: Resources contains references to related Kubernetes resources |
| 411 | + like ConfigMaps and Secrets. |
| 412 | + properties: |
| 413 | + configMapRef: |
| 414 | + description: |- |
| 415 | + ConfigMapRef references the ConfigMap with connection endpoints. |
| 416 | + Contains: CLUSTER_ENDPOINTS, POOLER_ENDPOINTS (if connection pooler enabled) |
| 417 | + properties: |
| 418 | + name: |
| 419 | + default: "" |
| 420 | + description: |- |
| 421 | + Name of the referent. |
| 422 | + This field is effectively required, but due to backwards compatibility is |
| 423 | + allowed to be empty. Instances of this type with an empty value here are |
| 424 | + almost certainly wrong. |
| 425 | + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
| 426 | + type: string |
| 427 | + type: object |
| 428 | + x-kubernetes-map-type: atomic |
| 429 | + secretRef: |
| 430 | + description: |- |
| 431 | + SecretRef references the Secret with superuser credentials. |
| 432 | + Contains: passwords for superuser |
| 433 | + properties: |
| 434 | + name: |
| 435 | + default: "" |
| 436 | + description: |- |
| 437 | + Name of the referent. |
| 438 | + This field is effectively required, but due to backwards compatibility is |
| 439 | + allowed to be empty. Instances of this type with an empty value here are |
| 440 | + almost certainly wrong. |
| 441 | + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
| 442 | + type: string |
| 443 | + type: object |
| 444 | + x-kubernetes-map-type: atomic |
| 445 | + type: object |
366 | 446 | type: object |
367 | 447 | type: object |
368 | 448 | served: true |
|
0 commit comments