Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pod的dnat转换,下面这个代码不是重定向到自己吗 #61

Open
XinyuHu123456 opened this issue Aug 18, 2024 · 0 comments
Open

Comments

@XinyuHu123456
Copy link

/ 将流量 DNAT 到 Pod IP 和端口
// 我不理解下面的可以匹配吗,"-d", podIPList[i], "--dport"匹配不了吧
if err := im.ipt.Insert("nat", kubesep, 1, "-j", "DNAT",
"-p", protocol, "-d", podIPList[i], "--dport", strconv.Itoa(targetPort),
"-m", protocol, "--to-destination", podIPList[i]+":"+strconv.Itoa(targetPort)); err != nil {
k8log.ErrorLog("KUBEPROXY", "Failed to create kubesvc chain: "+err.Error())
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant