ClusterIP:无和失败的吊舱 [英] ClusterIP: None and failing pods
问题描述
我在几个POD前面有一个NGINX,通过ClusterIP公开:没有.
I have an NGINX in front of several PODs, exposed through ClusterIP: none.
NGINX会将流量转发到这些节点,如下所示:
NGINX is forwarding traffic to these nodes like that:
upstream api {
server my-api:1066;
}
此配置是否会在my-api
主机名后面的所有POD之间平均分配流量?
是否会从主机名解析中删除失败的POD?
Will this configuration distribute traffic evenly among all PODs behind the my-api
hostname?
Will failing PODs be removed from the hostname resolution?
推荐答案
The default traffic distribution for Kubernetes services is random based on the default proxy mode: iptables. (This is likely your case)
In very old Kubernetes versions (<1.1) the default proxy mode: userspace would default to round-robin (you can still switch to that mode if you'd like to)
The newer way (< 1.8) of doing round robin (optionally) is to use proxy mode: ipvs.
您还可以查看其他提供负载平衡功能的解决方案,例如 Cillium .
You can also look at other solutions like Cillium that provide load balancing capabilities.
这篇关于ClusterIP:无和失败的吊舱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!