验证

安装完成后,在继续执行安装后任务之前,验证 Core 和所需的 Aligned Extensions。这些检查适用于两种安装路径。如果 global 集群运行 Alauda OS,还需完成 Alauda OS 的其他检查。

前提条件

  • 安装已完成。
  • 你可以访问平台 Web UI 地址。在非 Alauda OS 环境中,该地址由安装程序显示。在 Alauda OS 中,该地址是 install-config.yaml 中的 global.platform.address。
  • 你可以针对新的 global 集群运行 kubectl。在非 Alauda OS 环境中,请从安装节点运行该命令。在 Alauda OS 中,请使用新 global 集群的 kubeconfig。引导节点没有 kubectl。要在该节点上运行本页中的命令,请使用 <extract-dir>/res/<arch>/ac --kubeconfig <install-dir>/output/kubeconfig 代替 kubectl。

验证 Web UI 访问

安装完成后,打开平台 Web UI,并验证平台登录页面是否可访问。在非 Alauda OS 环境中,安装程序会显示平台访问 URL。单击 访问 将其打开。在 Alauda OS 中,打开 https://<platform-access-address>,其中 <platform-access-address> 为 global.platform.address。

验证平台组件、扩展和 Pod

针对新的 global 集群运行以下命令,以确认安装状态。在非 Alauda OS 环境中,请在控制平面节点上运行这些命令。

# All nodes are Ready
kubectl get nodes

# ClusterModule/global reports the base module as deployed and healthy
kubectl get clustermodule global -o jsonpath='{.status.base.deployStatus}{" "}{.status.base.runningStatus}{"\n"}'

# No AppRelease is in a failed state
kubectl get apprelease -A

# Core and Aligned modules report their current phase and version
kubectl get moduleinfo -l cpaas.io/cluster-name=global

# No Pod is stuck outside Running or Completed
kubectl get pod --all-namespaces | awk '{if ($4 != "Running" && $4 != "Completed")print}' | awk -F'[/ ]+' '{if ($3 != $4)print}'

在以下情况下,安装状态正常:

  • 所有 global 集群节点均为 Ready。
  • ClusterModule/global 输出 Completed Healthy。
  • 没有 AppRelease 处于失败状态。
  • 已安装以下平台组件,并且其对应的 ModuleInfo 资源在目标版本报告 Running:
    • Alauda Container Platform Web Console
    • Alauda Container Platform Web Console Central
    • Alauda Container Platform Marketplace Web Console
    • Alauda Container Platform Application Catalog
    • Alauda Container Platform Observability Essentials
    • Alauda Container Platform Essentials
    • Alauda Container Platform Cluster Essentials
    • Alauda Container Platform GatewayAPI Plugin
  • cpaas-system 中的关键 Pod 为 Running 或 Completed。

在 Web Console 中,打开 管理员 > Marketplace > 集群插件,确认所需应用均可用,并且没有任何应用显示安装失败。

验证平台镜像源

确认 ProductBase 记录了预期的平台镜像源:

kubectl get productbase base \
  -o jsonpath='{.spec.registry.address}{"\t"}{.spec.registry.external}{"\n"}'

对于外部 registry,地址为 cpaas-registry.cpaas-system,并且第二个值必须为 true。确认此逻辑 registry 解析到准备好的 registry:

kubectl -n cpaas-system get registry cpaas-registry \
  -o jsonpath='{.spec.mode}{"\t"}{.spec.endpoints}{"\t"}{.status.phase}{"\n"}'

预期输出为 mirror、准备好的 registry 地址以及 Ready。

对于需要身份验证的外部 registry,确认 pull Secret 存在,但不要打印其内容:

kubectl -n cpaas-system get secret global-registry-auth

确认 global 集群记录的 registry 地址与 ProductBase 相同:

kubectl -n cpaas-system get cluster global \
  -o jsonpath='{.metadata.annotations.cpaas\.io/registry-address}{"\n"}'

ProductBase 还包含可选或未安装 Extensions 的目录条目。不要期望 ProductBase.status.artifacts 中的每个条目都为 Ready。与无关 Extension 对应的 Absent 条目本身并不表示安装失败。

确认所需的 Extension 目录条目存在,并且没有任何 Pod 因镜像拉取失败而被阻塞:

kubectl get moduleplugins

kubectl get pods --all-namespaces \
  | awk '$4 ~ /ImagePullBackOff|ErrImagePull/'

Pod 命令不得产生任何输出。根据所需应用、其 ModuleInfo 和 AppRelease 状态以及其正在运行的 Pod,判断安装是否成功。如果所需应用已安装但不可用,请按照安装故障排除中的说明,区分缺少清单与 DNS、路由、防火墙、CA 信任、拉取凭证或 registry 可用性问题。

Alauda OS 的其他检查

如果 global 集群运行 Alauda OS,还应使用 ac 写入 <install-dir>/output/kubeconfig 的 kubeconfig 验证以下内容。在引导节点上,使用 <extract-dir>/res/<arch>/ac 代替 kubectl。

当 create 返回时,某些平台组件(例如 Kube-OVN 和身份验证组件)可能仍在启动。此时,ClusterModule/global 可能会短暂报告 Completed Healthy 以外的状态。这通常会在几分钟内稳定下来。在判定检查失败之前,重复运行最后一个命令,直到其输出 Completed Healthy。

kubectl --kubeconfig <global-kubeconfig> get nodes
kubectl --kubeconfig <global-kubeconfig> get clusters.platform.tkestack.io global \
  -o jsonpath='{.status.phase}'
kubectl --kubeconfig <global-kubeconfig> get pods -n cpaas-system
kubectl --kubeconfig <global-kubeconfig> get clustermodule global \
  -o jsonpath='{.status.base.deployStatus}{" "}{.status.base.runningStatus}{"\n"}'

满足以下所有条件时,安装成功:

  • ac adm alpha global create 已返回,且全部八个阶段均已完成。请参阅监控安装。
  • 所有 global 集群节点均为 Ready。
  • cpaas-system 中的关键 Pod 为 Running 或 Completed。
  • ClusterModule/global 输出 Completed Healthy。

下一步

验证成功后,继续执行后续步骤。在 Alauda OS 上,ac 已停用引导集群;请参阅停用引导集群。