From c06d1320f28fcc2176078002e267c44c1c29b41e Mon Sep 17 00:00:00 2001 From: ydFu Date: Mon, 25 Jan 2021 21:15:22 +0800 Subject: [PATCH] [zh] Sync concepts pages for service-networking * [zh] Umbrella issue: pages out of sync in concepts section(#26177 Misc Batch 2) ``` [x] content/zh/docs/concepts/services-networking/network-policies.md [x] content/zh/docs/concepts/services-networking/service.md [x] content/zh/docs/concepts/services-networking/dns-pod-service.md ``` Signed-off-by: ydFu ader.ydfu@gmail.com --- .../docs/concepts/services-networking/dns-pod-service.md | 9 +++------ .../concepts/services-networking/network-policies.md | 7 +++++++ content/zh/docs/concepts/services-networking/service.md | 6 +++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/content/zh/docs/concepts/services-networking/dns-pod-service.md b/content/zh/docs/concepts/services-networking/dns-pod-service.md index fc23f799ae..2672d4e7d0 100644 --- a/content/zh/docs/concepts/services-networking/dns-pod-service.md +++ b/content/zh/docs/concepts/services-networking/dns-pod-service.md @@ -271,17 +271,14 @@ record unless `publishNotReadyAddresses=True` is set on the Service. ### Pod 的 setHostnameAsFQDN 字段 {#pod-sethostnameasfqdn-field} -{{< feature-state for_k8s_version="v1.19" state="alpha" >}} +{{< feature-state for_k8s_version="v1.20" state="beta" >}} **前置条件**:`SetHostnameAsFQDN` diff --git a/content/zh/docs/concepts/services-networking/network-policies.md b/content/zh/docs/concepts/services-networking/network-policies.md index 6ea89e28f4..8b38fa25d4 100644 --- a/content/zh/docs/concepts/services-networking/network-policies.md +++ b/content/zh/docs/concepts/services-networking/network-policies.md @@ -69,6 +69,8 @@ By default, pods are non-isolated; they accept traffic from any source. Pods become isolated by having a NetworkPolicy that selects them. Once there is any NetworkPolicy in a namespace selecting a particular pod, that pod will reject any connections that are not allowed by any NetworkPolicy. (Other pods in the namespace that are not selected by any NetworkPolicy will continue to accept all traffic.) Network policies do not conflict; they are additive. If any policy or policies select a pod, the pod is restricted to what is allowed by the union of those policies' ingress/egress rules. Thus, order of evaluation does not affect the policy result. + +For a network flow between two pods to be allowed, both the egress policy on the source pod and the ingress policy on the destination pod need to allow the traffic. If either the egress policy on the source, or the ingress policy on the destination denies the traffic, the traffic will be denied. --> ## 隔离和非隔离的 Pod {#isolated-and-non-isolated-pods} @@ -83,6 +85,11 @@ Pod 在被某 NetworkPolicy 选中时进入被隔离状态。 如果任何一个或多个策略选择了一个 Pod, 则该 Pod 受限于这些策略的 入站(Ingress)/出站(Egress)规则的并集。因此评估的顺序并不会影响策略的结果。 +为了允许两个 Pods 之间的网络数据流,源端 Pod 上的出站(Egress)规则和 +目标端 Pod 上的入站(Ingress)规则都需要允许该流量。 +如果源端的出站(Egress)规则或目标端的入站(Ingress)规则拒绝该流量, +则流量将被拒绝。 + ### userspace 代理模式 {#proxy-mode-userspace} -这种模式,kube-proxy 会监视 Kubernetes 主控节点对 Service 对象和 Endpoints 对象的添加和移除操作。 +这种模式,kube-proxy 会监视 Kubernetes 控制平面对 Service 对象和 Endpoints 对象的添加和移除操作。 对每个 Service,它会在本地 Node 上打开一个端口(随机选择)。 任何连接到“代理端口”的请求,都会被代理到 Service 的后端 `Pods` 中的某个上面(如 `Endpoints` 所报告的一样)。 使用哪个后端 Pod,是 kube-proxy 基于 `SessionAffinity` 来确定的。