From aa9f9b3011aefba4365764a7c32db5d33f83fc7e Mon Sep 17 00:00:00 2001 From: Ritika <52399571+Ritikaa96@users.noreply.github.com> Date: Tue, 26 Jan 2021 16:21:56 +0530 Subject: [PATCH] Show min/max replica count when using kubectl get scaledobject/scaledjob (#1534) Signed-off-by: Ritikaa96 --- CHANGELOG.md | 1 + api/v1alpha1/scaledjob_types.go | 2 ++ api/v1alpha1/scaledobject_types.go | 2 ++ config/crd/bases/keda.sh_scaledjobs.yaml | 6 ++++++ config/crd/bases/keda.sh_scaledobjects.yaml | 6 ++++++ 5 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dde7cf4fd3f..9173d8de444 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ - Check that metricNames are unique in ScaledObject ([#1390](https://github.com/kedacore/keda/pull/1390)) - Serve OpenAPI spec from KEDA Metrics Apiserver ([#1512](https://github.com/kedacore/keda/pull/1512)) - Support metrics with multiple dimensions and configurable metricValues on AWS Cloudwatch Scaler ([#1230](https://github.com/kedacore/keda/issues/1230)) +- Show `MIN/MAX` replica counts when using `kubectl get scaledobject/scaledjob` ([#1534](https://github.com/kedacore/keda/pull/1534)) ### Breaking Changes diff --git a/api/v1alpha1/scaledjob_types.go b/api/v1alpha1/scaledjob_types.go index 4659567bf95..a92041ebb1d 100644 --- a/api/v1alpha1/scaledjob_types.go +++ b/api/v1alpha1/scaledjob_types.go @@ -9,6 +9,8 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:subresource:status // +kubebuilder:resource:path=scaledjobs,scope=Namespaced,shortName=sj +// +kubebuilder:printcolumn:name="Min",type="integer",JSONPath=".spec.minReplicaCount" +// +kubebuilder:printcolumn:name="Max",type="integer",JSONPath=".spec.maxReplicaCount" // +kubebuilder:printcolumn:name="Triggers",type="string",JSONPath=".spec.triggers[*].type" // +kubebuilder:printcolumn:name="Authentication",type="string",JSONPath=".spec.triggers[*].authenticationRef.name" // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status" diff --git a/api/v1alpha1/scaledobject_types.go b/api/v1alpha1/scaledobject_types.go index 5cbf6465546..b55d543cd90 100644 --- a/api/v1alpha1/scaledobject_types.go +++ b/api/v1alpha1/scaledobject_types.go @@ -11,6 +11,8 @@ import ( // +kubebuilder:resource:path=scaledobjects,scope=Namespaced,shortName=so // +kubebuilder:printcolumn:name="ScaleTargetKind",type="string",JSONPath=".status.scaleTargetKind" // +kubebuilder:printcolumn:name="ScaleTargetName",type="string",JSONPath=".spec.scaleTargetRef.name" +// +kubebuilder:printcolumn:name="Min",type="integer",JSONPath=".spec.minReplicaCount" +// +kubebuilder:printcolumn:name="Max",type="integer",JSONPath=".spec.maxReplicaCount" // +kubebuilder:printcolumn:name="Triggers",type="string",JSONPath=".spec.triggers[*].type" // +kubebuilder:printcolumn:name="Authentication",type="string",JSONPath=".spec.triggers[*].authenticationRef.name" // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status" diff --git a/config/crd/bases/keda.sh_scaledjobs.yaml b/config/crd/bases/keda.sh_scaledjobs.yaml index ccd848dc0b8..77a0ac27948 100644 --- a/config/crd/bases/keda.sh_scaledjobs.yaml +++ b/config/crd/bases/keda.sh_scaledjobs.yaml @@ -19,6 +19,12 @@ spec: scope: Namespaced versions: - additionalPrinterColumns: + - jsonPath: .spec.minReplicaCount + name: Min + type: integer + - jsonPath: .spec.maxReplicaCount + name: Max + type: integer - jsonPath: .spec.triggers[*].type name: Triggers type: string diff --git a/config/crd/bases/keda.sh_scaledobjects.yaml b/config/crd/bases/keda.sh_scaledobjects.yaml index 40fb95b88e1..7fc61cf1bf7 100644 --- a/config/crd/bases/keda.sh_scaledobjects.yaml +++ b/config/crd/bases/keda.sh_scaledobjects.yaml @@ -25,6 +25,12 @@ spec: - jsonPath: .spec.scaleTargetRef.name name: ScaleTargetName type: string + - jsonPath: .spec.minReplicaCount + name: Min + type: integer + - jsonPath: .spec.maxReplicaCount + name: Max + type: integer - jsonPath: .spec.triggers[*].type name: Triggers type: string