Skip to content

Commit a61e887

Browse files
committed
fix: add kubelet pod-resource mount for detection real-time device-plugin allocation with hypervisor
1 parent 9057fcb commit a61e887

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

internal/constants/env.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ const (
3131
KubeletDevicePluginVolumeName = "device-plugin"
3232
KubeletDevicePluginPath = "/var/lib/kubelet/device-plugins"
3333

34+
KubeletPodResourcesVolumeName = "pod-resources"
35+
KubeletPodResourcesPath = "/var/lib/kubelet/pod-resources"
36+
3437
TensorFusionVectorConfigName = "tensor-fusion-sys-vector-config"
3538
TensorFusionVectorConfigVolumeName = "vector-config"
3639
TensorFusionVectorConfigMountPath = "/etc/vector/vector.yaml"

internal/utils/compose.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,14 @@ func AddTFHypervisorConfAfterTemplate(ctx context.Context, spec *v1.PodSpec, poo
387387
Type: ptr.To(v1.HostPathDirectoryOrCreate),
388388
},
389389
},
390+
}, v1.Volume{
391+
Name: constants.KubeletPodResourcesVolumeName,
392+
VolumeSource: v1.VolumeSource{
393+
HostPath: &v1.HostPathVolumeSource{
394+
Path: constants.KubeletPodResourcesPath,
395+
Type: ptr.To(v1.HostPathDirectoryOrCreate),
396+
},
397+
},
390398
})
391399

392400
composeHypervisorInitContainer(spec, pool)
@@ -430,6 +438,9 @@ func composeHypervisorContainer(spec *v1.PodSpec, pool *tfv1.GPUPool, enableVect
430438
}, v1.VolumeMount{
431439
Name: constants.KubeletDevicePluginVolumeName,
432440
MountPath: constants.KubeletDevicePluginPath,
441+
}, v1.VolumeMount{
442+
Name: constants.KubeletPodResourcesVolumeName,
443+
MountPath: constants.KubeletPodResourcesPath,
433444
})
434445
if enableVector {
435446
spec.Containers[0].VolumeMounts = append(spec.Containers[0].VolumeMounts, v1.VolumeMount{

0 commit comments

Comments
 (0)