kata-types: Add pod_resource_api_sock configuration for GPU cold-plug

The Go runtime already exposes a [runtime] pod_resource_api_sock option
that tells the shim where to find the kubelet Pod Resources API socket.
The runtime-rs VFIO cold-plug code needs the same setting so it can
query assigned GPU devices before the VM starts.

Add the field to RuntimeConfig and wire it through deserialization so
that configuration-*.toml files can set it.

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
This commit is contained in:
Alex Lyn
2026-04-04 11:29:46 +02:00
committed by Fabiano Fidêncio
parent 2cf1001c37
commit aa2e72f94c

View File

@@ -181,6 +181,26 @@ pub struct Runtime {
/// If fd passthrough io is enabled, the runtime will attempt to use the specified port instead of the default port.
#[serde(default = "default_passfd_listener_port")]
pub passfd_listener_port: u32,
/// pod_resource_api_sock specifies the unix socket for the Kubelet's
/// PodResource API endpoint. If empty, kubernetes based cold plug
/// will not be attempted. In order for this feature to work, the
/// KubeletPodResourcesGet featureGate must be enabled in Kubelet,
/// if using Kubelet older than 1.34.
/// The pod resource API's socket is relative to the Kubelet's root-dir,
/// which is defined by the cluster admin, and its location is:
/// ${KubeletRootDir}/pod-resources/kubelet.sock
/// cold_plug_vfio(see hypervisor config) acts as a feature gate:
/// cold_plug_vfio = no_port (default) => no cold plug
/// cold_plug_vfio != no_port AND pod_resource_api_sock = "" => need
/// explicit CDI annotation for cold plug (applies mainly
/// to non-k8s cases)
/// cold_plug_vfio != no_port AND pod_resource_api_sock != "" => kubelet
/// based cold plug.
#[serde(default)]
pub pod_resource_api_sock: String,
}
fn default_passfd_listener_port() -> u32 {