Should I use NodePort in my Traefik deployment on Kubernetes?

寵の児 提交于 2020-03-19 06:18:29

问题


According to Traefik's Kubernetes guide, I should use a Service of type NodePort to expose Traefik (YAML file here). However, if I do that, how do I expose one of the IPs from my cluster to the outside world?

At this moment, I have edited the example traefik-deployment.yaml file to be a LoadBalancer instead, and it seems to work just fine with the IP that the load balancer provides. What am I missing?


回答1:


Both are valid approaches. The Kubernetes guide basically makes one proposal to set things up (with somewhat of a focus on the local minikube configuration). If you have found a path that's more convenient for you, by all means feel free to stick to it.

FWIW, one concern I sometimes hear raised is that cloud-based LoadBalancers may become expensive much faster, whereas with a NodePort you have more control over how requests are routed into your cluster (at the price of reduced convenience).



来源:https://stackoverflow.com/questions/48481979/should-i-use-nodeport-in-my-traefik-deployment-on-kubernetes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!