第 15 章 红帽构建的 Kogito 微服务部署故障排除
使用本节中的信息对使用 operator 部署 Red Hat build of Kogito 微服务时可能会遇到的问题进行故障排除。以下信息会在新问题中更新,并发现临时解决方案。
- 没有构建正在运行
如果您没有看到运行任何构建以及相关命名空间中创建的任何资源,请输入以下命令来检索运行的 pod,并查看 pod 的 operator 日志:
查看指定 pod 的 RHPAM Kogito Operator 日志
// Retrieves running pods $ oc get pods NAME READY STATUS RESTARTS AGE kogito-operator-6d7b6d4466-9ng8t 1/1 Running 0 26m // Opens RHPAM Kogito Operator log for the pod $ oc logs -f kogito-operator-6d7b6d4466-9ng8t
- 验证
KogitoRuntime
状态 如果您创建,请使用以下 YAML 定义,带有非已存在的镜像的
KogitoRuntime
应用程序:KogitoRuntime
应用程序的 YAML 定义示例apiVersion: rhpam.kiegroup.org/v1 # Red Hat build of Kogito API for this microservice kind: KogitoRuntime # Application type metadata: name: example # Application name spec: image: 'not-existing-image:latest' replicas: 1
您可以使用 bash 控制台中的
oc describe
应用程序的状态。当您在 bash 控制台中运行KogitoRuntime
命令验证 KogitoRuntimeoc describe KogitoRuntime 示例
命令时,您会收到以下输出:KogitoRuntime
状态示例[user@localhost ~]$ oc describe KogitoRuntime example Name: example Namespace: username-test Labels: <none> Annotations: <none> API Version: rhpam.kiegroup.org/v1 Kind: KogitoRuntime Metadata: Creation Timestamp: 2021-05-20T07:19:41Z Generation: 1 Managed Fields: API Version: rhpam.kiegroup.org/v1 Fields Type: FieldsV1 fieldsV1: f:spec: .: f:image: f:replicas: Manager: Mozilla Operation: Update Time: 2021-05-20T07:19:41Z API Version: rhpam.kiegroup.org/v1 Fields Type: FieldsV1 fieldsV1: f:spec: f:monitoring: f:probes: .: f:livenessProbe: f:readinessProbe: f:resources: f:runtime: f:status: .: f:cloudEvents: f:conditions: Manager: main Operation: Update Time: 2021-05-20T07:19:45Z Resource Version: 272185 Self Link: /apis/rhpam.kiegroup.org/v1/namespaces/ksuta-test/kogitoruntimes/example UID: edbe0bf1-554e-4523-9421-d074070df982 Spec: Image: not-existing-image:latest Replicas: 1 Status: Cloud Events: Conditions: Last Transition Time: 2021-05-20T07:19:44Z Message: Reason: NoPodAvailable Status: False Type: Deployed Last Transition Time: 2021-05-20T07:19:44Z Message: Reason: RequestedReplicasNotEqualToAvailableReplicas Status: True Type: Provisioning Last Transition Time: 2021-05-20T07:19:45Z Message: you may not have access to the container image "quay.io/kiegroup/not-existing-image:latest" Reason: ImageStreamNotReadyReason Status: True Type: Failed
在输出的末尾,您可以看到包含相关消息的
KogitoRuntime
状态。