An Allocation Policy specifies the minimum and maximum CPU and Memory capacity to be allocated for a Container. An Allocation Policy is used while
Setting up the build environment for a Source Code Based or a Docker Project based Container
Adding a Container to a Service.
Requested/Minimum Capacity
The initial capacity allocated for the container. If a Service has more than one container ( side car containers ), kubernetes schedules the containers on a node which can satisfy the total requested capacity of all the containers. At any point in time, if the node has lesser capacity than the total requested capacity, the Service is rescheduled on a node that can satisfy the requirement.
Maximum Capacity
The maximum capacity that a container can utilise. In case of Memory requirement, if the container exceeds the maximum capacity, then it is killed with the error OOM - Out of Memory ( or with exit code 137). If a Service has more than one container ( side car containers ) and if any of the containers exceeded the maximum capacity, the deployment fails with CrashLoopBackOff. Check the troubleshooting article for more information.
Steps to Create an Allocation Policy
1. In the left navigation panel, under Policies, select Container.
2. Click on Create new policy to open the policy creation wizard.
3. Fill in the CPU & Memory requested and maximum capacity requirements for a container. The available unit for CPU is Millicore. The available units for Memory are Mb and Gb.
4. Click on Create to create a new Allocation policy