Configuration - Kubernetes mode
The configuration file of a Ponos agent in Kubernetes mode is an extension of the generic Ponos agent. Only the kubernetes section is added.
kubernetes.extra_environment
An optional mapping of extra environment variables set on every new Kubernetes job created by the Ponos agent.
Defaults to an empty mapping.
kubernetes.extra_volumes
An optional list of persistent volume claims and their mount paths that will be set on every new Kubernetes job created by the Ponos agent.
Defaults to an empty list.
Each persistent volume claim used in this setting must be previously created and set in the same namespace as kubernetes.namespace described below.
Extra volume definition
An extra volume must have the following fields:
| Key | Type | Required | Description |
|---|---|---|---|
|
String |
Yes |
Name used by the volume and mount points created by the Ponos agent. It’s only descriptive. |
|
String |
Yes |
Name of the pre-existing persistent volume claim whose content will be mounted onto the new jobs. |
|
String |
Yes |
Path on the job’s filesystem where the persistent volume claim will be mounted. |
|
Boolean |
No |
Control if the volume is read-only or read-write (defaults to |
kubernetes.gpu_name
An optional name of a Kubernetes GPU resource limit that will be requested on a Job created by this Ponos agent.
Defaults to nvidia.com/gpu which will allow any GPU available.
| Only Nvidia GPUs are currently supported at this moment. |
kubernetes.in_cluster
Boolean value that configures the connection mode towards Kubernetes cluster. By default, in_cluster is set to true.
When in_cluster is set to true, the Ponos agent will use internal access to reach the Kubernetes API.
Otherwise your local kube configuration is used to reach the cluster (this is mostly used for Ponos agent developers).
kubernetes.namespace
The Kubernetes namespace’s name where all jobs managed by the Ponos agent will be running.
It defaults to the default namespace which is always provisioned on Kubernetes clusters.
kubernetes.pvc_name
A persistent volume claim name must be configured before running the agent. It will be used to share and cache data between task executions.
The agent will not start if the configured persistent volume claim is not available on the cluster.
You can find more information about the Ponos agent setup on that page.
Example
Below is an example of a YAML configuration file to start a Ponos agent in Kubernetes mode.
# Generic Ponos agent
...
# Ponos agent in Kubernetes mode
kubernetes:
in_cluster: true
pvc_name: my-pvc-for-ponos
namespace: my-ns
extra_environment:
CUSTOM_VAR: test1234
extra_volumes:
- name: my-app-data
pvc_name: my-pvc
mount_path: /app/data
read_only: false
gpu_name: nvidia.com/mig-4g.71gb