'How to set up a health check on an individual GCE - Internal IP
I want to create an uptime health check for an application running on GCE with Internal IP.
I've noticed that Uptime checks in GCP only supports external IP and health checks only support a GCE with Load Balancer or a Managed Instance group.
Is there a any other GCP way to create a health check? I'm not sure if Cloud functions help.
Solution 1:[1]
As per my research with GCP team, private uptime check EAP is about to release in upcoming month which might address your issue , as presently its in alpha stage so need to whitelist your project to use this alpha feature.
Solution 2:[2]
No need for Managed Instance Group or Load Balancer. There's a little workaround for this.
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 /
and then create a 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
Next add an instance to the target-pool (just one).
gcloud compute target-pools add-instances tp1 --instances test-inst1
Finally you can check health using gcloud compute target-pools get-health
command.
Solution 3:[3]
It looks like Private Uptime checks are available as a pre-GA offering: https://cloud.google.com/monitoring/uptime-checks/private-checks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Neelam |
Solution 2 | |
Solution 3 | Scott M |