@@ -26,6 +26,7 @@ import (
2626 corev1 "k8s.io/api/core/v1"
2727 networkingv1 "k8s.io/api/networking/v1"
2828 rbacv1 "k8s.io/api/rbac/v1"
29+ "k8s.io/apimachinery/pkg/api/resource"
2930 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3031 "k8s.io/apimachinery/pkg/util/intstr"
3132 "k8s.io/utils/ptr"
@@ -135,6 +136,8 @@ type NIMServiceList struct {
135136// NIMServiceStorage defines the attributes of various storage targets used to store the model.
136137type NIMServiceStorage struct {
137138 NIMCache NIMCacheVolSpec `json:"nimCache,omitempty"`
139+ // EmptyDirSizeLimit is the size limit for the emptyDir volume
140+ EmptyDirSizeLimit * resource.Quantity `json:"emptyDirSizeLimit,omitempty"`
138141 // PersistentVolumeClaim is the pvc volume used for caching NIM
139142 PVC PersistentVolumeClaim `json:"pvc,omitempty"`
140143 // HostPath is the host path volume for caching NIM
@@ -449,7 +452,8 @@ func (n *NIMService) GetVolumes(modelPVC PersistentVolumeClaim) []corev1.Volume
449452 Name : "dshm" ,
450453 VolumeSource : corev1.VolumeSource {
451454 EmptyDir : & corev1.EmptyDirVolumeSource {
452- Medium : corev1 .StorageMediumMemory ,
455+ Medium : corev1 .StorageMediumMemory ,
456+ SizeLimit : n .Spec .Storage .EmptyDirSizeLimit ,
453457 },
454458 },
455459 },
0 commit comments