1.3. 已知问题


查看 Red Hat Advanced Cluster Management for Kubernetes 中的已知问题。以下列表包含本发行版本的已知问题,或从上一版本中继承的问题。对于 Red Hat OpenShift Container Platform 集群,请参阅 OpenShift Container Platform 已知问题

1.3.1. 已知的升级问题

从 2.1.x 升级到 2.3.2 后,一些集群可能会出现降级问题,因为 Observability 附加组件未就绪,镜像清单 ConfigMap 不会被正确读取,从而导致镜像不正确。

要解决这个问题,请运行以下命令重启 multicluster-observability-operator pod:

oc delete pod multicluster-observability-operator -n open-cluster-management

1.3.1.2. 升级到 2.1.x 会导致证书丢失

在将 Red Hat Advanced Cluster Management 从 2.0 升级到 2.1 后,指定在打开应用程序模板编辑器时不会预选应用程序的设置。如果您在应用程序模板编辑器中更改了应用程序设置,您必须在保存和关闭编辑器前选择应用部署设置。

1.3.1.3. 升级到 2.1.1 会导致证书丢失

当您的集群升级到 Red Hat Advanced Cluster Management 版本 2.1.1 时,您会丢失集群中的一些或全部证书。您可以输入以下命令之一来确认这种情况:

oc get certificates -n open-cluster-management
Copy to Clipboard Toggle word wrap

oc get pods -n open-cluster-management | grep -vE "Completed|Running"
Copy to Clipboard Toggle word wrap

如果您运行第一个命令时返回的证书数量少于预期,或者在运行第二个命令后返回一个以上 pod,请运行 generate-update-issue-cert-manifest.sh 脚本来更新证书。

在某些情况下,将 Red Hat Advanced Cluster Management for Kubernetes 2.1.0 升级到 Red Hat Advanced Cluster Management 2.1.1 无法完成,显示类似以下的错误:

failed to get candidate release: rendered manifests contain a resource
that already exists. Unable to continue with update: ClusterImageSet "img4.6.1-x86-64"
in namespace "" exists and cannot be imported into the current release: invalid
ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by":
must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name":
must be set to "console-chart-c4cb5"; annotation validation error: missing key
"meta.helm.sh/release-namespace": must be set to "open-cluster-management"
Copy to Clipboard Toggle word wrap

当现有版本中的一个或多个 ClusterImageSet 的名称与升级时添加的版本的名称相同时会出现这种情况,这会导致冲突。要临时解决这个问题,请完成以下步骤:

  1. 停止正在运行的升级。
  2. 从您在错误消息中标识的本地环境中删除 ClusterImageSet 或 ClusterImageSets。
  3. 重启升级。

1.3.1.5. 升级到 2.1.1 禁用 klusterletaddonconfig CRD

当您的 Red Hat Advanced Cluster Management 从 2.1.0 升级到 2.1.1 时,在升级过程中可能会重新安装 klusterletaddonconfig 自定义资源定义(CRD)。如果发生了这种情况,所有的附加组件在集群设置页面中都会显示为 Disabled 状态。完成以下步骤以诊断问题并恢复 klusterletaddonconfig CRD:

  1. 使用 oc login 命令登录到 hub 集群。
  2. 运行以下命令,以确认因为重新安装了 CRD 而导致 klusterletaddonconfig CRD 被删除:

    % oc get klusterletaddonconfig --all-namespaces
    Copy to Clipboard Toggle word wrap

    如果返回的内容为 No resources found,则问题就可能是因为重新安装造成的。继续第 3 步。

  3. 将以下脚本保存到文件中。在这个示例中,文件名是 restore-addons.sh

    KUBECTL=oc
    ACM_NAMESPACE=open-cluster-management
    
    ACM_VERSION=$(${KUBECTL} get -n ${ACM_NAMESPACE} `${KUBECTL} get mch -oname -n ${ACM_NAMESPACE} | head -n1` -ojsonpath='{.status.desiredVersion}')
    if [ "${ACM_VERSION}" = ""  ]; then
    ACM_VERSION=2.1.1
    fi
    
    echo "ACM version: ${ACM_VERSION}"
    
    for clusterName in `${KUBECTL} get managedcluster --ignore-not-found | grep -v "NAME" | awk '{ print $1 }'`; do
        echo "Checking klusterletaddonconfig in ${clusterName} namespace."
        ${KUBECTL} get klusterletaddonconfig ${clusterName} -n ${clusterName} >/dev/null 2>&1
        if [ "$?" != "0"  ]; then
            echo "  klusterletaddonconfig in ${clusterName} is missing."
            echo "  Creating..."
            printf "  "
            cat <<EOF | ${KUBECTL}  apply -f -
    apiVersion: agent.open-cluster-management.io/v1
    kind: KlusterletAddonConfig
    metadata:
      name: ${clusterName}
      namespace: ${clusterName}
    spec:
      clusterLabels:
        cloud: auto-detect
        vendor: auto-detect
      clusterName: ${clusterName}
      clusterNamespace: ${clusterName}
      applicationManager:
        enabled: true
      certPolicyController:
        enabled: true
      iamPolicyController:
        enabled: true
      policyController:
        enabled: true
      searchCollector:
        enabled: true
      version: ${ACM_VERSION}
    EOF
    
        fi
        echo "  Done."
    done
    Copy to Clipboard Toggle word wrap

    如果您没有在 open-cluster-management 命名空间中安装 Red Hat Advanced Cluster Management,请将 ACM_NAMESPACE 的值替换为您的命名空间名称。

  4. 通过 CLI 运行脚本。您的命令应类似以下命令:

    chmod +x restore-addons.sh && ./restore-addons.sh
    Copy to Clipboard Toggle word wrap

    运行该脚本会在每个受管集群命名空间中重新创建缺少的 klusterletaddonconfig CRD。

当 OpenShift Container Platform 集群处于升级阶段时,集群 Pod 会被重启,并且集群可能在大约 1 到 5 分钟之内会处于升级失败状态。这个行为是正常的,在几分钟后自动解决。

从 Red Hat Advanced Cluster Management 版本 2.0.4 升级到 2.1 后,运行 oc get csv 命令。在输出中,Red Hat Advanced Cluster Management ClusterServiceVersion(CSV)的 PHASEPending,但 NAME 被更新至 advanced-cluster-management.v2.1.0

要解决这个问题,请按照以下步骤查找并创建缺少的 clusterRole 自定义资源:

  1. 输入以下命令查找由 Red Hat Advanced Cluster Management 2.1 CSV 部署的所有 clusterrolebinding 资源:

    oc get clusterrolebinding |grep advanced-cluster-management
    Copy to Clipboard Toggle word wrap

    您的输出应类似以下内容:

    advanced-cluster-management.v2.1.0-86dfdf7c5d          ClusterRole/advanced-cluster-management.v2.1.0-86dfdf7c5d       9h
    advanced-cluster-management.v2.1.0-cd8d57f64           ClusterRole/advanced-cluster-management.v2.1.0-cd8d57f64        9h
    Copy to Clipboard Toggle word wrap
  2. 打开每个 clusterrolebinding,找到与 open-cluster-management 服务帐户关联的 clusterRole 名称。输入类似以下的命令:

    oc get clusterrolebinding advanced-cluster-management.v2.1.0-cd8d57f64 -o yaml
    Copy to Clipboard Toggle word wrap

    您的输出应类似以下内容:

    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
      name: advanced-cluster-management.v2.1.0-cd8d57f64
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: advanced-cluster-management.v2.1.0-cd8d57f64
    subjects:
    - kind: ServiceAccount
      name: multicluster-operators
      namespace: open-cluster-management
    Copy to Clipboard Toggle word wrap
  3. 通过在 .yaml 文件中添加类似以下内容的内容来手动创建任何缺少的 clusterRole 条目:

    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
      name: advanced-cluster-management.v2.1.0-cd8d57f64
    rules:
    - apiGroups:
      - '*'
      resources:
      - '*'
      verbs:
      - '*'
    Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat