使用 Config Connector 為專案啟用 Personalized Service Health

如果您使用 Kubernetes 並想使用 Service Health API,本文將說明如何以程式輔助方式,透過 Config Connector 啟用專案,以處理服務健康狀態事件。

  1. 請按照先決條件使用設定連接器。

  2. 決定 API VERSIONv1v1beta

  3. 建立名為 psh-enable.yaml 的檔案,然後將下列程式碼片段複製到檔案中:

    apiVersion: serviceusage.cnrm.cloud.google.com/API VERSION
    kind: Service
    metadata:
      name: servicehealth.googleapis.com
    spec:
      projectRef:
        external: projects/PROJECT_ID
    
  4. 執行下列指令:

    kubectl apply -f psh-enable.yaml 
    

    系統隨即會顯示下列訊息:

    service.serviceusage.cnrm.cloud.google.com/servicehealth.googleapis.com created
    

Personalized Service Health 最多需要 24 小時,才會開始處理服務健康狀態事件。