如果您使用的是 Kubernetes 且想要使用 Service Health API,本文档介绍了如何以编程方式使用 Config Connector 为项目启用服务健康事件处理。
遵循使用 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 小时才能开始处理服务健康事件。