Merge 763b502e5d into a7aaad0a0b
This commit is contained in:
commit
7090d96275
|
|
@ -154,6 +154,16 @@ spec:
|
||||||
makes sense to expose. E.g. pool size (min/max boundaries), max client
|
makes sense to expose. E.g. pool size (min/max boundaries), max client
|
||||||
connections etc.
|
connections etc.
|
||||||
properties:
|
properties:
|
||||||
|
imagePullSecrets:
|
||||||
|
type: array
|
||||||
|
nullable: true
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
dockerImage:
|
dockerImage:
|
||||||
type: string
|
type: string
|
||||||
maxDBConnections:
|
maxDBConnections:
|
||||||
|
|
|
||||||
|
|
@ -646,6 +646,9 @@ for both master and replica pooler services (if `enableReplicaConnectionPooler`
|
||||||
User to create for connection pooler to be able to connect to a database.
|
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.
|
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**
|
* **dockerImage**
|
||||||
Which docker image to use for connection pooler deployment.
|
Which docker image to use for connection pooler deployment.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -156,6 +156,24 @@ spec:
|
||||||
properties:
|
properties:
|
||||||
dockerImage:
|
dockerImage:
|
||||||
type: string
|
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:
|
maxDBConnections:
|
||||||
format: int32
|
format: int32
|
||||||
type: integer
|
type: integer
|
||||||
|
|
|
||||||
|
|
@ -156,6 +156,24 @@ spec:
|
||||||
properties:
|
properties:
|
||||||
dockerImage:
|
dockerImage:
|
||||||
type: string
|
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:
|
maxDBConnections:
|
||||||
format: int32
|
format: int32
|
||||||
type: integer
|
type: integer
|
||||||
|
|
|
||||||
|
|
@ -327,9 +327,10 @@ type ConnectionPooler struct {
|
||||||
Schema string `json:"schema,omitempty"`
|
Schema string `json:"schema,omitempty"`
|
||||||
User string `json:"user,omitempty"`
|
User string `json:"user,omitempty"`
|
||||||
// +kubebuilder:validation:Enum=session;transaction
|
// +kubebuilder:validation:Enum=session;transaction
|
||||||
Mode string `json:"mode,omitempty"`
|
Mode string `json:"mode,omitempty"`
|
||||||
DockerImage string `json:"dockerImage,omitempty"`
|
DockerImage string `json:"dockerImage,omitempty"`
|
||||||
MaxDBConnections *int32 `json:"maxDBConnections,omitempty"`
|
MaxDBConnections *int32 `json:"maxDBConnections,omitempty"`
|
||||||
|
ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
|
||||||
|
|
||||||
*Resources `json:"resources,omitempty"`
|
*Resources `json:"resources,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,11 @@ func (in *ConnectionPooler) DeepCopyInto(out *ConnectionPooler) {
|
||||||
*out = new(int32)
|
*out = new(int32)
|
||||||
**out = **in
|
**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 {
|
if in.Resources != nil {
|
||||||
in, out := &in.Resources, &out.Resources
|
in, out := &in.Resources, &out.Resources
|
||||||
*out = new(Resources)
|
*out = new(Resources)
|
||||||
|
|
|
||||||
|
|
@ -474,6 +474,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)
|
nodeAffinity := c.nodeAffinity(c.OpConfig.NodeReadinessLabel, spec.NodeAffinity)
|
||||||
if c.OpConfig.EnablePodAntiAffinity {
|
if c.OpConfig.EnablePodAntiAffinity {
|
||||||
labelsSet := labels.Set(c.connectionPoolerLabels(role, false).MatchLabels)
|
labelsSet := labels.Set(c.connectionPoolerLabels(role, false).MatchLabels)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue