Uploaded image for project: 'OpenShift Request For Enhancement'
  1. OpenShift Request For Enhancement
  2. RFE-5576

ScaledObject status should provide more details to improve troubleshooting experience

XMLWordPrintable

    • False
    • None
    • False
    • Not Selected

      1. Proposed title of this feature request
      ScaledObject status should provide more details to improve troubleshooting experience

      2. What is the nature and description of the request?
      Custom Metrics Autoscaler is a great tool, showing good adoption in the field. It though is missing out detailed information in the ScaledObject resource .status when something is not working as expected. For troubleshooting purpose, it's often required to access logs from the components in openshift-keda which though is restricted in enterprise environment.

      To improve overall developer and user experience, it's requested to improve the .status messaging in ScaledObject to better highlight why the scaler may not work as expected.

        status:
          conditions:
          - message: failed to ensure HPA is correctly created for ScaledObject
            reason: ScaledObjectCheckFailed
            status: "False"
            type: Ready
          - message: ScaledObject check failed
            reason: UnknownState
            status: Unknown
            type: Active
          - status: Unknown
            type: Fallback
          - status: Unknown
            type: Paused
          originalReplicaCount: 1
          scaleTargetGVKR:
            group: apps
            kind: Deployment
            resource: deployments
            version: v1
          scaleTargetKind: apps/v1.Deployment
      

      The above shows an example where the secret in TriggerAuthentication is invalid. But based on the message this is not clear and therefore difficult to troubleshoot for a regular user.

      2024-06-03T10:42:15Z	ERROR	Failed to create new HPA resource	{"controller": "scaledobject", "controllerGroup": "keda.sh", "controllerKind": "ScaledObject", "ScaledObject": {"name":"quarkus-app-scaledobject","namespace":"project-100"}, "namespace": "project-100", "name": "quarkus-app-scaledobject", "reconcileID": "16572472-af58-46fc-a825-07b3cbf33168", "HPA.Namespace": "project-100", "HPA.Name": "keda-hpa-quarkus-app-scaledobject", "error": "error parsing prometheus metadata: no bearer token provided"}
      github.com/kedacore/keda/v2/controllers/keda.(*ScaledObjectReconciler).createAndDeployNewHPA
      	/remote-source/keda/app/controllers/keda/hpa.go:52
      github.com/kedacore/keda/v2/controllers/keda.(*ScaledObjectReconciler).ensureHPAForScaledObjectExists
      	/remote-source/keda/app/controllers/keda/scaledobject_controller.go:438
      github.com/kedacore/keda/v2/controllers/keda.(*ScaledObjectReconciler).reconcileScaledObject
      	/remote-source/keda/app/controllers/keda/scaledobject_controller.go:267
      github.com/kedacore/keda/v2/controllers/keda.(*ScaledObjectReconciler).Reconcile
      	/remote-source/keda/app/controllers/keda/scaledobject_controller.go:180
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile
      	/remote-source/keda/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:119
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
      	/remote-source/keda/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:316
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
      	/remote-source/keda/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:266
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
      	/remote-source/keda/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:227
      

      The above shows the logs from the keda Operator providing definitely more details where to look and what potentially could be wrong. Having such kind of information in the .status of the ScaledObject or emitted as Event would greatly improve the experience for developers using the Custom Metrics Autoscaler.

      3. Why does the customer need this? (List the business requirements here)
      In enterprise OpenShift Container Platform 4 environment, consumers are usually restricted to their own namespace and don't have access to openshift-keda where the respective controller and hence data are available, showing my certain ScaledObject may not work as expected.

      It's therefore required to provide the required information about the state of the ScaledObject in the respective ScaledObject resource or via event in the namespace the ScaledObject is located so that consumers can troubleshoot and fix issues on their own, rather than having to work with the cluster-admin group.

      4. List any affected packages or components.
      Custom Metrics Autoscaler

            gausingh@redhat.com Gaurav Singh
            rhn-support-sreber Simon Reber
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: