Search documentation
karat

+

K

Resources [Beta]

Resources are in a beta state and may not be available on your Apollo Hub. Contact your Palantir representative to learn more.

This extension of the specification describes how a product declares the necessary compute resources and is modeled after the Kubernetes container resource specification. The following types of compute resources are supported:

  • CPU
  • Memory

Declaring Compute Resource Requests and Limits

When defining an Apollo Product’s CPU and memory requirements, developers may include both the minimum resource quantities each service replica must have available to it (“requests”) and the maximum quantities of these resources that each replica should not exceed (“limits”). Resource requests and limits are applied to each replica of a service. These requests and limits can be defined under a top-level resources field in an Apollo Product's configuration.yml file:

Copied!
1 2 3 4 5 6 7 8 # configuration.yml resources: requests: cpu: 0.5 memory: 1Gi limits: cpu: 2 memory: 4Gi

Supported memory units are:

  • Ki (Kibibyte)
  • K (Kilobyte)
  • Mi (Mebibyte)
  • M (Megabyte)
  • Gi (Gibibyte)
  • G (Gigabyte)
  • T (Terabyte)

CPU values can be provided as unit-less floating point values indicating the number of CPU cores. For example, 0.5 CPU is interpreted as 50% usage of a single core.

Default Values

Both resources.requests and resources.limits are optional fields, as are their subfields. Absent values are handled in the following way:

  • If neither a CPU request nor CPU limit is specified, a default value of 0.25 is used.
  • If neither a memory request nor memory limit is specified, a default value of 1G is used.
  • If only a limit is defined for a resource, then the request for that resource is set to the same value.