This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.第 9 章 Performing advanced builds
The following sections provide instructions for advanced build operations including setting build resources and maximum duration, assigning builds to nodes, chaining builds, build pruning, and build run policies.
9.1. Setting build resources 复制链接链接已复制到粘贴板!
By default, builds are completed by pods using unbound resources, such as memory and CPU. These resources can be limited.
Procedure
You can limit resource use in two ways:
- Limit resource use by specifying resource limits in the default container limits of a project.
Limit resource use by specifying resource limits as part of the build configuration. ** In the following example, each of the
resources
,cpu
, andmemory
parameters are optional:Copy to Clipboard Copied! Toggle word wrap Toggle overflow However, if a quota has been defined for your project, one of the following two items is required:
A
resources
section set with an explicitrequests
:resources: requests: cpu: "100m" memory: "256Mi"
resources: requests:
1 cpu: "100m" memory: "256Mi"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
requests
object contains the list of resources that correspond to the list of resources in the quota.
A limit range defined in your project, where the defaults from the
LimitRange
object apply to pods created during the build process.Otherwise, build pod creation will fail, citing a failure to satisfy quota.