第 12 章 红帽构建的 Kogito 微服务部署故障排除
使用本节中的信息,对使用操作器部署 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 KogitoRuntime example命令验证KogitoRuntime应用程序的状态。当您在 bash控制台中运行 oc 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状态以及相关消息。