gpt4 book ai didi

kubernetes - LoadBalancer如何将流量转发到目标服务?

转载 作者:行者123 更新时间:2023-12-02 11:37:16 24 4
gpt4 key购买 nike

LoadBalancer是使用in this article提到的kube-proxy还是使用here提到的NodePort

如果实际上使用的是NodePort,那么为什么像MetalLB这样的多个来源声称在生产中使用NodePort并不是一个好主意?
Ingress也可以使用NodePort + nginx进行操作。那么LoadBalancer有什么特别之处?

最佳答案

这取决于云提供商的实现:

Traffic from the external load balancer will be directed at the backend Pods, though exactly how that works depends on the cloud provider.



https://kubernetes.io/docs/concepts/services-networking/#loadbalancer

如果是Google Kubernetes Engine(GKE),则 this is how it works:

When using the external load balancer, arriving traffic is initially routed to a node using a forwarding rule associated with the GCP network. After the traffic reaches the node, the node uses its iptables NAT table to choose a Pod. kube-proxy manages the iptables rules on the node.

关于kubernetes - LoadBalancer如何将流量转发到目标服务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55435926/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com