feat: imagePullSecret functionality

This commit is contained in:
mbu 2026-01-06 11:22:38 +01:00
parent a06f8d796b
commit 46f475652a
3 changed files with 21 additions and 6 deletions

View File

@ -136,6 +136,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

@ -242,12 +242,13 @@ type PostgresStatus struct {
// makes sense to expose. E.g. pool size (min/max boundaries), max client
// connections etc.
type ConnectionPooler struct {
NumberOfInstances *int32 `json:"numberOfInstances,omitempty"`
Schema string `json:"schema,omitempty"`
User string `json:"user,omitempty"`
Mode string `json:"mode,omitempty"`
DockerImage string `json:"dockerImage,omitempty"`
MaxDBConnections *int32 `json:"maxDBConnections,omitempty"`
NumberOfInstances *int32 `json:"numberOfInstances,omitempty"`
Schema string `json:"schema,omitempty"`
User string `json:"user,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

@ -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)