diff --git a/k8s/helm-charts/seldon-core-v2-crds/templates/seldon-v2-crds.yaml b/k8s/helm-charts/seldon-core-v2-crds/templates/seldon-v2-crds.yaml index b60c224544..f648ae3c32 100644 --- a/k8s/helm-charts/seldon-core-v2-crds/templates/seldon-v2-crds.yaml +++ b/k8s/helm-charts/seldon-core-v2-crds/templates/seldon-v2-crds.yaml @@ -170,9 +170,13 @@ spec: jsonPath: .status.conditions[?(@.type=="ModelReady")].status name: Ready type: string - - description: Number of replicas - jsonPath: .status.replicas - name: Replicas + - description: Number of desired replicas + jsonPath: .spec.replicas + name: Desired Replicas + type: integer + - description: Number of replicas available to receive inference requests + jsonPath: .status.availableReplicas + name: Available Replicas type: integer - jsonPath: .metadata.creationTimestamp name: Age diff --git a/k8s/yaml/crds.yaml b/k8s/yaml/crds.yaml index bdf807c1f3..d9da3271b2 100644 --- a/k8s/yaml/crds.yaml +++ b/k8s/yaml/crds.yaml @@ -173,9 +173,13 @@ spec: jsonPath: .status.conditions[?(@.type=="ModelReady")].status name: Ready type: string - - description: Number of replicas - jsonPath: .status.replicas - name: Replicas + - description: Number of desired replicas + jsonPath: .spec.replicas + name: Desired Replicas + type: integer + - description: Number of replicas available to receive inference requests + jsonPath: .status.availableReplicas + name: Available Replicas type: integer - jsonPath: .metadata.creationTimestamp name: Age diff --git a/operator/apis/mlops/v1alpha1/model_types.go b/operator/apis/mlops/v1alpha1/model_types.go index 0adc8ff8e5..8a576ca7ef 100644 --- a/operator/apis/mlops/v1alpha1/model_types.go +++ b/operator/apis/mlops/v1alpha1/model_types.go @@ -117,7 +117,8 @@ type ModelStatus struct { //+kubebuilder:resource:shortName=mlm //+kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas //+kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="ModelReady")].status`,description="Model ready status" -//+kubebuilder:printcolumn:name="Replicas",type=integer,JSONPath=`.status.replicas`, description="Number of replicas" +//+kubebuilder:printcolumn:name="Desired Replicas",type=integer,JSONPath=`.spec.replicas`,description="Number of desired replicas" +//+kubebuilder:printcolumn:name="Available Replicas",type=integer,JSONPath=`.status.availableReplicas`,description="Number of replicas available to receive inference requests" //+kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` // Model is the Schema for the models API diff --git a/operator/config/crd/bases/mlops.seldon.io_models.yaml b/operator/config/crd/bases/mlops.seldon.io_models.yaml index 553ba7cde3..a6d5d47173 100644 --- a/operator/config/crd/bases/mlops.seldon.io_models.yaml +++ b/operator/config/crd/bases/mlops.seldon.io_models.yaml @@ -22,9 +22,13 @@ spec: jsonPath: .status.conditions[?(@.type=="ModelReady")].status name: Ready type: string - - description: Number of replicas - jsonPath: .status.replicas - name: Replicas + - description: Number of desired replicas + jsonPath: .spec.replicas + name: Desired Replicas + type: integer + - description: Number of replicas available to receive inference requests + jsonPath: .status.availableReplicas + name: Available Replicas type: integer - jsonPath: .metadata.creationTimestamp name: Age diff --git a/operator/scheduler/model.go b/operator/scheduler/model.go index 8c4a9c7c73..ec366258be 100644 --- a/operator/scheduler/model.go +++ b/operator/scheduler/model.go @@ -255,6 +255,8 @@ func (s *SchedulerClient) SubscribeModelEvents(ctx context.Context, grpcClient s } // Set the total number of replicas targeted by this model + // The .status.replicas CRD field is used by HPA to determine the current + // number replicas that exist, irrespective of their state latestModel.Status.Replicas = int32( modelStatus.GetAvailableReplicas() + modelStatus.GetUnavailableReplicas(),