Policy YAML Examples
This article provides examples of:
Creating a new rule within a policy
Best practices for adding sections to a policy
A full example of a whole policy
Creating a New Rule Within a Policy
This example shows how to add a new limitation to the GPU usage for workloads of type workspace:
Check the workload API fields documentation and select the field(s) that are most relevant for GPU usage.
Search the field in the Policy YAML fields - reference table. For example, gpuDevicesRequest appears under the Compute fields sub-table and appears as follow:
gpuDeviceRequest
Specifies the number of GPUs to allocate for the created workload. Only if gpuDeviceRequest = 1
, the gpuRequestType can be defined.
integer
Workspace & Training
Use the value type of the gpuDevicesRequest field indicated in the table - “integer” and navigate to the Value types table to view the possible rules that can be applied to this value type -
for integer, the options are:
canEdit
required
min
max
step
Proceed to the Rule Type table, select the required rule for the limitation of the field - for example “max” and use the examples syntax to indicate the maximum GPU device requested.
Policy YAML Best Practices
Example of a Whole Policy
Last updated