From 0ac27c30764e1a2e1970bf9dabdc9ae9df962672 Mon Sep 17 00:00:00 2001 From: "Shiva Krishna, Merla" Date: Fri, 16 Aug 2024 11:46:38 -0700 Subject: [PATCH] Add minimum value of 1 for replicas Signed-off-by: Shiva Krishna, Merla --- api/apps/v1alpha1/nimservice_types.go | 7 ++++--- bundle/manifests/apps.nvidia.com_nimpipelines.yaml | 1 + bundle/manifests/apps.nvidia.com_nimservices.yaml | 1 + config/crd/bases/apps.nvidia.com_nimpipelines.yaml | 1 + config/crd/bases/apps.nvidia.com_nimservices.yaml | 1 + .../crds/apps.nvidia.com_nimpipelines.yaml | 1 + .../k8s-nim-operator/crds/apps.nvidia.com_nimservices.yaml | 1 + 7 files changed, 10 insertions(+), 3 deletions(-) diff --git a/api/apps/v1alpha1/nimservice_types.go b/api/apps/v1alpha1/nimservice_types.go index f237aceb..2da68248 100644 --- a/api/apps/v1alpha1/nimservice_types.go +++ b/api/apps/v1alpha1/nimservice_types.go @@ -74,9 +74,10 @@ type NIMServiceSpec struct { StartupProbe Probe `json:"startupProbe,omitempty"` Scale Autoscaling `json:"scale,omitempty"` Metrics Metrics `json:"metrics,omitempty"` - Replicas int `json:"replicas,omitempty"` - UserID *int64 `json:"userID,omitempty"` - GroupID *int64 `json:"groupID,omitempty"` + // +kubebuilder:validation:Minimum=1 + Replicas int `json:"replicas,omitempty"` + UserID *int64 `json:"userID,omitempty"` + GroupID *int64 `json:"groupID,omitempty"` } // NIMCacheVolSpec defines the spec to use NIMCache volume diff --git a/bundle/manifests/apps.nvidia.com_nimpipelines.yaml b/bundle/manifests/apps.nvidia.com_nimpipelines.yaml index 6be56d44..eaeb4dfd 100644 --- a/bundle/manifests/apps.nvidia.com_nimpipelines.yaml +++ b/bundle/manifests/apps.nvidia.com_nimpipelines.yaml @@ -1234,6 +1234,7 @@ spec: type: object type: object replicas: + minimum: 1 type: integer resources: description: ResourceRequirements describes the compute diff --git a/bundle/manifests/apps.nvidia.com_nimservices.yaml b/bundle/manifests/apps.nvidia.com_nimservices.yaml index 3d23321f..1d9b05ef 100644 --- a/bundle/manifests/apps.nvidia.com_nimservices.yaml +++ b/bundle/manifests/apps.nvidia.com_nimservices.yaml @@ -1204,6 +1204,7 @@ spec: type: object type: object replicas: + minimum: 1 type: integer resources: description: ResourceRequirements describes the compute resource requirements. diff --git a/config/crd/bases/apps.nvidia.com_nimpipelines.yaml b/config/crd/bases/apps.nvidia.com_nimpipelines.yaml index 6be56d44..eaeb4dfd 100644 --- a/config/crd/bases/apps.nvidia.com_nimpipelines.yaml +++ b/config/crd/bases/apps.nvidia.com_nimpipelines.yaml @@ -1234,6 +1234,7 @@ spec: type: object type: object replicas: + minimum: 1 type: integer resources: description: ResourceRequirements describes the compute diff --git a/config/crd/bases/apps.nvidia.com_nimservices.yaml b/config/crd/bases/apps.nvidia.com_nimservices.yaml index 3d23321f..1d9b05ef 100644 --- a/config/crd/bases/apps.nvidia.com_nimservices.yaml +++ b/config/crd/bases/apps.nvidia.com_nimservices.yaml @@ -1204,6 +1204,7 @@ spec: type: object type: object replicas: + minimum: 1 type: integer resources: description: ResourceRequirements describes the compute resource requirements. 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 6be56d44..eaeb4dfd 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 @@ -1234,6 +1234,7 @@ spec: type: object type: object replicas: + minimum: 1 type: integer resources: description: ResourceRequirements describes the compute 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 3d23321f..1d9b05ef 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 @@ -1204,6 +1204,7 @@ spec: type: object type: object replicas: + minimum: 1 type: integer resources: description: ResourceRequirements describes the compute resource requirements.