瞭解功能狀態條件

注意:Cloud Service Mesh 1.6.8 以上版本會自動支援 Canonical 服務。

本頁面說明如何解讀並依據 Cloud Service Mesh 叢集或車隊回報的條件採取行動。

如要檢查條件,請執行下列指令:

  gcloud container fleet mesh describe --project FLEET_PROJECT

輸出內容可能包含叢集的 membershipStates 中的 conditions,例如:

  ...
  membershipStates:
    projects/test-project/locations/us-central1/memberships/my-membership:
      servicemesh:
        conditions:
          - code: <CONDITION_CODE>
            details: ...
            documentationLink: ....
            severity: ...

本頁會詳細說明 code 的值。

NODEPOOL_WORKLOAD_IDENTITY_FEDERATION_REQUIRED

您可能會在會員方案的 Conditions 欄位中看到 NODEPOOL_WORKLOAD_IDENTITY_FEDERATION_REQUIRED 錯誤代碼:

    membershipStates:
      projects/test-project/locations/us-central1/memberships/my-membership:
        servicemesh:
          conditions:
          - code: NODEPOOL_WORKLOAD_IDENTITY_FEDERATION_REQUIRED
            details: One or more node pools have workload identity federation disabled.
            documentationLink: https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity
            severity: ERROR
          controlPlaneManagement:
            details:
            - code: REVISION_FAILED_PRECONDITION
              details: Required in-cluster components are not ready. This will be retried
                within 15 minutes.
            implementation: TRAFFIC_DIRECTOR
            state: FAILED_PRECONDITION

如果 GKE 叢集未在該叢集的所有節點集區中啟用 Workload Identity Federation,系統就會顯示這項錯誤,因為這是安裝 Cloud Service Mesh 的必要條件。

如要解決這則錯誤訊息,您必須按照操作說明,在所有節點集區中啟用 Workload Identity 聯合功能。請注意,啟用方式可能會因您的特定叢集情況而異。

啟用後,系統應會自動移除錯誤訊息,叢集也應會恢復為 ACTIVE 狀態。如果問題仍未解決,且您需要其他協助,請參閱「取得支援」。

MESH_IAM_PERMISSION_DENIED

這項錯誤表示服務帳戶的權限不足,無法存取車隊專案。請按照以下步驟排解問題:

  1. 確認服務帳戶是否已授予 Anthos Service Mesh Service Agent 角色。如要進一步瞭解如何驗證及新增 IAM 權限,請參閱「修訂版本回報為不健康錯誤」一文,並按照其中的步驟操作。

  2. 如果權限已驗證,但問題仍未解決,請與 Google 客戶服務團隊聯絡,尋求進一步協助。

MESH_IAM_CROSS_PROJECT_PERMISSION_DENIED

這則錯誤訊息表示機群專案服務帳戶的權限不足,無法存取其他專案 (叢集專案或網路專案)。

針對共用虛擬私有雲,請務必在共用虛擬私有雲網路專案中,將服務帳戶 Anthos Service Mesh Service Agent 角色授予所有車隊專案。

針對 GKE 機群專案和叢集專案情境,請務必在叢集專案中授予機群專案服務帳戶 Anthos Service Mesh Service Agent 角色。

疑難排解指令範例:

  1. 請確認網路專案或叢集專案服務帳戶是否已將 Anthos Service Mesh Service Agent 角色授予車隊專案服務帳戶。如果沒有,請執行以下指令碼:

    gcloud projects add-iam-policy-binding NETWORK_OR_CLUSTER_PROJECT_ID  \
        --member "serviceAccount:service-FLEET_PROJECT_NUMBER@gcp-sa-servicemesh.iam.gserviceaccount.com" \
        --role roles/anthosservicemesh.serviceAgent
    

    此外,請確認沒有自動化動作會移除這項繫結。

  2. 如果權限已驗證,但問題仍未解決,請與 Google 客戶服務團隊聯絡,尋求進一步協助。

CONFIG_VALIDATION_ERROR

這個錯誤表示無法成功套用在車隊中一或多個會員身上的某些網格相關設定。錯誤詳細資料會說明使用者如何最佳解決這個問題。

  membershipStates:
    projects/test-project/locations/us-central1/memberships/my-membership:
      servicemesh:
        conditions:
        - code: CONFIG_VALIDATION_ERROR
          details: 'Unsupported ProxyConfig fields: [proxyconfig.statNameLength]'
          severity: ERROR
        controlPlaneManagement:

特定設定的設定驗證錯誤會強制執行使用者操作。舉例來說,如果錯誤與不支援的 API 欄位使用情形有關,建議您從 Mesh API 中移除有問題的設定。

在 Cloud 控制台中,依序前往「Kubernetes Engine」>「Secrets & ConfigMaps」>「istio-asm-managed」(ConfigMap 的名稱取決於您使用的發布管道,例如 istio-asm-managed-stable 或 istio-asm-managed-rapid),然後選取 YAML 分頁。

例如,系統已不再支援 meshConfig.configSources:

apiVersion: v1
data:
  mesh: |
    enablePrometheusMerge: true
    trustDomain: "foobar.svc.id.goog"
    trustDomainAliases:
      - cluster.local

    configSources:
      - address: k8s://
      - address: fs:///var/lib/istio/config/data