Update 2018-07-09-IPVS-In-Cluster-Load-Balancing.md
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
---
|
||||
title: 基于IPVS的集群内部负载均衡
|
||||
cn-approvers:
|
||||
- congfairy
|
||||
layout: blog
|
||||
title: '基于IPVS的集群内部负载均衡'
|
||||
title: 'IPVS-Based In-Cluster Load Balancing Deep Dive'
|
||||
date: 2018-07-09
|
||||
---
|
||||
<!--
|
||||
@@ -37,7 +38,7 @@ Per the Kubernetes 1.11 release blog post , we announced that IPVS-Based In-Clus
|
||||
|
||||
介绍
|
||||
|
||||
根据Kubernetes 1.11发布的博客文章, 我们宣布基于IPVS的集群内部服务负载均衡已达到 一般可用性。 在这篇博客中,我们将带您深入了解该功能。
|
||||
根据 Kubernetes 1.11 发布的博客文章, 我们宣布基于 IPVS 的集群内部服务负载均衡已达到一般可用性。 在这篇博客中,我们将带您深入了解该功能
|
||||
|
||||
<!--
|
||||
|
||||
@@ -51,9 +52,9 @@ IPVS is incorporated into the LVS (Linux Virtual Server), where it runs on a hos
|
||||
|
||||
什么是 IPVS ?
|
||||
|
||||
IPVS (IP Virtual Server)是在 Netfileter 上层构建的,并作为 Linux 内核的一部分,实现传输层负载均衡。
|
||||
IPVS (IP Virtual Server)是在 Netfilter 上层构建的,并作为 Linux 内核的一部分,实现传输层负载均衡。
|
||||
|
||||
IPVS 集成在 LVS( Linux 虚拟服务器)中,它在主机上运行,并在物理服务器集群前作为负载均衡器。IPVS 可以将基于 TCP 和 UDP 服务的请求定向到真实服务器,并使真实服务器的服务在单个 IP 地址上显示为虚拟服务。 因此,IPVS 自然支持 Kubernetes 服务。
|
||||
IPVS 集成在 LVS(Linux Virtual Server,Linux 虚拟服务器)中,它在主机上运行,并在物理服务器集群前作为负载均衡器。IPVS 可以将基于 TCP 和 UDP 服务的请求定向到真实服务器,并使真实服务器的服务在单个IP地址上显示为虚拟服务。 因此,IPVS 自然支持 Kubernetes 服务。
|
||||
|
||||
<!--
|
||||
|
||||
@@ -139,7 +140,7 @@ Parameter: --ipvs-min-sync-period Minimum interval of how often the IPVS rules a
|
||||
|
||||
参数: --ipvs-sync-period 刷新 IPVS 规则的最大间隔时间(例如'5s','1m')。 必须大于0。
|
||||
|
||||
参数r: --ipvs-min-sync-period 刷新 IPVS 规则的最小间隔时间间隔(例如'5s','1m')。 必须大于 0。
|
||||
参数: --ipvs-min-sync-period 刷新 IPVS 规则的最小间隔时间间隔(例如'5s','1m')。 必须大于0。
|
||||
|
||||
<!--
|
||||
|
||||
@@ -202,7 +203,7 @@ Here comes an example:
|
||||
|
||||
-->
|
||||
|
||||
举个例子:
|
||||
这是一个例子:
|
||||
|
||||
# kubectl describe svc nginx-service
|
||||
Name: nginx-service
|
||||
@@ -248,6 +249,7 @@ There are three proxy modes in IPVS: NAT (masq), IPIP and DR. Only NAT mode supp
|
||||
|
||||
IPVS 中有三种代理模式:NAT(masq),IPIP 和 DR。 只有 NAT 模式支持端口映射。 Kube-proxy 利用 NAT 模式进行端口映射。 以下示例显示 IPVS 服务端口3080到Pod端口8080的映射。
|
||||
|
||||
|
||||
TCP 10.102.128.4:3080 rr
|
||||
-> 10.244.0.235:8080 Masq 1 0 0
|
||||
-> 10.244.1.237:8080 Masq 1 0
|
||||
@@ -260,7 +262,7 @@ IPVS supports client IP session affinity (persistent connection). When a Service
|
||||
|
||||
-->
|
||||
|
||||
会话亲和性
|
||||
会话关系
|
||||
|
||||
IPVS 支持客户端 IP 会话关联(持久连接)。 当服务指定会话关系时,IPVS 代理将在 IPVS 虚拟服务器中设置超时值(默认为180分钟= 10800秒)。 例如:
|
||||
|
||||
@@ -294,6 +296,8 @@ However, we don't want to create too many iptables rules. So we adopt ipset for
|
||||
|
||||
-->
|
||||
|
||||
|
||||
|
||||
IPVS 代理中的 Iptables 和 Ipset
|
||||
|
||||
IPVS 用于负载均衡,它无法处理 kube-proxy 中的其他问题,例如 包过滤,数据包欺骗,SNAT 等
|
||||
@@ -373,6 +377,7 @@ Finally, for Kubernetes v1.10, feature gate SupportIPVSProxyMode is set to true
|
||||
|
||||
最后,对于 Kubernetes v1.10,“SupportIPVSProxyMode” 默认设置为 “true”。 对于 Kubernetes v1.11 ,该选项已完全删除。 但是,您需要在v1.10之前为Kubernetes 明确启用--feature-gates=SupportIPVSProxyMode=true。
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
Get Involved
|
||||
@@ -395,10 +400,9 @@ Share your Kubernetes story
|
||||
|
||||
参与其中
|
||||
|
||||
参与 Kubernetes 的最简单方法是加入众多[特别兴趣小组](https://github.com/kubernetes/community/blob/master/sig-list.md)(SIG)中与您的兴趣一致的小组。 你有什么想要向Kubernetes社区广播的吗? 在我们的每周[社区会议](https://github.com/kubernetes/community/blob/master/communication.md#weekly-meeting)或通过以下渠道分享您的声音。
|
||||
参与 Kubernetes 的最简单方法是加入众多[特别兴趣小组](https://github.com/kubernetes/community/blob/master/sig-list.md) (SIG)中与您的兴趣一致的小组。 你有什么想要向 Kubernetes 社区广播的吗? 在我们的每周[社区会议](https://github.com/kubernetes/community/blob/master/communication.md#weekly-meeting)或通过以下渠道分享您的声音。
|
||||
|
||||
感谢您的持续反馈和支持。
|
||||
|
||||
在[Stack Overflow](http://stackoverflow.com/questions/tagged/kubernetes)上发布问题(或回答问题)
|
||||
|
||||
加入[K8sPort](http://k8sport.org/)的倡导者社区门户网站
|
||||
|
||||
Reference in New Issue
Block a user