【发布时间】:2020-04-19 03:32:47
【问题描述】:
在 Azure Kubernetes (AKS) 中,如果 pod 将流量发送到集群之外,它会被 Natted 到节点 IP 地址。例如,如果 pod nettools(来自节点 aks-agentpool-35359625-1)将流量发送到集群外部的 Azure 目标,它会被 natted 到 10.240.0.35。有没有办法保留原始来源( 10.240.0.48 )?
使用网络插件 Azure 和透明网络模式运行的集群
/AKS/cluster1 $ kubectl get nodes -o wide
kubectl get pods -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
aks-agentpool-35359625-0 Ready agent 6h13m v1.15.10 10.240.0.66 <none> Ubuntu 16.04.6 LTS 4.15.0-1071-azure docker://3.0.10+azure
aks-agentpool-35359625-1 Ready agent 6h13m v1.15.10 10.240.0.35 <none> Ubuntu 16.04.6 LTS 4.15.0-1071-azure docker://3.0.10+azure
aks-agentpool-35359625-2 Ready agent 6h13m v1.15.10 10.240.0.4 <none> Ubuntu 16.04.6 LTS 4.15.0-1071-azure docker://3.0.10+azure
/AKS/cluster1 $ kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
nettools 1/1 Running 0 21m 10.240.0.48 aks-agentpool-35359625-1 <none> <none>
/AKS/cluster1 $ az aks show -g $rg --name $cluster --query "networkProfile"
{
"dnsServiceIp": "10.0.0.10",
"dockerBridgeCidr": "172.17.0.1/16",
"loadBalancerProfile": null,
"loadBalancerSku": "Basic",
"networkMode": "transparent",
"networkPlugin": "azure",
"networkPolicy": null,
"outboundType": "UDR",
"podCidr": null,
"serviceCidr": "10.0.0.0/16"
}
【问题讨论】:
-
为什么?有什么意义?
-
简短答案 - 用于故障排除。
-
这对故障排除有何帮助? xyproblem.info
-
它将消除 NAT。
标签: azure kubernetes