exposing services to a static address

6/22/2018

Hi I am trying to expose a containerized application using google kubernetes engine, I deployed my services ( backend and frontend) and I am able to access to them via

http://[external-Ip]:port

but every time I rexpose my service after modifcation the external Ip change.

My questions are:

-what is the next step after deploying the services ( get a staic adress) how can I connect my backend and my frontend service?

-How to expose the services into static adress ( I do not want my adress changing every time I rebuild and rexpose my services)?

-- Ennar.ch
gcloud
google-kubernetes-engine

3 Answers

7/5/2018

After the update 1.1, kubernetes support externalIPs, you can setup a static IP . it already answered here:

After you Deployment, wait until you've an external IP, when you run kubectl get svc, and look up that IP in the list on that page and change it from Ephemeral to Static in that way you can promote your Ephemeral IP to a Static IP.

As well you can use a gcloud command to do :

gcloud compute addresses create [ADDRESS_NAME] \
    --addresses [IP_ADDRESS] --region [REGION]
where:

[ADDRESS_NAME] is the name you want to call this address.
[IP_ADDRESS] is the IP address you want to promote.
[REGION] is the region the IP address belongs to.
-- Alioua
Source: StackOverflow

6/22/2018

You can try the following config for your needs.

Publishing services - service types

https://kubernetes.io/docs/concepts/services-networking/service/

-- Daein Park
Source: StackOverflow

6/23/2018
-- user571470
Source: StackOverflow