TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

A brief guide to Kubernetes networking

90 点作者 thewizl大约 2 年前

6 条评论

jmillikin大约 2 年前
For folks interested in the Kubernetes networking model, I recommend looking elsewhere. This post appears to be content marketing wrapped in a thin shell of introductory tutorial for an approach that isn&#x27;t used by non-trivial deployments.<p>First, if you want to do a networking tutorial, start with something simple -- an HTTP server and curl, for example. You want to be able to tcpdump the traffic to understand what&#x27;s going on under the hood. The first half of the blog post is some massively complex magic -- CRDs? An operator? Just why? -- and there&#x27;s no reason to run an Elasticsearch instance just to test out packet routing.<p>Second, you almost certainly don&#x27;t want to use kube-proxy. It uses (abuses?) iptables&#x2F;nftables in a way that will make your sysadmins cry tears of blood. For small deployments, every major cloud provider (AWS, Azure, GCP, etc) has a CNI plugin that lets you allocate pod IPs out of a dedicated NAT prefix. For larger or bare-metal deployments, either use IPv6 natively (if available) or 6to4 (if on an IPv4-only network). I wrote a tutorial on the 6to4 approach[0], but honestly if you have someone on staff who is familiar with the Linux kernel network configs they&#x27;ll probably have a better idea of how to set it up to work with your system.<p>Third, you probably want to avoid getting super-magical with your DNS. Approaches like that described in the article (coredns configured to directly resolve non-namespaced Kubernetes service names) have poor performance once you get beyond toy-sized clusters, and having to hunt down all the places your code does a single-name lookup is <i>not</i> fun. Instead, configure a &quot;normal&quot; DNS server (or equivalent non-DNS address resolver) to read Kubernetes-announced endpoints in bulk (with caching, etc), and use hostnames like `myservice.mynamespace.mycluster.yourproddomain.com`, which lets you (1) figure out where your packets are getting routed to, and (2) provision mTLS certificates to pods that let them authenticate themselves as a given service identity. Yes, it&#x27;s longer, but your future self (or future underlings) will thank you.<p>[0] <a href="https:&#x2F;&#x2F;john-millikin.com&#x2F;stateless-kubernetes-overlay-networks-with-ipv6" rel="nofollow">https:&#x2F;&#x2F;john-millikin.com&#x2F;stateless-kubernetes-overlay-netwo...</a>
评论 #35182404 未加载
评论 #35185439 未加载
评论 #35182677 未加载
ilovecaching大约 2 年前
This is definitely just an ad for ergomake, there&#x27;s barely any networking knowledge here at all.
评论 #35185409 未加载
ianpurton大约 2 年前
Does anyone know how they make those hand drawn style kubernetes diagrams?
评论 #35183738 未加载
评论 #35182169 未加载
评论 #35182143 未加载
revskill大约 2 年前
Wait, if the documentation failed at explaining core technologies for a 5 years old baby to understand, it&#x27;s a scam.
lifty大约 2 年前
Question to the author. How does ergomake do multi tenancy on K8s?
评论 #35182293 未加载
Already__Taken大约 2 年前
honestly I learnt a lot about k8s networking from reading how ciliums bgp replacement for kube proxy works. real nice docs and some good diagrams.
评论 #35184656 未加载
评论 #35184558 未加载