简体   繁体   English

为什么我的 Kubernetes pod 网络流量不通过 iptables NAT 表?

[英]Why my Kubernetes pod network traffic does not go through the iptables NAT table?

我需要在 K8s pod 中根据某些条件将 iptables 规则写入 SNAT 数据包,但网络流量永远不会通过 NAT 表

Why my Kubernetes pod network traffic does not go through the iptables NAT table?为什么我的 Kubernetes pod 网络流量不通过 iptables NAT 表?

Ans :答:

Because Kubernetes Dictates so to all CNI.因为 Kubernetes 对所有 CNI 都有这样的规定。 Following is from Kubernetes Documentation以下来自Kubernetes 文档

Kubernetes imposes the following fundamental requirements on any networking 
implementation (barring any intentional network segmentation policies):

- pods on a node can communicate with all pods on all nodes without NAT
- agents on a node (e.g. system daemons, kubelet) can communicate with all pods on 
  that node. 
  Note: For those platforms that support Pods running in the host network 
  (e.g. Linux):
  - pods in the host network of a node can communicate with all pods on all nodes 
    without NAT

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 分析kubernetes pod网络流量 - Analyse kubernetes pod network traffic Kubernetes:允许Pod出口网络流量 - Kubernetes: Allow pod egress network traffic Kubernetes 网络策略停止所有到 Pod 的流量 - Kubernetes Network Policy stops all traffic to Pod 为什么当我在 Kube.netes 中重新启动 pod 时,我的容器 go 中的服务会停止运行? - Why when I restart a pod in Kubernetes does the service I have in my container go down? Kubernetes (EKS) - 监控到 pod 或通过服务的流量 - Kubernetes (EKS) - monitor traffic to pod or through a service 如何在不使用网络策略的情况下阻止流向 Kubernetes pod 的流量 - How to block traffic to a Kubernetes pod without using network policies pod 是否通过服务来处理出站流量? - Does a pod pass through service for outbound traffic? 是否可以在 Kube.netes 中使用 OpenVPN 和 Nginx 反向代理通过 pod 路由流量? - Is it possible to route traffic through a pod with a OpenVPN and a Nginx reverse proxy in Kubernetes? 为什么Kubernetes没有将我的秘密附加到我的Pod中? - Why Kubernetes is not attaching my secret into my pod? iptables错误阻止Pod在Kubernetes中启动 - Iptables error prevents Pod starting in Kubernetes
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM