Gathering debugging data

You can use the must-gather tool to collect data about the Custom Metrics Autoscaler Operator and its components, including the following items:

  • The openshift-keda namespace and its child objects.

  • The Custom Metric Autoscaler Operator installation objects.

  • The Custom Metric Autoscaler Operator CRD objects.

Gathering debugging data

The following command runs the must-gather tool for the Custom Metrics Autoscaler Operator:

  1. $ oc adm must-gather --image="$(oc get packagemanifests openshift-custom-metrics-autoscaler-operator \
  2. -n openshift-marketplace \
  3. -o jsonpath='{.status.channels[?(@.name=="stable")].currentCSVDesc.annotations.containerImage}')"

The standard OKD must-gather command, oc adm must-gather, does not collect Custom Metrics Autoscaler Operator data.

Prerequisites

  • Access to the cluster as a user with the cluster-admin role.

  • The OKD CLI (oc) installed.

Procedure

  1. Navigate to the directory where you want to store the must-gather data.

    If your cluster is using a restricted network, you must take additional steps. If your mirror registry has a trusted CA, you must first add the trusted CA to the cluster. For all clusters on restricted networks, you must import the default must-gather image as an image stream by running the following command.

    1. $ oc import-image is/must-gather -n openshift
  2. Perform one of the following:

    • To get only the Custom Metrics Autoscaler Operator must-gather data, use the following command:

      1. $ oc adm must-gather --image="$(oc get packagemanifests openshift-custom-metrics-autoscaler-operator \
      2. -n openshift-marketplace \
      3. -o jsonpath='{.status.channels[?(@.name=="stable")].currentCSVDesc.annotations.containerImage}')"

      The custom image for the must-gather command is pulled directly from the Operator package manifests, so that it works on any cluster where the Custom Metric Autoscaler Operator is available.

    • To gather the default must-gather data in addition to the Custom Metric Autoscaler Operator information:

      1. Use the following command to obtain the Custom Metrics Autoscaler Operator image and set it as an environment variable:

        1. $ IMAGE="$(oc get packagemanifests openshift-custom-metrics-autoscaler-operator \
        2. -n openshift-marketplace \
        3. -o jsonpath='{.status.channels[?(@.name=="stable")].currentCSVDesc.annotations.containerImage}')"
      2. Use the oc adm must-gather with the Custom Metrics Autoscaler Operator image:

        1. $ oc adm must-gather --image-stream=openshift/must-gather --image=${IMAGE}
  1. Example must-gather output for the Custom Metric Autoscaler:
  2. ```
  3. └── openshift-keda
  4. ├── apps
  5. │ ├── daemonsets.yaml
  6. │ ├── deployments.yaml
  7. │ ├── replicasets.yaml
  8. │ └── statefulsets.yaml
  9. ├── apps.openshift.io
  10. │ └── deploymentconfigs.yaml
  11. ├── autoscaling
  12. │ └── horizontalpodautoscalers.yaml
  13. ├── batch
  14. │ ├── cronjobs.yaml
  15. │ └── jobs.yaml
  16. ├── build.openshift.io
  17. │ ├── buildconfigs.yaml
  18. │ └── builds.yaml
  19. ├── core
  20. │ ├── configmaps.yaml
  21. │ ├── endpoints.yaml
  22. │ ├── events.yaml
  23. │ ├── persistentvolumeclaims.yaml
  24. │ ├── pods.yaml
  25. │ ├── replicationcontrollers.yaml
  26. │ ├── secrets.yaml
  27. │ └── services.yaml
  28. ├── discovery.k8s.io
  29. │ └── endpointslices.yaml
  30. ├── image.openshift.io
  31. │ └── imagestreams.yaml
  32. ├── k8s.ovn.org
  33. │ ├── egressfirewalls.yaml
  34. │ └── egressqoses.yaml
  35. ├── keda.sh
  36. │ ├── kedacontrollers
  37. │ │ └── keda.yaml
  38. │ ├── scaledobjects
  39. │ │ └── example-scaledobject.yaml
  40. │ └── triggerauthentications
  41. │ └── example-triggerauthentication.yaml
  42. ├── monitoring.coreos.com
  43. │ └── servicemonitors.yaml
  44. ├── networking.k8s.io
  45. │ └── networkpolicies.yaml
  46. ├── openshift-keda.yaml
  47. ├── pods
  48. │ ├── custom-metrics-autoscaler-operator-58bd9f458-ptgwx
  49. │ │ ├── custom-metrics-autoscaler-operator
  50. │ │ │ └── custom-metrics-autoscaler-operator
  51. │ │ │ └── logs
  52. │ │ │ ├── current.log
  53. │ │ │ ├── previous.insecure.log
  54. │ │ │ └── previous.log
  55. │ │ └── custom-metrics-autoscaler-operator-58bd9f458-ptgwx.yaml
  56. │ ├── custom-metrics-autoscaler-operator-58bd9f458-thbsh
  57. │ │ └── custom-metrics-autoscaler-operator
  58. │ │ └── custom-metrics-autoscaler-operator
  59. │ │ └── logs
  60. │ ├── keda-metrics-apiserver-65c7cc44fd-6wq4g
  61. │ │ ├── keda-metrics-apiserver
  62. │ │ │ └── keda-metrics-apiserver
  63. │ │ │ └── logs
  64. │ │ │ ├── current.log
  65. │ │ │ ├── previous.insecure.log
  66. │ │ │ └── previous.log
  67. │ │ └── keda-metrics-apiserver-65c7cc44fd-6wq4g.yaml
  68. │ └── keda-operator-776cbb6768-fb6m5
  69. │ ├── keda-operator
  70. │ │ └── keda-operator
  71. │ │ └── logs
  72. │ │ ├── current.log
  73. │ │ ├── previous.insecure.log
  74. │ │ └── previous.log
  75. │ └── keda-operator-776cbb6768-fb6m5.yaml
  76. ├── policy
  77. │ └── poddisruptionbudgets.yaml
  78. └── route.openshift.io
  79. └── routes.yaml
  80. ```