By anujitmarty
Hi all
Would be nice, if someone could answer the question:
https://stackoverflow.com/questions/61677995/how-to-assign-an-external-ip-to-nginx-ingress
Thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya,
To assign an external IP to your nginx ingress, you should create a LoadBalancer service. This LoadBalancer service will automatically create a DigitalOcean Load Balancer with an external IP address that you can use.
Here is an example of how you can create it:
- apiVersion: v1
- kind: Service
- metadata:
- name: my-nginx-service
- spec:
- type: LoadBalancer
- selector:
- app: my-nginx
- ports:
- - protocol: TCP
- port: 80
- targetPort: 80
Make sure you replace ‘my-nginx’ with the name of your nginx deployment.
Please consider that DigitalOcean Load Balancers are billable resources. You can always check the most up to date pricing at this link.
For more detailed information, you can refer here: DigitalOcean Docs: How to Configure Load Balancers.
Hope that this helps!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.