Using NGINX to expose your applications
It’s time to start using NGINX as your ingress controller. We are going to expose your first application using NGINX. To begin, let’s deploy a simple application. To do this, follow the given steps:
- Create a simple deployment using
nginx
image with the following command:$ kubectl create deploy myapp --image=nginx
- Create a ClusterIP service for the
myapp
deployment:$ kubectl expose deploy myapp --type=ClusterIP --port=80
- Create an Ingress using the domain
192.168.0.240.nip.io
. In this example, we are assuming that the endpoint for the ingress is192.168.0.240
. This is the same IP as the load balancer created by the ingress controller. When you access your browser, the pagehttps://192.168.0.241.nip.io
is going to show the NGINX myapp Deployment, which you have already created. nip.io is a wildcard DNS for any IP address, so with this, you can get a free kind of domain to play with your ingress definitions. Let’...