本文介绍了我应该在Kubernetes上的Traefik部署中使用NodePort吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 Traefik的Kubernetes指南,我应该使用 NodePort 公开Traefik(YAML文件这里).但是,如果这样做,如何将群集中的IP之一暴露给外界?

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?

此刻,我已经编辑了示例 traefik-deployment.yaml 文件替换为 LoadBalancer ,它似乎可以与负载均衡器提供的IP正常工作.我想念什么?

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?

推荐答案

两者都是有效的方法. Kubernetes指南从根本上提出了一项设置建议(有些侧重于本地minikube配置).如果您找到了一条更方便的路径,请务必坚持下去.

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,我有时会听到的一个担忧是,基于云的LoadBalancers可能变得昂贵得多,而使用NodePort,您可以更好地控制将请求路由到群集的方式(以降低便利性为代价).

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).

这篇关于我应该在Kubernetes上的Traefik部署中使用NodePort吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 17:22