You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/zh/docs/tasks/administer-cluster/ip-masq-agent.md
+44-31Lines changed: 44 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,9 @@ content_type: task
9
9
10
10
<!-- overview -->
11
11
<!--
12
-
This page shows how to configure and enable the ip-masq-agent.
12
+
This page shows how to configure and enable the `ip-masq-agent`.
13
13
-->
14
-
此页面展示如何配置和启用 ip-masq-agent。
14
+
此页面展示如何配置和启用 `ip-masq-agent`。
15
15
16
16
## {{% heading "prerequisites" %}}
17
17
@@ -24,9 +24,9 @@ This page shows how to configure and enable the ip-masq-agent.
24
24
## IP Masquerade Agent 用户指南
25
25
26
26
<!--
27
-
The ip-masq-agent configures iptables rules to hide a pod's IP address behind the cluster node's IP address. This is typically done when sending traffic to destinations outside the cluster's pod [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) range.
27
+
The `ip-masq-agent` configures iptables rules to hide a pod's IP address behind the cluster node's IP address. This is typically done when sending traffic to destinations outside the cluster's pod [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) range.
28
28
-->
29
-
ip-masq-agent 配置 iptables 规则以隐藏位于集群节点 IP 地址后面的 Pod 的 IP 地址。
29
+
`ip-masq-agent` 配置 iptables 规则以隐藏位于集群节点 IP 地址后面的 Pod 的 IP 地址。
@@ -96,23 +96,26 @@ The agent configuration file must be written in YAML or JSON syntax, and may con
96
96
代理配置文件必须使用 YAML 或 JSON 语法编写,并且可能包含三个可选值:
97
97
98
98
<!--
99
-
* **nonMasqueradeCIDRs:** A list of strings in [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) notation that specify the non-masquerade ranges.
99
+
* `nonMasqueradeCIDRs`: A list of strings in
100
+
[CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) notation that specify the non-masquerade ranges.
* **resyncInterval:** An interval at which the agent attempts to reload config from disk. e.g. '30s' where 's' is seconds, 'ms' is milliseconds etc...
114
+
* `resyncInterval`: A time interval at which the agent attempts to reload config from disk.
115
+
For example: '30s', where 's' means seconds, 'ms' means milliseconds.
113
116
-->
114
-
***resyncInterval:** 代理尝试从磁盘重新加载配置的时间间隔。
115
-
例如 '30s',其中 's' 是秒,'ms' 是毫秒等...
117
+
*`resyncInterval`:代理从磁盘重新加载配置的重试时间间隔。
118
+
例如 '30s',其中 's' 是秒,'ms' 是毫秒。
116
119
117
120
<!--
118
121
Traffic to 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16) ranges will NOT be masqueraded. Any other traffic (assumed to be internet) will be masqueraded. An example of a local destination from a pod could be its Node's IP address as well as another node's address or one of the IP addresses in Cluster's IP range. Any other traffic will be masqueraded by default. The below entries show the default set of rules that are applied by the ip-masq-agent:
@@ -122,8 +125,11 @@ Traffic to 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16) ranges will NOT be masq
122
125
Pod 访问本地目的地的例子,可以是其节点的 IP 地址、另一节点的地址或集群的 IP 地址范围内的一个 IP 地址。
123
126
默认情况下,任何其他流量都将伪装。以下条目展示了 ip-masq-agent 的默认使用的规则:
124
127
125
-
```
128
+
```shell
126
129
iptables -t nat -L IP-MASQ-AGENT
130
+
```
131
+
132
+
```none
127
133
RETURN all -- anywhere 169.254.0.0/16 /* ip-masq-agent: cluster-local traffic should not be subject to MASQUERADE */ ADDRTYPE match dst-type !LOCAL
128
134
RETURN all -- anywhere 10.0.0.0/8 /* ip-masq-agent: cluster-local traffic should not be subject to MASQUERADE */ ADDRTYPE match dst-type !LOCAL
129
135
RETURN all -- anywhere 172.16.0.0/12 /* ip-masq-agent: cluster-local traffic should not be subject to MASQUERADE */ ADDRTYPE match dst-type !LOCAL
By default, in GCE/Google Kubernetes Engine starting with Kubernetes version 1.7.0, if network policy is enabled or you are using a cluster CIDR not in the 10.0.0.0/8 range, the ip-masq-agent will run in your cluster. If you are running in another environment, you can add the ip-masq-agent [DaemonSet](/docs/concepts/workloads/controllers/daemonset/) to your cluster:
142
+
By default, in GCE/Google Kubernetes Engine, if network policy is enabled or
143
+
you are using a cluster CIDR not in the 10.0.0.0/8 range, the `ip-masq-agent`
144
+
will run in your cluster. If you are running in another environment,
145
+
you can add the `ip-masq-agent` [DaemonSet](/docs/concepts/workloads/controllers/daemonset/)
@@ -172,20 +182,20 @@ More information can be found in the ip-masq-agent documentation [here](https://
172
182
<!--
173
183
In most cases, the default set of rules should be sufficient; however, if this is not the case for your cluster, you can create and apply a [ConfigMap](/docs/tasks/configure-pod-container/configure-pod-configmap/) to customize the IP ranges that are affected. For example, to allow only 10.0.0.0/8 to be considered by the ip-masq-agent, you can create the following [ConfigMap](/docs/tasks/configure-pod-container/configure-pod-configmap/) in a file called "config".
By default, the link local range (169.254.0.0/16) is also handled by the ip-masq agent, which sets up the appropriate iptables rules. To have the ip-masq-agent ignore link local, you can set *masqLinkLocal* to true in the config map.
235
+
By default, the link local range (169.254.0.0/16) is also handled by the ip-masq agent, which sets up the appropriate iptables rules. To have the ip-masq-agent ignore link local, you can set `masqLinkLocal` to true in the ConfigMap.
0 commit comments