本页详细介绍了如何排查您可能会遇到的常见软件配置问题。
排查控制平面引导问题
如需排查引导控制平面进程方面的问题,请检查 KIND 集群中的以下资源:
检查
anthos-cluster-operatorPod:kubectl logs deployment/anthos-cluster-operator -c operator -n kube-system检查
AddOn资源:kubectl get AddOn -A您还可以使用
gpc-addons命令查看资源,了解更多信息。检查
AddOnSet资源:kubectl get AddOnSet -A如果在创建组织基础架构集群后(例如在资源转换期间),控制平面引导未完成处理,请手动导出
kubeconfig文件:kubectl get secret root-admin-kubeconfig -n root -o jsonpath="{.data.value}" | base64 -d > /root/path/to/root-admin-kubeconfig.yaml
排查集群创建问题
如需排查集群创建过程中的问题,请按以下步骤操作:
检查集群的当前阶段,并检查对象
Harbor-operator或 Harbor 是否存在,以及通过在AddOnSet资源中运行以下命令来检查其在 KIND 集群中的状态:kubectl get addonset -n fleet-root root-admin -o yaml运行此命令后,在
status.currentStage中找到当前阶段。在组织基础架构集群中,检查
harbor-system命名空间中的资源。如果您通过kubectl get harborcluster harbor -n harbor-system命令部署了HarborCluster对象,则表示安装已进入第二阶段(即 Harbor 阶段)。检查
HarborCluster对象中的status字段:kubectl -n harbor-system get harborcluster harbor如果状态指示
healthy,请使用docker push命令通过 Web 门户验证其功能。访问举报的网址中的门户网站。例如:
https://10.200.0.36:10443。在引导加载程序中,运行命令
docker push。如果状态为
unhealthy,请执行以下条目,查看状态条件中的详细信息:kubectl -n harbor-system get harborcluster harbor -o yaml如果状态显示
healthy,请前往检查 Istio 状态部分。如果状态未显示healthy,请继续下一部分评估 Harbor 命名空间资源。
评估 Harbor 命名空间资源
只有当 harbor-system 资源的状态不是 healthy 时,才需要执行这些步骤。如需检查 harbor-system 资源的状态,请参阅排查集群创建问题。
评估
harbor-system命名空间资源:kubectl get all -n harbor-system检查与 Harbor 运算符相关的资源的状态,包括在组织基础架构集群创建过程的第二阶段构建为子图表的 PostgreSQL 和 Redis 运算符。验证以下运算符是否处于
Running状态:deployment/harbor-operator-harbor-operator deployment/harbor-operator-postgres-operator deployment/harbor-operator-redisoperator验证 PostgreSQL、Redis 和 Harbor 组件的资源是否都处于
healthy状态。如果某些 Pod 未处于healthy状态,请使用以下命令查看失败的 Pod 的详细信息:kubectl get pod -o wide kubectl describe pod您还可以使用以下命令查看管理运算符的日志:
kubectl logs -f deploy/harbor-operator-postgres-operator如需检查 PostgreSQL 资源,请查看
statefulset/postgresql-harbor-system-harbor。如需检查 Redis 资源,请查看:
- Redis 实例:
statefulset/rfr-harbor-redis - Redis 监控程序:
deployment/rfs-harbor-redis
只有当这两个组件都准备就绪时,才会部署 Harbor 核心组件。
如果某些 Harbor 核心组件 Pod 发生故障,请查看发生故障的 Pod 的日志。在某些情况下,PostgreSQL 或 Redis 实例存在通信问题。
例如,如果 Harbor 核心组件无法使用提供的凭据连接到 PostgreSQL 或 Redis,则 Harbor Operator 可能存在问题,因为该 Operator 负责在部署 Harbor 核心组件之前设置凭据。
- Redis 实例:
检查 Istio 状态
如需验证 Pod 状态是否为 istio(例如 istio-system 和 service/istio-ingressgateway),请检查端口 10443 是否已公开。