Add set_memory_request_to_limit option

This commit is contained in:
Sergey Dudoladov
2018-11-08 13:49:30 +01:00
parent 96e3ea9511
commit 90db0e545b
11 changed files with 50 additions and 16 deletions
+15
View File
@@ -110,6 +110,21 @@ func (c *Controller) initOperatorConfig() {
c.opConfig = config.NewFromMap(configMapData)
c.warnOnDeprecatedOperatorParameters()
if c.opConfig.SetMemoryRequestToLimit {
if c.opConfig.DefaultMemoryLimit > c.opConfig.DefaultMemoryRequest {
c.logger.Warningf("The default memory request of %v for Postgres containers is increased to match the default memory limit of %v.", c.opConfig.DefaultMemoryRequest, c.opConfig.DefaultMemoryLimit)
c.opConfig.DefaultMemoryRequest = c.opConfig.DefaultMemoryLimit
}
if c.opConfig.ScalyrMemoryLimit > c.opConfig.ScalyrMemoryRequest {
c.logger.Warningf("The memory request of %v for the Scalyr sidecar container is increased to match the memory limit of %v.", c.opConfig.ScalyrMemoryRequest, c.opConfig.ScalyrMemoryLimit)
c.opConfig.ScalyrMemoryRequest = c.opConfig.ScalyrMemoryLimit
}
// generateStatefulSet adjusts values for individual Postgres clusters
}
}
func (c *Controller) modifyConfigFromEnvironment() {