Limiting resources usage
This section describes how to limit resource use in devfiles.
-
Specify container memory limit and memory request for components
To specify a container memory limit for
container
, use thememoryLimit
parameter. To specify a container memory request, use thememoryRequest
parameter:Example 1. Specify container memory limit and memory request for componentscomponents: - name: maven container: image: eclipse/maven-jdk8:latest memoryLimit: 512M memoryRequest: 256M
This limit applies to every container of the given component.
When not specified, the values may or may not be inferred from the application that consumes the devfile or from the underlying platform (for example, Kubernetes).
-
Specify container CPU limit and container CPU request for components
To specify a container CPU limit for
container
, use thecpuLimit
parameter. To specify a container CPU request forcontainer
, use thecpuRequest
parameter:Example 2. Specify container CPU limit and CPU request for componentscomponents: - name: maven container: image: eclipse/maven-jdk8:latest cpuLimit: 750m cpuRequest: 450m
This limit applies to every container of the given component.
When not specified, the values may or may not be inferred from the application that consumes the devfile or from the underlying platform (for example, Kubernetes).