Örnek
Sadece komut satırından şöyle yaparız
kubectl create deployment echoserver --image=k8s.gcr.io/echoserver:1.4 # Make it accessible kubectl expose deployment echoserver --port 80 --target-port 8080 #expose the service externally as echoserver.localdev.me kubectl create ingress echoserver --class=nginx --rule='echoserver.localdev.me/*=echoserver:80'
Açıklaması şöyle
The ingress controller will in our example read the host field of incoming HTTP requests and perform routing to internal services based on its value. However, a prerequisite is that the request reaches the ingress controller and this implies the DNS echoserver.localdev.me has to be routed to the Kubernetes cluster which here is localhost. So how does this echoserver.localdev.me work?
localdev.me is a service that defines its own DNS servers and will answer with the loopback IP address (127.0.0.1) to any subdomains of localedev.me DNS requests. You can have a look at their DNS records. This is handy as it allows to use subdomains in local to perform ingress routing without the need for manual /etc/hosts modifications.
Hiç yorum yok:
Yorum Gönder