Kubernetes API get service endpoint IP when available

1/2/2019

I have a process where I use a Kubernetes client to build a deployment and a service. This process works fine but I have to wait some time for google to assign it an external IP. I cant seem to find anything in googles docs about a possible event emitter for when this process is done. Is there a way to programmatically pass or configure a request that can be made to a REST api that could go out and retrieve the info once it its ready?

-- pwborodich
google-cloud-platform
kubernetes
node.js

1 Answer

1/2/2019

Yes. I assume that you mean to assign a LoadBalancer type of address to your Kubernetes service. You can manually query the GCP API to see if your Load Balancer IP has been allocated. For example, GET a resource address.

You can also use the gcloud command.

Here is a list of all the GCP APIs related to load balancing that you can use.

-- Rico
Source: StackOverflow