@@ -217,3 +217,25 @@ type NGCSecret struct {
217217 // +kubebuilder:default:="NGC_API_KEY"
218218 Key string `json:"key"`
219219}
220+
221+ // PersistentVolumeClaim defines the attributes of PVC.
222+ // +kubebuilder:validation:XValidation:rule="!has(self.create) || !self.create || (has(self.size) && self.size != \"\")", message="size is required for pvc creation"
223+ // +kubebuilder:validation:XValidation:rule="!has(self.create) || !self.create || (has(self.volumeAccessMode) && self.volumeAccessMode != \"\")", message="volumeAccessMode is required for pvc creation"
224+ type PersistentVolumeClaim struct {
225+ // Create specifies whether to create a new PersistentVolumeClaim (PVC).
226+ // If set to false, an existing PVC must be referenced via the `Name` field.
227+ Create * bool `json:"create,omitempty"`
228+ // Name of the PVC to use. Required if `Create` is false (i.e., using an existing PVC).
229+ Name string `json:"name,omitempty"`
230+ // StorageClass to be used for PVC creation. Leave it as empty if the PVC is already created or
231+ // a default storage class is set in the cluster.
232+ StorageClass string `json:"storageClass,omitempty"`
233+ // Size of the NIM cache in Gi, used during PVC creation
234+ Size string `json:"size,omitempty"`
235+ // VolumeAccessMode is the volume access mode of the PVC
236+ VolumeAccessMode corev1.PersistentVolumeAccessMode `json:"volumeAccessMode,omitempty"`
237+ // SubPath is the path inside the PVC that should be mounted
238+ SubPath string `json:"subPath,omitempty"`
239+ // Annotations for the PVC
240+ Annotations map [string ]string `json:"annotations,omitempty"`
241+ }
0 commit comments