/api/configs/pod_template#
Each pod template is defined by a name and a Dictionary[String, Any], where the dictionary is a JSON representation of the Kubernetes pod specification.
Default Value: Empty dictionary {} (no pod templates configured by default)
Example#
The following example shows a pod template that adds GPU resources and node selectors:
{
"gpu_template": {
"spec": {
"nodeSelector": {
"accelerator": "nvidia-tesla-v100"
},
"containers": [{
"name": "main",
"resources": {
"limits": {
"nvidia.com/gpu": "1"
}
}
}]
},
"metadata": {
"labels": {
"gpu-enabled": "true"
}
}
}
}
The key here is gpu_template, which is the name of the pod template. The value is a dictionary that contains the Kubernetes pod specification.
When a pool is configured to use this pod template, the Kubernetes pod specification will be merged with the base pod configuration.
A pool can apply this pod template by adding the name to the common_pod_template array,
and a platform can apply this pod template by adding the name to the override_pod_template array.
To learn more about pod templates, see Pod Template Concepts.