From 5b1a9adf3e48b128a98e14cbbe4820b81c698988 Mon Sep 17 00:00:00 2001 From: Ritikaa96 Date: Tue, 26 Jan 2021 00:14:13 +0530 Subject: [PATCH 1/5] Show min/max replica count when using kubectl get scaledobject Signed-off-by: Ritikaa96 --- api/v1alpha1/scaledobject_types.go | 2 ++ config/crd/bases/keda.sh_scaledobjects.yaml | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/api/v1alpha1/scaledobject_types.go b/api/v1alpha1/scaledobject_types.go index 5cbf6465546..5240d997640 100644 --- a/api/v1alpha1/scaledobject_types.go +++ b/api/v1alpha1/scaledobject_types.go @@ -12,6 +12,8 @@ import ( // +kubebuilder:printcolumn:name="ScaleTargetKind",type="string",JSONPath=".status.scaleTargetKind" // +kubebuilder:printcolumn:name="ScaleTargetName",type="string",JSONPath=".spec.scaleTargetRef.name" // +kubebuilder:printcolumn:name="Triggers",type="string",JSONPath=".spec.triggers[*].type" +// +kubebuilder:printcolumn:name="Min Replicas",type="integer",JSONPath=".spec.minReplicaCount" +// +kubebuilder:printcolumn:name="Max Replicas",type="integer",JSONPath=".spec.maxReplicaCount" // +kubebuilder:printcolumn:name="Authentication",type="string",JSONPath=".spec.triggers[*].authenticationRef.name" // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status" // +kubebuilder:printcolumn:name="Active",type="string",JSONPath=".status.conditions[?(@.type==\"Active\")].status" diff --git a/config/crd/bases/keda.sh_scaledobjects.yaml b/config/crd/bases/keda.sh_scaledobjects.yaml index 40fb95b88e1..c45787257fe 100644 --- a/config/crd/bases/keda.sh_scaledobjects.yaml +++ b/config/crd/bases/keda.sh_scaledobjects.yaml @@ -28,6 +28,12 @@ spec: - jsonPath: .spec.triggers[*].type name: Triggers type: string + - jsonPath: .spec.minReplicaCount + name: MinReplicas + type: integer + - jsonPath: .spec.maxReplicaCount + name: MaxReplicas + type: integer - jsonPath: .spec.triggers[*].authenticationRef.name name: Authentication type: string From 5553e6df0353a24d7c7e11844a112d7b93263130 Mon Sep 17 00:00:00 2001 From: Ritikaa96 Date: Tue, 26 Jan 2021 01:07:21 +0530 Subject: [PATCH 2/5] addressing the comments to show min/max replica counts when using kubectl get so Signed-off-by: Ritikaa96 --- api/v1alpha1/scaledobject_types.go | 4 ++-- config/crd/bases/keda.sh_scaledobjects.yaml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/v1alpha1/scaledobject_types.go b/api/v1alpha1/scaledobject_types.go index 5240d997640..a8da98fef50 100644 --- a/api/v1alpha1/scaledobject_types.go +++ b/api/v1alpha1/scaledobject_types.go @@ -12,8 +12,8 @@ import ( // +kubebuilder:printcolumn:name="ScaleTargetKind",type="string",JSONPath=".status.scaleTargetKind" // +kubebuilder:printcolumn:name="ScaleTargetName",type="string",JSONPath=".spec.scaleTargetRef.name" // +kubebuilder:printcolumn:name="Triggers",type="string",JSONPath=".spec.triggers[*].type" -// +kubebuilder:printcolumn:name="Min Replicas",type="integer",JSONPath=".spec.minReplicaCount" -// +kubebuilder:printcolumn:name="Max Replicas",type="integer",JSONPath=".spec.maxReplicaCount" +// +kubebuilder:printcolumn:name="Min",type="integer",JSONPath=".spec.minReplicaCount" +// +kubebuilder:printcolumn:name="Max",type="integer",JSONPath=".spec.maxReplicaCount" // +kubebuilder:printcolumn:name="Authentication",type="string",JSONPath=".spec.triggers[*].authenticationRef.name" // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status" // +kubebuilder:printcolumn:name="Active",type="string",JSONPath=".status.conditions[?(@.type==\"Active\")].status" diff --git a/config/crd/bases/keda.sh_scaledobjects.yaml b/config/crd/bases/keda.sh_scaledobjects.yaml index c45787257fe..0142e43d938 100644 --- a/config/crd/bases/keda.sh_scaledobjects.yaml +++ b/config/crd/bases/keda.sh_scaledobjects.yaml @@ -29,11 +29,11 @@ spec: name: Triggers type: string - jsonPath: .spec.minReplicaCount - name: MinReplicas + name: Min + type: integer + - jsonPath: .spec.maxReplicaCount + name: Max type: integer - - jsonPath: .spec.maxReplicaCount - name: MaxReplicas - type: integer - jsonPath: .spec.triggers[*].authenticationRef.name name: Authentication type: string From e0c3bcc7d2183fce90a4154c8bef8e56980d17ac Mon Sep 17 00:00:00 2001 From: Ritikaa96 Date: Tue, 26 Jan 2021 15:12:43 +0530 Subject: [PATCH 3/5] shuffling min/max in scaledobject, adding min/max replicacount when using kubectl get scaledjob Signed-off-by: Ritikaa96 --- 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 +++--- 4 files changed, 12 insertions(+), 4 deletions(-) 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 a8da98fef50..b55d543cd90 100644 --- a/api/v1alpha1/scaledobject_types.go +++ b/api/v1alpha1/scaledobject_types.go @@ -11,9 +11,9 @@ 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="Triggers",type="string",JSONPath=".spec.triggers[*].type" // +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" // +kubebuilder:printcolumn:name="Active",type="string",JSONPath=".status.conditions[?(@.type==\"Active\")].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 0142e43d938..7fc61cf1bf7 100644 --- a/config/crd/bases/keda.sh_scaledobjects.yaml +++ b/config/crd/bases/keda.sh_scaledobjects.yaml @@ -25,15 +25,15 @@ spec: - jsonPath: .spec.scaleTargetRef.name name: ScaleTargetName type: string - - jsonPath: .spec.triggers[*].type - name: Triggers - type: string - jsonPath: .spec.minReplicaCount name: Min type: integer - jsonPath: .spec.maxReplicaCount name: Max type: integer + - jsonPath: .spec.triggers[*].type + name: Triggers + type: string - jsonPath: .spec.triggers[*].authenticationRef.name name: Authentication type: string From 126457a0b39572931f9b6ca0dfa9b2b82e260bf2 Mon Sep 17 00:00:00 2001 From: Ritikaa96 Date: Tue, 26 Jan 2021 15:32:50 +0530 Subject: [PATCH 4/5] CHANGELOG: Show MIN/MAX replica counts when using kubectl get scaledobject Signed-off-by: Ritikaa96 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dde7cf4fd3f..de57173abb5 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` ([#1534](https://github.com/kedacore/keda/pull/1534)) ### Breaking Changes From af6d78760f66c974fbd696428834621b13bb0b19 Mon Sep 17 00:00:00 2001 From: Ritikaa96 Date: Tue, 26 Jan 2021 15:40:02 +0530 Subject: [PATCH 5/5] Changelog correction: Show MIN/MAX replica counts when using kubectl get scaledobject/scaledjob Signed-off-by: Ritikaa96 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de57173abb5..9173d8de444 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,7 +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` ([#1534](https://github.com/kedacore/keda/pull/1534)) +- Show `MIN/MAX` replica counts when using `kubectl get scaledobject/scaledjob` ([#1534](https://github.com/kedacore/keda/pull/1534)) ### Breaking Changes