Skip to content

Commit

Permalink
Update default resource for pg-coordinator (#813)
Browse files Browse the repository at this point in the history
Signed-off-by: Emon46 <emon@appscode.com>
  • Loading branch information
Emon46 committed Nov 2, 2021
1 parent 807280c commit 24d4421
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions apis/kubedb/v1alpha2/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,11 @@ var (
}
// CoordinatorDefaultResources must be used for raft backed coordinators to avoid unintended leader switches
CoordinatorDefaultResources = core.ResourceRequirements{
Limits: core.ResourceList{
core.ResourceCPU: resource.MustParse(".500"),
Requests: core.ResourceList{
core.ResourceCPU: resource.MustParse(".200"),
core.ResourceMemory: resource.MustParse("256Mi"),
},
Requests: core.ResourceList{
core.ResourceCPU: resource.MustParse(".500"),
Limits: core.ResourceList{
core.ResourceMemory: resource.MustParse("256Mi"),
},
}
Expand Down
4 changes: 2 additions & 2 deletions apis/kubedb/v1alpha2/postgres_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ func (p *Postgres) SetDefaults(postgresVersion *catalog.PostgresVersion, topolog
ElectionTick: 10,
// this value should be one.
HeartbeatTick: 1,
//we have set this default to 33554432. if the difference between primary and replica is more then this,
//we have set this default to 67108864. if the difference between primary and replica is more then this,
//the replica node is going to manually sync itself.
MaximumLagBeforeFailover: 32 * 1024 * 1024,
MaximumLagBeforeFailover: 64 * 1024 * 1024,
}
}
SetDefaultResourceLimits(&p.Spec.Coordinator.Resources, CoordinatorDefaultResources)
Expand Down

0 comments on commit 24d4421

Please sign in to comment.