This commit is contained in:
mbuken 2026-03-12 08:42:50 +00:00 committed by GitHub
commit 989760be36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 62 additions and 3 deletions

View File

@ -138,6 +138,16 @@ spec:
connectionPooler:
type: object
properties:
imagePullSecrets:
type: array
nullable: true
items:
type: object
required:
- name
properties:
name:
type: string
dockerImage:
type: string
maxDBConnections:

View File

@ -597,6 +597,9 @@ for both master and replica pooler services (if `enableReplicaConnectionPooler`
User to create for connection pooler to be able to connect to a database.
You can also choose a role from the `users` section or a system user role.
* **imagePullSecrets**
References an existing Kubernetes secret to use when pulling a custom pooler image.
* **dockerImage**
Which docker image to use for connection pooler deployment.

View File

@ -154,6 +154,24 @@ spec:
properties:
dockerImage:
type: string
imagePullSecrets:
items:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
type: array
maxDBConnections:
format: int32
type: integer

View File

@ -154,6 +154,24 @@ spec:
properties:
dockerImage:
type: string
imagePullSecrets:
items:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
type: array
maxDBConnections:
format: int32
type: integer

View File

@ -321,9 +321,10 @@ type ConnectionPooler struct {
Schema string `json:"schema,omitempty"`
User string `json:"user,omitempty"`
// +kubebuilder:validation:Enum=session;transaction
Mode string `json:"mode,omitempty"`
DockerImage string `json:"dockerImage,omitempty"`
MaxDBConnections *int32 `json:"maxDBConnections,omitempty"`
Mode string `json:"mode,omitempty"`
DockerImage string `json:"dockerImage,omitempty"`
MaxDBConnections *int32 `json:"maxDBConnections,omitempty"`
ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
*Resources `json:"resources,omitempty"`
}

View File

@ -111,6 +111,11 @@ func (in *ConnectionPooler) DeepCopyInto(out *ConnectionPooler) {
*out = new(int32)
**out = **in
}
if in.ImagePullSecrets != nil {
in, out := &in.ImagePullSecrets, &out.ImagePullSecrets
*out = make([]corev1.LocalObjectReference, len(*in))
copy(*out, *in)
}
if in.Resources != nil {
in, out := &in.Resources, &out.Resources
*out = new(Resources)

View File

@ -412,6 +412,10 @@ func (c *Cluster) generateConnectionPoolerPodTemplate(role PostgresRole) (
},
}
if len(connectionPoolerSpec.ImagePullSecrets) > 0 {
podTemplate.Spec.ImagePullSecrets = connectionPoolerSpec.ImagePullSecrets
}
nodeAffinity := c.nodeAffinity(c.OpConfig.NodeReadinessLabel, spec.NodeAffinity)
if c.OpConfig.EnablePodAntiAffinity {
labelsSet := labels.Set(c.connectionPoolerLabels(role, false).MatchLabels)