limit ingress CPU usage
On AIO, the nginx CPU usage should be based on the platform cores. Change-Id: I5779a73a8352cc8dbae2accf19706018974bead4 Closes-Bug: 1834799 Signed-off-by: Bin Yang <bin.yang@intel.com>
This commit is contained in:
parent
4c5ff8f627
commit
7cbff55d9a
|
@ -29,11 +29,28 @@ class IngressHelm(base.BaseHelm):
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_overrides(self, namespace=None):
|
def get_overrides(self, namespace=None):
|
||||||
|
limit_enabled, limit_cpus, limit_mem_mib = self._get_platform_res_limit()
|
||||||
|
|
||||||
overrides = {
|
overrides = {
|
||||||
common.HELM_NS_KUBE_SYSTEM: {
|
common.HELM_NS_KUBE_SYSTEM: {
|
||||||
'pod': {
|
'pod': {
|
||||||
'replicas': {
|
'replicas': {
|
||||||
'error_page': self._num_controllers()
|
'error_page': self._num_controllers()
|
||||||
|
},
|
||||||
|
'resources': {
|
||||||
|
'enabled': limit_enabled,
|
||||||
|
'ingress': {
|
||||||
|
'limits': {
|
||||||
|
'cpu': "%d000m" % (limit_cpus),
|
||||||
|
'memory': "%dMi" % (limit_mem_mib)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'error_pages': {
|
||||||
|
'limits': {
|
||||||
|
'cpu': "%d000m" % (limit_cpus),
|
||||||
|
'memory': "%dMi" % (limit_mem_mib)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'deployment': {
|
'deployment': {
|
||||||
|
@ -49,6 +66,21 @@ class IngressHelm(base.BaseHelm):
|
||||||
'replicas': {
|
'replicas': {
|
||||||
'ingress': self._num_controllers(),
|
'ingress': self._num_controllers(),
|
||||||
'error_page': self._num_controllers()
|
'error_page': self._num_controllers()
|
||||||
|
},
|
||||||
|
'resources': {
|
||||||
|
'enabled': limit_enabled,
|
||||||
|
'ingress': {
|
||||||
|
'limits': {
|
||||||
|
'cpu': "%d000m" % (limit_cpus),
|
||||||
|
'memory': "%dMi" % (limit_mem_mib)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'error_pages': {
|
||||||
|
'limits': {
|
||||||
|
'cpu': "%d000m" % (limit_cpus),
|
||||||
|
'memory': "%dMi" % (limit_mem_mib)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue