我想为使用内部IP在GCE上运行的应用程序创建正常运行时间健康检查。
我注意到,GCP中的正常运行时间检查仅支持外部IP,而运行状况检查仅支持带有Load Balancer或受管实例组的GCE。
是否还有其他GCP创建健康检查的方法?我不确定云功能是否有帮助。
答案 0 :(得分:0)
不需要托管实例组或负载均衡器。 有一些解决方法。
Create legacy health check(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 /
然后创建一个target-pool with health check assigned
$ 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
下一个add an instance to the target-pool(仅一个)。
gcloud compute target-pools add-instances tp1 --instances test-inst1
最后,您可以使用gcloud compute target-pools get-health
命令check health。
答案 1 :(得分:0)
根据我在GCP团队中的研究,私有正常运行时间检查EAP即将在下个月发布,这可能会解决您的问题,目前处于Alpha阶段,因此需要将您的项目列入白名单以使用此Alpha功能。