Google Cloud Platform Kubernetes-engine, updating a service while keeping the external IP address

1/31/2018

I have a question. I’m deploying an API with kubernetes-engine to cloud-endpoint. My problem is, every time I create the deployment and service I’m getting a new external API address.

At the moment I have to the delete the service and then create it again. With

kubectl delete -f deployment.yaml
kubectl create -f deployment.yaml

Is there a different solution so I can keep my external IP address? I have this API behind my own domain and don’t want to update the DNS everytime I deploy a new version of it.

Thank you for your help!

-- cdudek
google-cloud-endpoints
google-kubernetes-engine

1 Answer

1/31/2018

it's as easy as

kubectl apply -f deployment.yaml

you can also use kubectl apply instead of kubectl create

-- cdudek
Source: StackOverflow