One option is to use an access resource (load balancer) before your services and attach it to the static IP that you previously reserved.
I was not able to find this in Kubernetes or GKE docs, but I found it here:
https://github.com/kelseyhightower/ingress-with-static-ip
Keep in mind that the value you set for the kubernetes.io/ingress.global-static-ip-name annotation is the name of the reserved IP resource, not the IP itself.
Before that, in order to be available, you had to create a global IP address, bind it to the GCE load balancer, which had global targeting of redirection rules in the nodes of your cluster.
I do not believe that there is a way to do this work automatically, today, if you do not want to provide your services using the Ingress load balancer or GCP. However, Ingress is pretty simple, so I would recommend that you go along this route if you can.
There is also a Kubernete incubator project called βexternal-dns,β which looks like an add-in that supports this whole and completely from within the cluster itself:
https://github.com/kubernetes-incubator/external-dns
I have not tried this approach yet, but I mention that it hears somehow that you might want to follow.
source share