如果您使用 Kubernetes 並想使用 Service Health API,本文將說明如何以程式輔助方式,透過 Config Connector 啟用專案,以處理服務健康狀態事件。
請按照先決條件使用設定連接器。
決定 API VERSION:
v1或v1beta。建立名為
psh-enable.yaml的檔案,然後將下列程式碼片段複製到檔案中:apiVersion: serviceusage.cnrm.cloud.google.com/API VERSION kind: Service metadata: name: servicehealth.googleapis.com spec: projectRef: external: projects/PROJECT_ID執行下列指令:
kubectl apply -f psh-enable.yaml系統隨即會顯示下列訊息:
service.serviceusage.cnrm.cloud.google.com/servicehealth.googleapis.com created
Personalized Service Health 最多需要 24 小時,才會開始處理服務健康狀態事件。