您正在查看 Apigee 和 Apigee Hybrid 文档。
查看 Apigee Edge 文档。
症状
您可能会观察到以下某种症状:
- 客户端应用收到超时错误,以此响应 Apigee Hybrid 上的 API 调用。
- 在 Hybrid 安装过程中将配置 (overrides.yaml) 应用于集群时,会观察到诸如Error from server (invalid)或The Job "apigee-resources-install" is invalid等错误。
错误消息
您可能会观察到以下某种错误:
对 API 调用的错误响应
    Apigee Hybrid 上的 API 请求可能会失败,并显示以下错误消息:
* Connection failed * connect to 34.84.67.39 port 443 failed: Operation timed out * Failed to connect to example.apis.com port 443: Operation timed out * Closing connection 0 curl: (7) Failed to connect to example.apis.com port 443: Operation timed out
将配置 (overrides.yaml) 应用到集群时观察到错误
    在安装过程中将配置(overrides.yaml 文件)应用于集群时,您可能会观察到以下某种错误:
错误 #1
helm upgrade operator apigee-operator/ \ --install \ --create-namespace \ --namespace APIGEE_NAMESPACE \ --atomic \ -f OVERRIDES_FILE
... ... Error from server (Invalid): error when applying patch: to: Resource: "batch/v1, Resource=jobs", GroupVersionKind: "batch/v1, Kind=Job" Name: "istio-init-crd-10-1.4.6", Namespace: "istio-system" to: Resource: "batch/v1, Resource=jobs", GroupVersionKind: "batch/v1, Kind=Job" Name: "istio-init-crd-11-1.4.6", Namespace: "istio-system" to: Resource: "batch/v1, Resource=jobs", GroupVersionKind: "batch/v1, Kind=Job" Name: "istio-init-crd-14-1.4.6", Namespace: "istio-system"
错误 #2
helm upgrade operator apigee-operator/ \ --install \ --create-namespace \ --namespace APIGEE_NAMESPACE \ --atomic \ -f OVERRIDES_FILE
... ... The Job "apigee-resources-install" is invalid: spec.template: Invalid value: core.PodTemplateSpec{ObjectMeta:v1.ObjectMeta{Name:"apigee-resources-install", GenerateName:"", Namespace:"", SelfLink:"", UID:"", ResourceVersion:"", Generation:0,
可能的原因
    如果 istio-ingressgateway 服务处于 pending 状态,并且无法绑定到如下所示的外部 IP 地址,则可能会出现这些错误:
kubectl get services -n istio-system
NAME                      TYPE         CLUSTER-IP   EXTERNAL-IP  PORT(S)             AGE
istio-ingressgateway      LoadBalancer 10.198.5.104 <pending>    15020:31927/TCP,    12h
                                                                 80:31381/TCP,
                                                                 443:31391/TCP,
                                                                 31400:31401/TCP,
                                                                 15443:32623/TCP
    istio-ingressgateway 服务处于 pending 状态的可能原因如下:
| 原因 | 说明 | 
|---|---|
| istio-system 命名空间中有作业处于错误/待处理状态 | istio-system命名空间中的incomplete/erroneous作业可能会导致istio-ingressgateway服务永久处于pending状态,并且无法绑定到外部 IP 地址。 | 
| apigee-system 命名空间中有 apigee-resources-install 作业处于错误/待处理状态 | apigee-system命名空间中的incomplete作业可能会导致istio- ingressgateway服务永久处于pending状态,并且无法绑定到外部 IP 地址。 | 
| 分配给外部负载均衡器的 IP 地址范围不正确 | istio-operator.yaml文件中配置的 IP 地址范围可能不正确,从而导致istio-ingressgateway服务永久进入pending状态,并且在安装过程中无法绑定到外部 IP 地址。 | 
原因:istio-system 命名空间中有作业处于错误/待处理状态
诊断
- 使用以下命令检查 istio-system命名空间中的作业状态:kubectl get jobs -n istio-system 
- 作业状态必须为 complete。如果作业状态为erroneous/pending,则会导致此问题。
解决方法
- 如果有任何作业处于 pending或erroneous状态,请使用以下命令删除这些作业:kubectl -n istio-system delete job JOB_NAME_FROM_STEP_1 
- 通过应用 overrides.yaml文件重新运行安装:使用 Helm 更新 apigee-serving-cert:helm install operator apigee-operator/ --namespace APIGEE_NAMESPACE \ --atomic \ -f OVERRIDES_FILE \ --dry-run=server 请务必包含显示的所有设置,包括 --atomic,以便在操作失败时进行回滚。安装图表: helm upgrade operator apigee-operator/ --namespace APIGEE_NAMESPACE \ --atomic \ -f OVERRIDES_FILE 
原因:apigee-system 命名空间中的 apigee-resources-install 作业可能处于错误状态
诊断
- 使用以下命令检查 apigee-system命名空间中的作业状态:kubectl get jobs -n apigee-system 
- 作业状态必须为 complete。如果作业状态为erroneous/pending,则会导致此问题。以下示例输出显示作业apigee-resources-install已成功完成。kubectl get jobs -n apigee-system NAME COMPLETIONS DURATION AGE apigee-resources-install 1/1 23s 16d 
解决方法
- 如果有作业处于 pending或erroneous状态,请使用以下命令删除这些作业:kubectl -n apigee-system delete job JOB_NAME_FROM_STEP_1 
- 通过应用 overrides.yaml文件重新运行安装:apigeectl apply -f overrides.yaml 
原因:分配给外部负载均衡器的 IP 地址范围不正确
诊断
- 在 istio- operator.yaml文件中检查为负载均衡器配置的 IP 地址。例如,以下代码段显示了istio-operator.yaml文件中配置 IP 地址的位置:-name: istio-ingressgateway enabled: true k8s: service: type: LoadBalancer loadBalancerIP: 10.195.24.23 
- istio-ingressgateway服务在- istio-operator.yaml文件中被配置为负载均衡器(由类型指示)。在 ASM 安装过程中,系统会使用配置的 IP 地址创建负载均衡器,并使用有线方式与- istio- ingressgateway服务进行通信。因此,应正确配置 IP 地址并将其预留给负载均衡器。
- 请与您的网络团队联系并验证为 loadBalancerIP配置的 IP 地址是否正确。如果不正确,负载均衡器服务将无法绑定到 IP 地址。这会导致istio-ingressgateway服务永久处于pending状态。
解决方法
- 请与您的网络团队合作并在 istio- operator.yaml文件中配置正确的 IP 地址。
- 重新运行 Apigee 入站流量网关的安装并应用 overrides.yaml文件:helm upgrade $ORG_NAME apigee-org/ \ --install \ --namespace APIGEE_NAMESPACE \ --atomic \ -f OVERRIDES_FILE 
必须收集的诊断信息
如果按照上述说明操作后问题仍然存在,请收集以下诊断信息,然后与 Google Cloud Customer Care 联系:
- Google Cloud 项目 ID
- Apigee Hybrid 组织的名称
- Kubernetes 集群名称
- Google Cloud 项目名称(如果 kubernetes 集群位于不同的 Google Cloud 项目中)
- overrides.yaml文件
- 在 ASM 安装过程中使用的 Istio-operator .yaml文件。
- 收集 istio-system命名空间中的每个istio-ingressgatewaypod 的日志:kubectl logs NAME_OF_ISTIO_INGRESSGATEWAY_POD -n istio-system > /tmp/NAME_OF_ISTIO_INGRESSGATEWAY_POD.log 
- 收集 istio-system命名空间中的每个 pod 的说明:kubectl describe pod NAME_OF_ISTIO_INGRESSGATEWAY_POD -n istio-system > /tmp/NAME_OF_ISTIO_INGRESSGATEWAY_POD.yaml 
- 收集 istio-system命名空间中的服务列表:kubectl get svc -n istio-system