×

打开支持案例时,向Red Hat支持提供有关集群的调试信息非常有用。

为了帮助您排除问题,请提供以下信息

  • 使用must-gather工具收集的数据。

  • 唯一的集群ID。

您可以使用must-gather工具收集有关自定义指标自动缩放操作符及其组件的数据,包括以下项目

  • openshift-keda命名空间及其子对象。

  • 自定义指标自动缩放操作符安装对象。

  • 自定义指标自动缩放操作符CRD对象。

收集调试数据

以下命令运行自定义指标自动缩放操作符的must-gather工具

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

标准OpenShift Container Platform must-gather命令oc adm must-gather不会收集自定义指标自动缩放操作符数据。

先决条件
  • 您已以具有cluster-admin角色的用户身份登录到OpenShift Container Platform。

  • 已安装OpenShift Container Platform CLI (oc)。

步骤
  1. 导航到要存储must-gather数据的目录。

    如果您的集群使用受限网络,则必须采取其他步骤。如果您的镜像注册表具有受信任的CA,则必须首先将受信任的CA添加到集群。对于受限网络上的所有集群,必须通过运行以下命令将默认must-gather镜像导入为镜像流。

    $ oc import-image is/must-gather -n openshift
  2. 执行以下操作之一

    • 要仅获取自定义指标自动缩放操作符must-gather数据,请使用以下命令

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

      自定义must-gather命令镜像直接从操作符包清单中提取,以便它可以在任何可以使用自定义指标自动缩放操作符的集群上运行。

    • 要除了自定义指标自动缩放操作符信息之外还收集默认must-gather数据

      1. 使用以下命令获取自定义指标自动缩放操作符镜像并将其设置为环境变量

        $ IMAGE="$(oc get packagemanifests openshift-custom-metrics-autoscaler-operator \
          -n openshift-marketplace \
          -o jsonpath='{.status.channels[?(@.name=="stable")].currentCSVDesc.annotations.containerImage}')"
      2. 使用带有自定义指标自动缩放操作符镜像的oc adm must-gather

        $ oc adm must-gather --image-stream=openshift/must-gather --image=${IMAGE}
    自定义指标自动缩放器的示例must-gather输出
    └── openshift-keda
        ├── apps
        │   ├── daemonsets.yaml
        │   ├── deployments.yaml
        │   ├── replicasets.yaml
        │   └── statefulsets.yaml
        ├── apps.openshift.io
        │   └── deploymentconfigs.yaml
        ├── autoscaling
        │   └── horizontalpodautoscalers.yaml
        ├── batch
        │   ├── cronjobs.yaml
        │   └── jobs.yaml
        ├── build.openshift.io
        │   ├── buildconfigs.yaml
        │   └── builds.yaml
        ├── core
        │   ├── configmaps.yaml
        │   ├── endpoints.yaml
        │   ├── events.yaml
        │   ├── persistentvolumeclaims.yaml
        │   ├── pods.yaml
        │   ├── replicationcontrollers.yaml
        │   ├── secrets.yaml
        │   └── services.yaml
        ├── discovery.k8s.io
        │   └── endpointslices.yaml
        ├── image.openshift.io
        │   └── imagestreams.yaml
        ├── k8s.ovn.org
        │   ├── egressfirewalls.yaml
        │   └── egressqoses.yaml
        ├── keda.sh
        │   ├── kedacontrollers
        │   │   └── keda.yaml
        │   ├── scaledobjects
        │   │   └── example-scaledobject.yaml
        │   └── triggerauthentications
        │       └── example-triggerauthentication.yaml
        ├── monitoring.coreos.com
        │   └── servicemonitors.yaml
        ├── networking.k8s.io
        │   └── networkpolicies.yaml
        ├── openshift-keda.yaml
        ├── pods
        │   ├── custom-metrics-autoscaler-operator-58bd9f458-ptgwx
        │   │   ├── custom-metrics-autoscaler-operator
        │   │   │   └── custom-metrics-autoscaler-operator
        │   │   │       └── logs
        │   │   │           ├── current.log
        │   │   │           ├── previous.insecure.log
        │   │   │           └── previous.log
        │   │   └── custom-metrics-autoscaler-operator-58bd9f458-ptgwx.yaml
        │   ├── custom-metrics-autoscaler-operator-58bd9f458-thbsh
        │   │   └── custom-metrics-autoscaler-operator
        │   │       └── custom-metrics-autoscaler-operator
        │   │           └── logs
        │   ├── keda-metrics-apiserver-65c7cc44fd-6wq4g
        │   │   ├── keda-metrics-apiserver
        │   │   │   └── keda-metrics-apiserver
        │   │   │       └── logs
        │   │   │           ├── current.log
        │   │   │           ├── previous.insecure.log
        │   │   │           └── previous.log
        │   │   └── keda-metrics-apiserver-65c7cc44fd-6wq4g.yaml
        │   └── keda-operator-776cbb6768-fb6m5
        │       ├── keda-operator
        │       │   └── keda-operator
        │       │       └── logs
        │       │           ├── current.log
        │       │           ├── previous.insecure.log
        │       │           └── previous.log
        │       └── keda-operator-776cbb6768-fb6m5.yaml
        ├── policy
        │   └── poddisruptionbudgets.yaml
        └── route.openshift.io
            └── routes.yaml
  3. 从工作目录中创建的must-gather目录创建一个压缩文件。例如,在使用Linux操作系统的计算机上,运行以下命令

    $ tar cvaf must-gather.tar.gz must-gather.local.5421342344627712289/ (1)
    1 must-gather-local.5421342344627712289/替换为实际的目录名称。
  4. 将压缩文件附加到Red Hat客户门户上的支持案例。