We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a ScaledObject is created with a long name of more than 63 characters, KEDA fails to create HPA because of the limitation of the label length in the k8s resource.
KEDA creates HPA successfully even when the name of ScaledObject is longer than 63 characters.
KEDA fails to create HPA when the name of ScaledObject is longer than 63 characters.
This is the ScaledObject spec to reproduce the issue.
kubectl apply -f - <<EOF apiVersion: keda.sh/v1alpha1 kind: ScaledObject metadata: name: this-is-64-characters-name-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx spec: minReplicaCount: 1 maxReplicaCount: 10 scaleTargetRef: name: nginx triggers: - type: cpu metricType: Utilization metadata: type: Utilization value: "60" EOF
Here is outputs when checking HPA/ScaledObject.
❯ kubectl get hpa No resources found in default namespace. ❯ kubectl describe so Name: this-is-64-characters-name-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Namespace: default Labels: <none> Annotations: <none> API Version: keda.sh/v1alpha1 Kind: ScaledObject Metadata: Creation Timestamp: 2024-11-28T04:10:24Z Finalizers: finalizer.keda.sh Generation: 1 Resource Version: 3315 UID: 9f9e91ea-c84e-4553-8b4f-8aa9697cff12 Spec: Max Replica Count: 10 Min Replica Count: 1 Scale Target Ref: Name: nginx Triggers: Metadata: Type: Utilization Value: 60 Metric Type: Utilization Type: cpu Status: Conditions: Message: failed to update ScaledObject with scaledObjectName label Reason: ScaledObjectCheckFailed Status: False Type: Ready Message: ScaledObject check failed Reason: UnknownState Status: Unknown Type: Active Message: No fallbacks are active on this scaled object Reason: NoFallbackFound Status: False Type: Fallback Status: Unknown Type: Paused Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning ScaledObjectCheckFailed 69s (x16 over 3m54s) keda-operator failed to update ScaledObject with scaledObjectName label
2024-11-28T04:10:24Z ERROR failed to update ScaledObject with scaledObjectName label {"controller": "scaledobject", "controllerGroup": "keda.sh", "controllerKind": "ScaledObject", "ScaledObject": {"name":"this-is-64-characters-name-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","namespace":"default"}, "namespace": "default", "name": "this-is-64-characters-name-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "reconcileID": "3abc307a-e62a-4142-9ab8-f0b314cd4764", "error": "ScaledObject.keda.sh \"this-is-64-characters-name-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\" is invalid: metadata.labels: Invalid value: \"this-is-64-characters-name-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\": must be no more than 63 characters"} github.com/kedacore/keda/v2/controllers/keda.(*ScaledObjectReconciler).Reconcile /workspace/controllers/keda/scaledobject_controller.go:195 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Reconcile /workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:116 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler /workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:303 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem /workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:263 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.2 /workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:224 2024-11-28T04:10:24Z ERROR Reconciler error {"controller": "scaledobject", "controllerGroup": "keda.sh", "controllerKind": "ScaledObject", "ScaledObject": {"name":"this-is-64-characters-name-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","namespace":"default"}, "namespace": "default", "name": "this-is-64-characters-name-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "reconcileID": "3abc307a-e62a-4142-9ab8-f0b314cd4764", "error": "ScaledObject.keda.sh \"this-is-64-characters-name-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\" is invalid: metadata.labels: Invalid value: \"this-is-64-characters-name-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\": must be no more than 63 characters"} sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler /workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:316 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem /workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:263 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.2 /workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:224
2.16.0
1.29
Any
Any, but I used cpu scaler for testing.
This issue is also mentioned #2915 (comment).
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Report
When a ScaledObject is created with a long name of more than 63 characters, KEDA fails to create HPA because of the limitation of the label length in the k8s resource.
Expected Behavior
KEDA creates HPA successfully even when the name of ScaledObject is longer than 63 characters.
Actual Behavior
KEDA fails to create HPA when the name of ScaledObject is longer than 63 characters.
Steps to Reproduce the Problem
This is the ScaledObject spec to reproduce the issue.
Here is outputs when checking HPA/ScaledObject.
Logs from KEDA operator
KEDA Version
2.16.0
Kubernetes Version
1.29
Platform
Any
Scaler Details
Any, but I used cpu scaler for testing.
Anything else?
This issue is also mentioned #2915 (comment).
The text was updated successfully, but these errors were encountered: