Skip to main content

CPU and Memory Sizing

Adapters and applications that are deployed through a Deployment Site can declare how much CPU and memory Kubernetes reserves and allows for them. You set this on the workload itself, without writing Helm values.

Settings​

AttributeHelm value it controlsExample
CpuRequestresources.requests.cpu100m, 0.5
CpuLimitresources.limits.cpu1
MemoryRequestresources.requests.memory512Mi
MemoryLimitresources.limits.memory1Gi

All four are optional. An empty attribute means "use the chart default". Values are Kubernetes quantities: plain or decimal numbers, m for milli-CPU, and the suffixes k, M, G, T, P, E or Ki, Mi, Gi, Ti, Pi, Ei. 512 MB is not a valid quantity; write 512Mi.

Validation​

When you deploy the workload, OctoMesh checks the settings before anything is sent to the cluster:

  • Every value must be a valid Kubernetes quantity, otherwise the deploy fails with a message such as MemoryRequest '512 MB' is not a valid Kubernetes quantity.
  • A request must not be higher than its limit, for example MemoryRequest 2Gi exceeds MemoryLimit 1Gi. The comparison uses the real quantities, so 1024Mi equals 1Gi.
  • The reason is shown in the workload's last deployment error.

An adapter pool is sized per member with PoolMemberCpuRequest, PoolMemberCpuLimit, PoolMemberMemoryRequest and PoolMemberMemoryLimit. The four attributes above must stay empty on a pool; otherwise the deploy is rejected with a pointer to the pool member settings.

Precedence​

A value reaches Kubernetes in this order, the last one wins:

  1. the default of the Helm chart (for the adapter chart, for example 100m CPU request and 3Gi memory limit),
  2. the settings described on this page,
  3. the ValuesYaml of the workload,
  4. the explicit Values entries of the workload.

If you set MemoryRequest to 512Mi and the ValuesYaml also contains resources.requests.memory, the Helm value is deployed. OctoMesh then shows a warning in the workload's last deployment warning, for example MemoryRequest 512Mi is overridden by an explicit Helm value (ValuesYaml resources.requests.memory). The warning is also logged and returned by the deploy call, and it disappears with the next deploy that has no such conflict.

In Refinery Studio​

The adapter and application pages of Refinery Studio show and edit the four settings, so you do not have to write resources.* into the ValuesYaml.

  • Configuration tab: the section "Resources" sits after "Runtime" on an adapter and after "General" on an application. It has four fields in two columns: CPU request and CPU limit, then memory request and memory limit. An empty field shows the text "chart default" and means that the Helm chart decides. Clearing a field and saving returns it to the chart default. The help text gives examples (250m, 512Mi, 1Gi).
  • Errors before you deploy: the form uses the same rules and the same message texts as the deploy (see Validation). A value that is not a Kubernetes quantity, or a request above its limit, marks the field, shows the message below it and disables Save. If a deploy was rejected for this reason, for example because the value was set with octo-cli, the field that the last deployment error names is marked with the same text when you open the tab.
  • Overview tab: the properties list the rows "CPU" and "Memory" as request … · limit …, with "chart default" for an empty value.
  • When ValuesYaml or a value override wins: if the ValuesYaml sets resources.requests.memory (or another of the four paths) or a value override uses that path, the field stays editable but shows the hint "Overridden by values.yaml — this value is deployed: …" (or "value override") with a link to the place that sets it. The Overview shows the deployed value and strikes the typed value through. The controller's warning (see Precedence) appears as a warning, not an error, in the deployment state.

The Resources section needs System.Communication 4.10.0 on the tenant; on an older tenant it is not shown.