我为什么要关心Kubernetes,Docker和Container Orchestration?

A person at work chatted me, commenting on my recent blog posts on the Raspberry Pi Kubernetes Clusters that are being built, and wondered "why should I care about Kubernetes or Docker or any of that stuff?"

一个工作人员与我聊天,评论了我最近在构建的Raspberry Pi Kubernetes集群上的博客文章,并想知道“为什么我应该关心Kubernetes或Docker或其中的任何东西?”

WOCinTech Chat pic used under CC

Great question, and I'm figuring it out myself. There are lots of resources out there but none that spoke my language, so here's my thoughts and how I explain it.

很好的问题,我自己弄清楚。 那里有很多资源,但是没有一种能说我的语言,所以这是我的想法以及我的解释方式。

"Hey, I have this great new blog app!"

“嘿,我有这个很棒的新博客应用!”

"Fab, gimme!"

“ Fab,吉米!”

"Sure, first make sure you have this version of Windows/Linux, this version of .NET/Python/Node, and these prerequisites."

“当然,首先请确保您具有此版本的Windows / Linux,此版本的.NET / Python / Node以及这些先决条件。”

"Hang on, lemme call you next week when that's handled."

“等一下,lemme下周打给你。”

This is how software was built for years. Now let's deploy it.

这就是多年来构建软件的方式。 现在让我们部署它。

"Here's the code/dlls/application zipped up."

“这是压缩的代码/ dll /应用程序。”

"Lemme FTP/SFTP/Drag this from one Explorer Window to another."

“使FTP / SFTP /将其从一个资源管理器窗口拖动到另一个资源管理器窗口。”

"Is this version of that file set to this?"

“该文件的这个版本设置为此吗?”

"Wait, what?"

“等等,什么?”

"Make sure that system/boss/dll/nounjs is version 4.5.4.1, they patched it."

“确保system / boss / dll / nounjs版本为4.5.4.1,他们对此进行了修补。”

"Ok, Imma shush* into production."

“好吧,伊玛(Imma)将*投入生产。”

Again, we've all been there. It's 2018 and there's more folks doing this than you care to admit.

再一次,我们都去过那里。 现在是2018年,这样做的人比你所想承认的要多。

Enter Virtual Machines! Way better, right? Here's a USB key with a  file that is EVERYTHING you need. Handled.

输入虚拟机! 更好一点吧? 这是USB密钥,其中包含您所需的所有文件。 处理。

"Forget that, use this. It's better than a computer, it's a Virtual Machine. But be aware, It doesn't know it's Virtual, so respect the lie."

“算了,用这个吧。它比计算机要好,它是虚拟机。但是要知道,它不知道它是虚拟的,所以请撒谎。”

"OK, email it to me."

“好的,用电子邮件发送给我。”

"Well, it's 32 gigs. Lemme UPS it."

“好吧,那是32场演出。LemmeUPS。”

Your app is only 100 megs, and this VM is tens of gigs. Why does a 150 pound person need a 6000lb Hummer? Isolation, I guess.

您的应用程序只有100兆,而这个虚拟机则是数十兆。 为什么150磅重的人需要6000磅悍马? 我想是隔离的。

"The app is getting more complex, but it's cool. There's four VMs now. One for the DB, one for Redis, and a front end one, and the shopping cart gets one. It's microservices!"

“应用程序变得越来越复杂,但是它很酷。现在有四个VM。一个用于DB,一个用于Redis,一个前端,购物车得到一个。这是微服务!”

"I'm loving it."

“我喜欢这个。”

"Here's a 2 TB drive."

“这是一个2 TB的驱动器。”

Nice that we're breaking it up, but not so nice that we're getting bloated. Now we have to run apt upgrade/windows update on all these things and maintain them. Why drive a Hummer when I can get a Lyft?

很好,我们正在分解它,但是不太好,我们变得肿。 现在,我们必须对所有这些东西运行apt upgrade / windows update并进行维护。 当我能拿到Lyft时,为什么要开悍马?

"Ok I got them all running on this beefy machine under my desk."

“好吧,我让它们都在我桌子下面的那台强大的机器上运行。”

"Cool, we're moving to the cloud."

“很酷,我们正在迁移到云上。”

"Sigh. I need to update all these connection strings and start uploading VMs."

“抱歉。我需要更新所有这些连接字符串并开始上传VM。”

"It'll be great. It's like a machine under your desk, except your desk is in the cloud."

“那太好了。它就像桌子底下的一台机器,除了桌子在云端。”

"What's the cloud?"

“什么是云?”

"It's a server room you can't see. Basically it's the computers under your desk. But invisible."

“这是您看不到的服务器机房。基本上是您桌子下面的计算机。但看不见。”

Most VM infrastructure is pretty sloppy. It's hard coded IP addresses, it's poorly named VMs living in the same subnets, then we'll move them to the cloud (lift and shift!) but then they are still messy, but they're in the Cloud™, right?

大多数虚拟机基础架构都很草率。 它是硬编码的IP地址,它是一个名字不佳的VM,它们生活在同一子网中,然后我们将它们移动到云中(抬起并移动!),但是它们仍然很混乱,但是它们在Cloud™中,对吗?

"You know, all these VMs are heavy. I have to maintain and move a bunch of stuff that ISN'T the app. Containers are the way. Just define the app's base requirement and share everything else."

“您知道,所有这些VM都很沉重。我必须维护和移动一堆不是该应用程序的东西。容器是一种方式。只需定义应用程序的基本要求并共享其他所有内容。”

"I've been hearing about this. I can type "docker run hello-world" and on any machine it'll load the hello world image (based on Ubuntu) from a central hub and run it in a mostly isolated way. Guaranteed to work and run, even as time passes."

“我已经听说过。我可以键入“ docker run hello-world”,并且可以在任何计算机上从中央集线器加载hello world映像(基于Ubuntu),并以一种隔离的方式运行它。工作和运行,即使时间流逝。”

"Nice, because more and more parts of our app are in .NET Core on Linux, but there's also some Python and node."

“很好,因为我们应用程序的越来越多的部分位于Linux上的.NET Core中,但是也有一些Python和节点。”

"Yep and it'll all just run as the prerequisites are clearly listed in the container...and the prereqs are in fact references to other container images."

“是的,所有这些都将在容器中清楚列出先决条件……而前提条件实际上是对其他容器映像的引用。”

"It's containers all the way down."

“这是一路下跌的集装箱。”

Now the DB, Redis, the front end, and the shopping cart can call be defined in some simple text files. Rather than your Host OS (the main computer...the metal) loading up a bunch of Guest OS's (literally copies!) and then loading all the apps and prerequisites, you'll share  OSes, and when appropriate, the binaries and libraries.

现在,可以在一些简单的文本文件中定义数据库,Redis,前端和购物车。 您将共享操作系统,并在适当时共享二进制文件和库,而不是主机OS(主机...金属)加载一堆Guest OS(字面意思!),然后加载所有应用程序和必备软件。 。

"OK, now we have a bunch of containers running in Docker, but sometimes they go down or stop."

“好的,现在我们有一堆容器正在Docker中运行,但有时它们会掉下来或停下来。”

"Run them again?"

“再次运行它们?”

"It's more that that, we need to sometimes have 3 shopping cart containers, and other times we need 2 or more DB containers. Plus their IPs sometimes change"

“不仅如此,有时我们需要3个购物车容器,而有时我们需要2个或更多DB容器。此外,它们的IP有时会改变”

"So we need something to keep them running, scale or auto-scale them, as well manage networking and naming/dns."

“因此,我们需要一些东西来保持它们的运行,扩展或自动扩展,以及管理网络和命名/ dns。”

Enter a container orchestrator. There's Docker Swarm, Mesos/Marathon, Azure Service Fabric, and others, but for this post we'll use Kubernetes.

输入一个容器协调器。 有Docker Swarm,Mesos / Marathon,Azure Service Fabric等,但是在这篇文章中,我们将使用Kubernetes。

"So Kubernetes runs my containers, keeps them running, and helps manage the network?"

“那么Kubernetes可以运行我的容器,使其保持运行状态,并有助于管理网络?”

"Yes, and no. Parts of Kubernetes - or k8s, as cool people like me who have been using it for nearly 3 hours say - are part of the master components, like etcd for key value storage, and the kube-scheduler for selecting what node to run a "pod" on (a pod is cooler to say than container, but sometimes a pod is more than one container. Still, very cool.)

“是的,不是。Kubernetes的一部分,或者像我这样酷的人,使用了将近3个小时的k8,都是主要组件的一部分,例如etcd用于存储键值,以及kube计划程序用于选择在哪个节点上运行“ pod”(pod比容器说的要凉爽,但有时pod不仅仅是一个容器。仍然非常酷。)

"I'll need to make a glossary."

“我需要做一个词汇表。”

"Darn tootin' you will."

“你该死的。”

Kubernetes has basically pluggable everything. Don't like their networking setup? There's literally over a dozen options. Want better charts and graphs? Whole world of options.

Kubernetes基本上可以插入所有内容。 不喜欢他们的网络设置? 实际上有十几种选择。 需要更好的图表吗? 选择的整个世界。

Just as one Dockerfile can explain declare what's needed to run an app, a Kubernetes YAML file describes not only the containers, but the ports needed, the number of replicas of each (think web farm), names, environment variables, and more. Here's a file that shows a front end, back end, and load balancer. Everything is there, connection strings become internal DNS lookups, every service has a load balancer (if you like), and you can scale manually or auto-scale.

正如一个Dockerfile可以 解释 声明运行某个应用程序所需的内容一样,Kubernetes YAML文件不仅描述了容器,还描述了所需的端口,每个副本的数量(例如Web场),名称,环境变量等。 这是一个显示前端,后端和负载均衡器的文件。 一切都在那里,连接字符串成为内部DNS查找,每个服务都有一个负载平衡器(如果您愿意),您可以手动扩展或自动扩展。

"Ok so why should I care?"

“好,那我为什么要关心呢?”

"A few reasons. In the past, to install our app I'd need to give you a Word document and a weekend. Now you type kubectl apply theapp.yaml and it's running in less than a minute."

“有几个原因。过去,要安装我们的应用程序,我需要给您一个Word文档和一个周末。现在,您键入kubectl apply theapp.yaml ,它会在不到一分钟的时间内运行。”

"I'm still billing for the weekend."

“我仍在为周末开票。”

Simply stated, we are at the beginning of a new phase of DevOps. One that is programmatic, elastic, and declarative. It's consistent and clear and modular.

简而言之,我们正处于DevOps新阶段的开始。 它是程序化,弹性化和声明式的。 它是一致,清晰和模块化的。

I recommend you check out Julia Evans' "Reasons Kubernetes is cool" as well as reading up on how to make a Kubernetes cluster (and the management VMS are free) in Azure.

我建议您阅读Julia Evans的“ Reasons Kubernetes很棒” ,并阅读有关如何在Azure中制作Kubernetes集群(并且管理VMS是免费的)的信息

* I'm trying to make shush a thing. We don't Es Es Eaytch into machines! We shush in! It's pronounced somewhere between shush and shoosh. Make sure you throw in a little petit jeté when you say it.

我正在努力使事情变得安静。 我们不把Es Es Eaytch变成机器! 我们嘘! 它的发音介于嘘声和嘘声之间。 说出它时,请确保丢上一条小小的杰特。

* Pic used under CC

*图片在CC下使用

Sponsor: Unleash a faster Python Supercharge your applications performance on future forward Intel® platforms with The Intel® Distribution for Python. Available for Windows, Linux, and macOS. Get the Intel® Distribution for Python* Now!

赞助商:释放更快的Python借助适用于Python的英特尔®发行版,在未来的未来英特尔®平台上增强您的应用程序性能。 适用于Windows,Linux和macOS。 立即获取适用于Python *的英特尔®发行版!

翻译自: https://www.hanselman.com/blog/why-should-i-care-about-kubernetes-docker-and-container-orchestration

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值