diff --git a/api/apps/v1alpha1/common_types.go b/api/apps/v1alpha1/common_types.go index fffab185..b1402a4b 100644 --- a/api/apps/v1alpha1/common_types.go +++ b/api/apps/v1alpha1/common_types.go @@ -52,7 +52,7 @@ type ServiceMonitor struct { // Autoscaling defines attributes to automatically scale the service based on metrics type Autoscaling struct { Enabled *bool `json:"enabled,omitempty"` - HPASpec autoscalingv2.HorizontalPodAutoscalerSpec `json:"hpaspec,omitempty"` + HPASpec autoscalingv2.HorizontalPodAutoscalerSpec `json:"hpa,omitempty"` } // Image defines image attributes diff --git a/api/apps/v1alpha1/nimcache_types.go b/api/apps/v1alpha1/nimcache_types.go index a8bf29bd..da9eeb65 100644 --- a/api/apps/v1alpha1/nimcache_types.go +++ b/api/apps/v1alpha1/nimcache_types.go @@ -35,7 +35,7 @@ type NIMCacheSpec struct { // Storage is the target storage for caching NIM model Storage Storage `json:"storage"` // Resources defines the minimum resources required for the caching job to run(cpu, memory, gpu). - Resources Resources `json:"resources"` + Resources Resources `json:"resources,omitempty"` // Tolerations for running the job to cache the NIM model Tolerations []corev1.Toleration `json:"tolerations,omitempty"` // NodeSelectors are the node selector labels to schedule the caching job. @@ -56,6 +56,7 @@ type NGCSource struct { // The name of an existing pull secret containing the NGC_API_KEY AuthSecret string `json:"authSecret"` // ModelPuller is the container image that can pull the model + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="modelPuller is an immutable field. Please create a new NIMCache resource instead when you want to change this container." ModelPuller string `json:"modelPuller"` // PullSecret to pull the model puller image PullSecret string `json:"pullSecret,omitempty"` diff --git a/bundle/manifests/apps.nvidia.com_nimcaches.yaml b/bundle/manifests/apps.nvidia.com_nimcaches.yaml index 617ea40d..08cf8e68 100644 --- a/bundle/manifests/apps.nvidia.com_nimcaches.yaml +++ b/bundle/manifests/apps.nvidia.com_nimcaches.yaml @@ -183,6 +183,11 @@ spec: description: ModelPuller is the container image that can pull the model type: string + x-kubernetes-validations: + - message: modelPuller is an immutable field. Please create + a new NIMCache resource instead when you want to change + this container. + rule: self == oldSelf pullSecret: description: PullSecret to pull the model puller image type: string @@ -261,7 +266,6 @@ spec: type: object type: array required: - - resources - source - storage type: object @@ -341,14 +345,16 @@ spec: items: description: NIMProfile defines the profiles that were cached properties: + config: + additionalProperties: + type: string + type: object model: type: string + name: + type: string release: type: string - tags: - additionalProperties: - type: string - type: object type: object type: array pvc: diff --git a/bundle/manifests/apps.nvidia.com_nimpipelines.yaml b/bundle/manifests/apps.nvidia.com_nimpipelines.yaml index 6c1a27c3..6a4eb6c4 100644 --- a/bundle/manifests/apps.nvidia.com_nimpipelines.yaml +++ b/bundle/manifests/apps.nvidia.com_nimpipelines.yaml @@ -1295,7 +1295,7 @@ spec: properties: enabled: type: boolean - hpaspec: + hpa: description: HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler. properties: diff --git a/bundle/manifests/apps.nvidia.com_nimservices.yaml b/bundle/manifests/apps.nvidia.com_nimservices.yaml index bdd38f1f..c47385ea 100644 --- a/bundle/manifests/apps.nvidia.com_nimservices.yaml +++ b/bundle/manifests/apps.nvidia.com_nimservices.yaml @@ -1263,7 +1263,7 @@ spec: properties: enabled: type: boolean - hpaspec: + hpa: description: HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler. properties: diff --git a/config/crd/bases/apps.nvidia.com_nimcaches.yaml b/config/crd/bases/apps.nvidia.com_nimcaches.yaml index ceeafb72..08cf8e68 100644 --- a/config/crd/bases/apps.nvidia.com_nimcaches.yaml +++ b/config/crd/bases/apps.nvidia.com_nimcaches.yaml @@ -183,6 +183,11 @@ spec: description: ModelPuller is the container image that can pull the model type: string + x-kubernetes-validations: + - message: modelPuller is an immutable field. Please create + a new NIMCache resource instead when you want to change + this container. + rule: self == oldSelf pullSecret: description: PullSecret to pull the model puller image type: string @@ -261,7 +266,6 @@ spec: type: object type: array required: - - resources - source - storage type: object diff --git a/config/crd/bases/apps.nvidia.com_nimpipelines.yaml b/config/crd/bases/apps.nvidia.com_nimpipelines.yaml index 6c1a27c3..6a4eb6c4 100644 --- a/config/crd/bases/apps.nvidia.com_nimpipelines.yaml +++ b/config/crd/bases/apps.nvidia.com_nimpipelines.yaml @@ -1295,7 +1295,7 @@ spec: properties: enabled: type: boolean - hpaspec: + hpa: description: HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler. properties: diff --git a/config/crd/bases/apps.nvidia.com_nimservices.yaml b/config/crd/bases/apps.nvidia.com_nimservices.yaml index bdd38f1f..c47385ea 100644 --- a/config/crd/bases/apps.nvidia.com_nimservices.yaml +++ b/config/crd/bases/apps.nvidia.com_nimservices.yaml @@ -1263,7 +1263,7 @@ spec: properties: enabled: type: boolean - hpaspec: + hpa: description: HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler. properties: diff --git a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimcaches.yaml b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimcaches.yaml index 617ea40d..e8e2e9b5 100644 --- a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimcaches.yaml +++ b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimcaches.yaml @@ -183,6 +183,11 @@ spec: description: ModelPuller is the container image that can pull the model type: string + x-kubernetes-validations: + - message: modelPuller is an immutable field. Please create + a new NIMCache resource instead when you want to change + this container. + rule: self == oldSelf pullSecret: description: PullSecret to pull the model puller image type: string @@ -341,14 +346,16 @@ spec: items: description: NIMProfile defines the profiles that were cached properties: + config: + additionalProperties: + type: string + type: object model: type: string + name: + type: string release: type: string - tags: - additionalProperties: - type: string - type: object type: object type: array pvc: diff --git a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimpipelines.yaml b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimpipelines.yaml index 6c1a27c3..6a4eb6c4 100644 --- a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimpipelines.yaml +++ b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimpipelines.yaml @@ -1295,7 +1295,7 @@ spec: properties: enabled: type: boolean - hpaspec: + hpa: description: HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler. properties: diff --git a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimservices.yaml b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimservices.yaml index bdd38f1f..c47385ea 100644 --- a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimservices.yaml +++ b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimservices.yaml @@ -1263,7 +1263,7 @@ spec: properties: enabled: type: boolean - hpaspec: + hpa: description: HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler. properties: