DEV Community

loading...

Discussion on: Expose a Kubernetes service on your own custom domain

Collapse
nsanjay profile image
Sanjay Narayana

Hi

Thanks for the tutorial. Is there a way to set a static IP to the nginx-controller, so that we can configure the mapping between our domain and IP only once. From what I can tell, a new IP is created every time the cluster is freshly deployed.

Collapse
peterj profile image
Peter Jausovec Author

Hi Sanjay!

Assuming you have an existing static IP, you can edit the ingress service in Kubernetes and use loadBalancerIP: 1.1.1.1 field to set a static IP address. For example:

kind: Service
...
spec: 
   type: LoadBalancer
   loadBalancerIP: 1.1.1.1
...