Rename replicas to avoid potential confusion about terminology
This commit is contained in:
parent
e2664843ba
commit
e11f787664
|
|
@ -327,7 +327,7 @@ spec:
|
|||
connection_pool_user:
|
||||
type: string
|
||||
#default: "pooler"
|
||||
connection_pool_replicas:
|
||||
connection_pool_number_of_instances:
|
||||
type: integer
|
||||
#default: 1
|
||||
connection_pool_image:
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ spec:
|
|||
type: string
|
||||
user:
|
||||
type: string
|
||||
replicas:
|
||||
number_of_instances:
|
||||
type: integer
|
||||
dockerImage:
|
||||
type: string
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ configScalyr:
|
|||
|
||||
configConnectionPool:
|
||||
# number of pooler instances
|
||||
connection_pool_replicas: 1
|
||||
connection_pool_number_of_instances: 1
|
||||
# db schema to install lookup function into
|
||||
connection_pool_schema: "pooler"
|
||||
# db user for pooler to use
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ configTeamsApi:
|
|||
# configure connection pooler deployment created by the operator
|
||||
configConnectionPool:
|
||||
# number of pooler instances
|
||||
connection_pool_replicas: 1
|
||||
connection_pool_number_of_instances: 1
|
||||
# db schema to install lookup function into
|
||||
connection_pool_schema: "pooler"
|
||||
# db user for pooler to use
|
||||
|
|
|
|||
|
|
@ -372,7 +372,7 @@ configuration for connection pool. If this section is not empty, a connection
|
|||
pool will be created for a database even if `enableConnectionPool` is not
|
||||
present.
|
||||
|
||||
* **replicas**
|
||||
* **number_of_instances**
|
||||
How many instances of connection pool to create.
|
||||
|
||||
* **mode**
|
||||
|
|
|
|||
|
|
@ -600,7 +600,7 @@ default configuration for connection pool, if a postgres manifest requests it
|
|||
but do not specify some of the parameters. All of them are optional with the
|
||||
operator being able to provide some reasonable defaults.
|
||||
|
||||
* **connection_pool_replicas**
|
||||
* **connection_pool_number_of_instances**
|
||||
How many instances of connection pool to create.
|
||||
|
||||
* **connection_pool_schema**
|
||||
|
|
|
|||
|
|
@ -478,7 +478,7 @@ To configure a new connection pool, specify:
|
|||
spec:
|
||||
connectionPool:
|
||||
# how many instances of connection pool to create
|
||||
replicas: 1
|
||||
number_of_instances: 1
|
||||
|
||||
# in which mode to run, session or transaction
|
||||
mode: "transaction"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ data:
|
|||
# connection_pool_default_memory_limit: 100m
|
||||
# connection_pool_default_memory_request: "100Mi"
|
||||
# connection_pool_image: ""
|
||||
# connection_pool_replicas: 1
|
||||
# connection_pool_number_of_instances: 1
|
||||
# connection_pool_mode: "transaction"
|
||||
# connection_pool_schema: "pooler"
|
||||
# connection_pool_user: "pooler"
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ spec:
|
|||
connection_pool_user:
|
||||
type: string
|
||||
#default: "pooler"
|
||||
connection_pool_replicas:
|
||||
connection_pool_number_of_instances:
|
||||
type: integer
|
||||
#default: 1
|
||||
connection_pool_image:
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ configuration:
|
|||
connection_pool_default_memory_limit: 100m
|
||||
connection_pool_default_memory_request: "100Mi"
|
||||
connection_pool_image: "registry.opensource.zalan.do/acid/pgbouncer:master-3"
|
||||
connection_pool_replicas: 1
|
||||
connection_pool_number_of_instances: 1
|
||||
connection_pool_mode: "transaction"
|
||||
# connection_pool_schema: "pooler"
|
||||
# connection_pool_user: "pooler"
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ spec:
|
|||
type: string
|
||||
user:
|
||||
type: string
|
||||
replicas:
|
||||
number_of_instances:
|
||||
type: integer
|
||||
dockerImage:
|
||||
type: string
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ type ScalyrConfiguration struct {
|
|||
|
||||
// Defines default configuration for connection pool
|
||||
type ConnectionPoolConfiguration struct {
|
||||
Replicas *int32 `json:"connection_pool_replicas,omitempty"`
|
||||
NumberOfInstances *int32 `json:"connection_pool_number_of_instances,omitempty"`
|
||||
Schema string `json:"connection_pool_schema,omitempty"`
|
||||
User string `json:"connection_pool_user,omitempty"`
|
||||
Image string `json:"connection_pool_image,omitempty"`
|
||||
|
|
|
|||
|
|
@ -169,11 +169,11 @@ type PostgresStatus struct {
|
|||
// makes sense to expose. E.g. pool size (min/max boundaries), max client
|
||||
// connections etc.
|
||||
type ConnectionPool struct {
|
||||
Replicas *int32 `json:"replicas,omitempty"`
|
||||
Schema string `json:"schema,omitempty"`
|
||||
User string `json:"user,omitempty"`
|
||||
Mode string `json:"mode,omitempty"`
|
||||
DockerImage string `json:"dockerImage,omitempty"`
|
||||
NumberOfInstances *int32 `json:"number_of_instances,omitempty"`
|
||||
Schema string `json:"schema,omitempty"`
|
||||
User string `json:"user,omitempty"`
|
||||
Mode string `json:"mode,omitempty"`
|
||||
DockerImage string `json:"dockerImage,omitempty"`
|
||||
|
||||
Resources `json:"resources,omitempty"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ func (in *CloneDescription) DeepCopy() *CloneDescription {
|
|||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ConnectionPool) DeepCopyInto(out *ConnectionPool) {
|
||||
*out = *in
|
||||
if in.Replicas != nil {
|
||||
in, out := &in.Replicas, &out.Replicas
|
||||
if in.NumberOfInstances != nil {
|
||||
in, out := &in.NumberOfInstances, &out.NumberOfInstances
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
|
|
@ -93,8 +93,8 @@ func (in *ConnectionPool) DeepCopy() *ConnectionPool {
|
|||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ConnectionPoolConfiguration) DeepCopyInto(out *ConnectionPoolConfiguration) {
|
||||
*out = *in
|
||||
if in.Replicas != nil {
|
||||
in, out := &in.Replicas, &out.Replicas
|
||||
if in.NumberOfInstances != nil {
|
||||
in, out := &in.NumberOfInstances, &out.NumberOfInstances
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1861,9 +1861,9 @@ func (c *Cluster) generateConnPoolDeployment(spec *acidv1.PostgresSpec) (
|
|||
*appsv1.Deployment, error) {
|
||||
|
||||
podTemplate, err := c.generateConnPoolPodTemplate(spec)
|
||||
numberOfInstances := spec.ConnectionPool.Replicas
|
||||
numberOfInstances := spec.ConnectionPool.NumberOfInstances
|
||||
if numberOfInstances == nil {
|
||||
numberOfInstances = c.OpConfig.ConnectionPool.Replicas
|
||||
numberOfInstances = c.OpConfig.ConnectionPool.NumberOfInstances
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -99,14 +99,14 @@ func TestConnPoolSynchronization(t *testing.T) {
|
|||
oldSpec: &acidv1.Postgresql{
|
||||
Spec: acidv1.PostgresSpec{
|
||||
ConnectionPool: &acidv1.ConnectionPool{
|
||||
Replicas: int32ToPointer(1),
|
||||
NumberOfInstances: int32ToPointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
newSpec: &acidv1.Postgresql{
|
||||
Spec: acidv1.PostgresSpec{
|
||||
ConnectionPool: &acidv1.ConnectionPool{
|
||||
Replicas: int32ToPointer(2),
|
||||
NumberOfInstances: int32ToPointer(2),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -146,13 +146,13 @@ func (c *Controller) importConfigurationFromCRD(fromCRD *acidv1.OperatorConfigur
|
|||
|
||||
// Connection pool. Looks like we can't use defaulting in CRD before 1.17,
|
||||
// so ensure default values here.
|
||||
result.ConnectionPool.Replicas = fromCRD.ConnectionPool.Replicas
|
||||
if result.ConnectionPool.Replicas == nil ||
|
||||
*result.ConnectionPool.Replicas < 1 {
|
||||
result.ConnectionPool.NumberOfInstances = fromCRD.ConnectionPool.NumberOfInstances
|
||||
if result.ConnectionPool.NumberOfInstances == nil ||
|
||||
*result.ConnectionPool.NumberOfInstances < 1 {
|
||||
var value int32
|
||||
|
||||
value = 1
|
||||
result.ConnectionPool.Replicas = &value
|
||||
result.ConnectionPool.NumberOfInstances = &value
|
||||
}
|
||||
|
||||
result.ConnectionPool.Schema = util.Coalesce(
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ type LogicalBackup struct {
|
|||
|
||||
// Operator options for connection pooler
|
||||
type ConnectionPool struct {
|
||||
Replicas *int32 `name:"connection_pool_replicas" default:"1"`
|
||||
NumberOfInstances *int32 `name:"connection_pool_number_of_instances" default:"1"`
|
||||
Schema string `name:"connection_pool_schema" default:"pooler"`
|
||||
User string `name:"connection_pool_user" default:"pooler"`
|
||||
Image string `name:"connection_pool_image" default:"pgbouncer:1.0"`
|
||||
|
|
|
|||
Loading…
Reference in New Issue