minikube Ingress
While minikube supports LoadBalancer type services, it doesn’t actually create an external load balancer. Rather, it opens a NodePort for these services - crucial information when it comes to using Ingress.
This article will demonstrate how to activate and manage the Ingress Controller and Ingress resources on minikube.
Powering Up the Ingress Controller
Minikube conveniently comes with a built-in ingress addon that you can easily activate.
Wait a while, and soon enough, the nginx-ingress-controller and default-http-backend will kick into action.
Crafting an Ingress
First, let's enable an echo server service.
Next, we'll craft an Ingress that can forward http://mini-echo.io
and http://mini-web.io/echo
to our newly created echoserver service.
To access the mini-echo.io
and mini-web.io
domain names, manually add a mapping in hosts.
After this, you can access the service via http://mini-echo.io
and http://mini-web.io/echo
.
Using xip.io
The previous method requires manual configuration of hosts every time a different domain name is used. By making use of xip.io
, we can bypass this step.
Just like before, we start by enabling a nginx service.
Next, we'll create an Ingress. The difference here is that the host uses nginx.$(minikube ip).xip.io
:
Now, we can directly access the domain name:
最后更新于