Kubernetes resources for runs
This page describes the Kubernetes-related options accepted by function.run() and task specifications.
For Kubernetes concepts, see the Kubernetes documentation.
Resources
Declare hardware requests with the resources map, which can include cpu, mem, gpu and disk.
Profile
Profiles are administrator-provided templates for specific hardware, such as GPUs.
Use dh.get_k8s_resource_profiles() to list available profiles.
Volumes
Supported volume types are persistent_volume_claim, empty_dir, ephemeral and shared_volume.
Each volume uses volume_type, name, mount_path and, where needed, a spec map.
Mount a PVC with an optional spec.size.
Use empty_dir for ephemeral in-memory or node-local storage.
Use ephemeral when the runtime exposes ephemeral volume handling. spec.size is optional.
Secrets and envs
Inject existing DigitalHub Secrets with secrets, a list of names.
Set environment variables with envs, a list of {name, value} objects.
Service port and type
Expose services with service_ports, a list of {port, target_port} maps, and service_type.
Supported service types are ClusterIP, LoadBalancer, NodePort and ExternalName.
Security context
Set run_as_user and run_as_group to control the UID and GID of the container.
Set fs_group to control the filesystem group.