亲爱的朋友,你已经构建了一个 Kubernetes (2024)。
Dear friend, you have built a Kubernetes (2024)

原始链接: https://www.macchaffee.com/blog/2024/you-have-built-a-kubernetes/

这篇帖子幽默地提醒人们,不要为了避免 Kubernetes 的复杂性而尝试构建自定义部署方案,因为这样做往往会适得其反,导致一堆难以维护的脚本和工具。 开发者最初可能只是想实现基本的容器编排,但最终常常会通过越来越复杂的变通方法(如 Docker Compose、Shell 脚本、Tailscale 和 Ansible)来重新实现 Kubernetes 的核心功能——部署、扩展、网络、服务发现,甚至 API 服务器。 为了避免 Kubernetes 的复杂性而进行的努力,反而可能导致一个更难管理、记录和排错的系统,尤其是在网络和长期维护方面。作者指出,通过单独构建这些组件,你实际上已经构建了一个 Kubernetes 集群,只是它不够标准化,而且更加脆弱。核心信息是:在认为 Kubernetes 过度复杂之前,先理解它解决问题的原理。

黑客新闻 新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 亲爱的朋友,你已经构建了一个 Kubernetes (2024) (macchaffee.com) 9 分,由 Wingy 1 小时前发布 | 隐藏 | 过去 | 收藏 | 讨论 帮助 考虑申请 YC 的 2026 年夏季批次!申请截止至 5 月 4 日 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系方式 搜索:
相关文章

原文

This post will make more sense if you first read Dear Sir, You Have Built a Compiler.

Dear friend,

I am afraid to inform you that you have built a Kubernetes. I know you wanted to "choose boring tech" to just run some containers. You said that "Kubernetes is overkill" and "it's just way too complex for a simple task" and yet, six months later, you have a pile of shell scripts that do not work—breaking every time there's a slight shift in the winds of production.

Surely, switching to Docker Compose will be the end of your woes; at least that way, someone else maintains a standard config file format for you to use. But wait, Compose is still not a holistic solution. "Do I really need a separate solution for deployment, rolling updates, rollbacks, and scaling?" you ask yourself? Surely not. Your app is so simple; a backend, a reverse proxy, postgres, and a job runner. So you march on, and add another few sections to your deploy.sh script, certain, that this will be the last of what you need to do to maintain this pile of hacks.

Ah, but wait! Inevitably, you find a reason to expand to a second server. While it's true a single server can go a long way many things can force this decision, such as the need for special hardware, high availability, or the speed of light. Tired, you parameterize your deploy script and configure firewall rules, distracted from the crucial features you should be working on and shipping. One of your team members suggests connecting the servers with Tailscale: an overlay network with service discovery. After that you will know, yes know, that there is no tougher complexity hurdle to clear than the networking.

Except if you quit or go on vacation, who will maintain this custom pile of shell scripts? The untested tarball handling? The inscrutable iptables rules? Who will know about those undocumented sysctl edits you made on the VM? So you add everything to Ansible, so that you may treat your VM as immutable and version-controlled. Certain, of course, that because you’re not using Kubernetes, it is going to be way easier to maintain than a Kubernetes cluster. What glorious engineering, you say to yourself.

In the last leg of your journey to avoid building a Kubernetes, your manager tells you that your app needs to programmatically spawn other containers. Spawning containers, of course, requires you to mount the Docker socket in your web app, which is wildly insecure. Not my problem, your manager says. So you write a separate service that exposes a safe subset of the Docker API to your web app. Done at last, you say to yourself, without having to build a Kubernetes.

A standard config format, a deployment method, an overlay network, service discovery, immutable nodes, and an API server. Dear friend, you have built a Kubernetes.

Addressed to,

Those who wanted to avoid Kubernetes.


PS: I don't mean to imply that you can never roll your own deployment method that fits your needs better than Kubernetes, or that nothing will ever be better than Kubernetes. I just want to caution you, my friend, to make sure you understand the problems Kubernetes solves before dismissing it as overly-complex.

联系我们 contact @ memedata.com