File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -497,6 +497,7 @@ func compareResourcesAssumeFirstNotNil(a *v1.ResourceRequirements, b *v1.Resourc
497497
498498func (c * Cluster ) validateResources (spec * acidv1.PostgresSpec ) error {
499499
500+ // setting limits too low can cause unnecessary evictions / OOM kills
500501 const (
501502 cpuMinLimit = "256m"
502503 memoryMinLimit = "256Mi"
@@ -554,10 +555,11 @@ func (c *Cluster) Update(oldSpec, newSpec *acidv1.Postgresql) error {
554555 }
555556 }()
556557
557- // check if pod resources were edited below the enforced minimum limits
558558 if err := c .validateResources (& newSpec .Spec ); err != nil {
559559 err = fmt .Errorf ("insufficient resource limits specified: %v" , err )
560560
561+ // cancel update only when (already too low) pod resources were edited
562+ // if cluster was successfully running before the update, continue but log a warning
561563 isCPULimitSmaller , err2 := util .IsSmallerQuantity (newSpec .Spec .Resources .ResourceLimits .CPU , oldSpec .Spec .Resources .ResourceLimits .CPU )
562564 isMemoryLimitSmaller , err3 := util .IsSmallerQuantity (newSpec .Spec .Resources .ResourceLimits .Memory , oldSpec .Spec .Resources .ResourceLimits .Memory )
563565
You can’t perform that action at this time.
0 commit comments