我想为在具有内部IP的GCE上运行的应用程序创建正常运行时间运行状况检查。
我注意到 GCP 中的正常运行时间检查仅支持外部 IP,运行状况检查仅支持具有负载均衡器或托管实例组的 GCE。
是否有其他 GCP 方法可以创建运行状况检查?我不确定云函数是否有帮助。
根据我与 GCP 团队的研究,私人正常运行时间检查 EAP 即将在下个月发布,这可能会解决您的问题,因为目前它处于 alpha 阶段,因此需要将您的项目列入白名单才能使用此 alpha 功能。
不需要托管实例组或负载均衡器。对此有一点解决方法。
创建旧版运行状况检查(http-health-check
(
$ gcloud compute http-health-checks create chk1
Created [https://www.googleapis.com/compute/v1/projects/*/global/httpHealthChecks/ch3]
NAME HOST PORT REQUEST_PATH
ch3 80 /
,然后创建分配了运行状况检查的目标池
$ gcloud compute target-pools create tp1 --health-check=chk1
The --health-check flag is deprecated. Use equivalent --http-health-check=chk1 flag.
Created [https://www.googleapis.com/compute/v1/projects/*/regions/my-region1/targetPools/tp1].
NAME REGION SESSION_AFFINITY BACKUP HEALTH_CHECKS
tp1 my-region1 NONE ch3
接下来,将一个实例添加到目标池(仅一个(。
gcloud compute target-pools add-instances tp1 --instances test-inst1
最后,您可以使用gcloud compute target-pools get-health
命令检查运行状况。
看起来私人正常运行时间检查可作为 GA 前产品提供: https://cloud.google.com/monitoring/uptime-checks/private-checks