kubernetes_然后他问我“ Kubernetes适合我们吗?”

kubernetes

Is Kubernetes right for us? That’s a question that will have been asked many times, but perhaps not publicly, for fear of looking out of touch, or behind the curve. After all, the term “imposter syndrome” was coined to describe the anxiety we face as we try to keep current with technology and what is happening in the industry.

Kubernetes适合我们吗? 这个问题已经被问过很多次了,但可能不是公开的,因为担心会出现脱节或弯道。 毕竟,“冒名顶替综合症”一词的出现是为了描述我们在努力跟上技术和行业动态时所面临的焦虑。

Pictured above: Gartner’s Hype Cycle describe the effect of new and innovating technology on the ecosystem, from inflated expectations, to disillusionment.

上图:Gartner的“炒作周期”描述了新的创新技术对生态系统的影响,从过高的期望到幻灭。

In this post I’ll introduce a real-life example from a consulting prospect, who asked me whether he should adopt Kubernetes, and a blog post that I wrote to show that there’s more to cloud than Kubernetes

在这篇文章中,我将介绍一个咨询顾问的现实生活中的例子,他问我是否应该采用Kubernetes,以及我写的博客文章表明,除了Kubernetes之外,云还有更多

第1部分-频谱 (Part 1 — There’s a spectrum)

About six months ago, I wrote a blog post called “Your team might not need Kubernetes.” It was a simple hypothesis and I outlined several ways that a company with legacy IT could begin to modernise their applications, without necessarily making a leap directly to Kubernetes.

大约六个月前,我写了一篇博客文章“ 您的团队可能不需要Kubernetes” 。 这是一个简单的假设,我概述了拥有遗留IT的公司可以开始对其应用程序进行现代化改造的几种方法,而不必直接跳到Kubernetes。

It starts off with the idea of cloud technology as a spectrum of complexity vs. potential benefits. At one end, you’re completely on-premises running on bare-metal on servers that you own or rent and are in full-control. At the other end, you’re running everything on public cloud with a managed Kubernetes cluster.

它首先从云技术的概念开始,即复杂性与潜在收益之间的关系。 一方面,您可以完全在您拥有或租用的完全控制的服务器上以裸机运行。 另一方面,您正在使用托管的Kubernetes集群在公共云上运行所有内容。

I don’t believe that Kubernetes is the destination for all users.

我不相信Kubernetes是所有用户的目的地。

You can start to leverage the benefits of the cloud just by lifting & shifting existing code to managed compute services. This may reduce the overheads and management costs of bare-metal, and even enable some level of elasticity, enabling faster growth. Remember that just like in the Dilbert cartoon below, you may also need to consider rebuilding or redesigning parts of your system, and that may require going outside of your area of expertise.

您只需将现有代码提升并转移到托管计算服务中,即可开始利用云的优势。 这可以减少裸机的管理费用和管理成本,甚至可以实现一定程度的弹性,从而实现更快的增长。 请记住,就像下面的Dilbert卡通一样,您可能还需要考虑重新构建或重新设计系统的各个部分,这可能需要超出您的专业领域。

kubernetes_然后他问我“ Kubernetes适合我们吗?”_第1张图片
You might not actually need Kubernetes, but also you may. 您可能实际上并不需要Kubernetes,但也可能需要。

An experienced cloud architect, or DevOps professional should be able to help you make smart choices, and to guide your IT modernisation process.

经验丰富的云架构师或DevOps专业人员应该能够帮助您做出明智的选择,并指导您的IT现代化流程。

It may actually be that compute is not the lowest hanging fruit for your business, and that simply by moving your database from on-premises to the cloud, using something like RDS (Relational Database Service) could increase reliability. It may be that your reports are taking too long to produce, and that moving to a managed option may reduce the time needed to run them.

实际上,计算可能不是您的业务中最难获得的成果,而仅仅通过将数据库从内部部署移动到云中,使用RDS(关系数据库服务)之类的方法就可以提高可靠性。 可能是因为您的报告制作时间太长,并且转移到托管选项可能会减少运行它们所需的时间。

Traditional applications that require Windows, a legacy .NET runtime and IIS don’t tend to fit quite as seamlessly into modern cloud practices. So a low-risk approach to adopting cloud can be as simple as building new functionality with a modern framework designed to run on the cloud like .NET Core, Node.js, Vert.x, or Golang.

需要Windows,传统.NET运行时和IIS的传统应用程序往往无法无缝地融入现代云实践中。 因此,采用云的低风险方法就像使用旨在在云上运行的现代框架(如.NET Core , Node.js , Vert.x或Golang)构建新功能一样简单。

There is a spectrum — between doing everything with your internal IT team, and hardware estate and jumping in with both feet — going fully managed.

在全面管理内部频谱之间-与内部IT团队一起完成所有工作,以及硬件和从头开始进入。

Between those two points you will find plenty of other options, including Heroku (PaaS), AWS Lambda (FaaS), and Google’s Cloud Run (CaaS). These are broadly known as “Platform as a Service” products. They make it easy to drop code somewhere, and to have the heavy lifting done for you. If your team is comfortable building containers, you may even look at AWS’ Elastic Container Service, which has a lower barrier to entry than Kubernetes.

在这两点之间,您会发现很多其他选择,包括Heroku(PaaS),AWS Lambda(FaaS)和Google的Cloud Run(CaaS)。 这些被广泛称为“平台即服务”产品。 它们使将代码放到某个地方变得容易,并为您完成了繁重的工作。 如果您的团队对构建容器感到满意,您甚至可以看看AWS的Elastic Container Service ,它的进入门槛比Kubernetes低。

The final point to consider is whether portability is a true concern. The ThoughtWorks technology radar states that anti-lock-in abstractions are productive, but that using Docker containers provides an industry-standard for packaging applications. Perhaps then, if portability is a primary concern, starting with packaging code with Docker, could be a first step?

最后要考虑的一点是可移植性是否是一个真正的问题。 ThoughtWorks技术雷达指出,反锁定抽象是有效的,但是使用Docker容器为包装应用程序提供了行业标准。 也许,那么,如果首先要考虑可移植性,那么从Docker打包代码开始可能是第一步?

Let’s look at a real-world example.

让我们看一个真实的例子。

第2部分-真实示例 (Part 2 — the real world example)

This part is adapted from my Insiders Update: 12th July 2020 — is Kubernetes right for us? Spotlight on arkade & k3sup. To receive them each week, subscribe on GitHub.

本部分改编自我的内部人员更新:2020年7月12日-Kubernetes是否适合我们? on聚焦arkade和k3sup 。 要每周接收一次,请在GitHub上订阅 。

As part of my business I sometimes meet with consulting prospects to see if I can be of help to them, and whether we’d be a good fit for each other on a project. At other times I may have a call with a friend or connection where it is unlikely that a paid project would result from it, but there may be some other insights we can both take away.

作为我业务的一部分,我有时会与咨询潜在客户见面,以查看是否可以为他们提供帮助,以及我们是否在项目上彼此适合。 在其他时间,我可能会与朋友或朋友打个电话,这不太可能会因此产生付费项目,但可能还有其他一些见解,我们都可以带走。

Last week I spent an hour with an old colleague and he told me about a SaaS product that he’d built almost single-handedly, which was now handling over 200k active clients. The code was written in Node.js and deployed to a single DigitalOcean virtual-machine (aka Droplet) using Dokku (an open-source Heroku clone).

上周,我在一个老同事那里度过了一个小时,他告诉我他几乎单枪匹马制造的SaaS产品,该产品现在可以处理20万活跃客户。 该代码使用Node.js编写,并使用Dokku (开源的Heroku克隆)部署到单个DigitalOcean虚拟机(也称为Droplet)中。

Heroku is an example of a managed container/compute platform, a PaaS. The idea is that the developers can push their code to git, and a container will be built and deployed for them, with a live endpoint up shortly after that. If you have been following my work, you’ll know that OpenFaaS Cloud is very similar to this, but for Kubernetes.

Heroku是托管容器/计算平台PaaS的示例。 这个想法是,开发人员可以将他们的代码推送到git,然后将为他们构建和部署一个容器,此后不久便有了一个活动端点。 如果您一直在关注我的工作,您会知道OpenFaaS Cloud与KuFernetes非常相似。

My friend also had an application that was leaking memory and had to be restarted on a cron schedule. These kinds of issues are difficult to track down and we often underestimate the time it will take to find and resolve.

我的朋友还拥有一个正在泄漏内存的应用程序,必须按cron计划重新启动。 这些问题很难找到,我们常常低估了寻找和解决所需的时间。

I agreed to speak to him, and after exchanging niceties he said: “I keep hearing you talk about Cloud Native and Kubernetes. Is Kubernetes right for us, will it fix these problems? What even is Cloud Native?”

我同意与他交谈,并且在交换好感之后,他说:“我一直听到您谈论Cloud Native和Kubernetes。 Kubernetes是否适合我们,它将解决这些问题吗? 什么是Cloud Native?”

I’m not sure that my description of Cloud Native would win any awards. For some it means hand-picking open-source projects from the CNCF Landscape, to others a 12-factor app design, or simply being packaged in Docker Containers, for others, it means running solely on products sold by AWS. In general we’re talking about applications that run well on cloud platforms, in addition: scalability, durability, and portability are often concerns.

我不确定我对Cloud Native的描述是否会赢得任何奖项。 对于某些人来说,这意味着从CNCF Landscape中手动挑选开源项目,对其他人来说,则是选择12要素的应用程序设计,或者只是打包在Docker容器中,对于其他人,则意味着仅在AWS出售的产品上运行。 总体而言,我们谈论的是在云平台上运行良好的应用程序,此外:可伸缩性,持久性和可移植性通常是关注的重点。

Now before recommending a product or technology, or even answering a support question, I like to know: “What problem are you trying to solve? And what constraints do you have in place?”

在推荐产品或技术,甚至回答支持问题之前,我想知道:“您要解决什么问题? 您有什么限制条件?”

演示地址

He told me that the main application was deployed on a single Droplet, and that it had no fail-over mechanisms. This meant that an outage, could affect all 200k of his customers, and was going to be close to impossible to recover from.

他告诉我,主应用程序部署在单个Droplet上,并且没有故障转移机制。 这意味着中断,可能会影响他的所有20万客户,并且几乎无法恢复。

He also had no type of monitoring or metrics, which meant the issue with the memory leak was potentially going to be hard to monitor, and if fixed, difficult to verify.

他也没有任何类型的监控或指标,这意味着内存泄漏的问题可能很难监控,如果已解决,则很难验证。

Now his constraints were that any solution must be easy to understand and that his three other developers would need to be able to operate it without spending a lot of time learning something new. It needed to use a Git-based pipeline (he already had that from Dokku) and there was also very limited budget for operations. All spend really needed to be directed to new features, to pick up more paying customers.

现在他的约束是,任何解决方案都必须易于理解,并且他的其他三个开发人员将需要能够操作该解决方案,而无需花费大量时间学习新知识。 它需要使用基于Git的管道(他已经从Dokku获得了该管道),而且运营预算也非常有限。 确实需要将所有支出用于新功能,以吸引更多付费客户。

Does any of this sound familiar? There was a definite conflict between profitability, and stability in the platform.

这听起来很熟悉吗? 盈利能力与平台稳定性之间存在明确的冲突。

My main concerns were lack of fail-over, disaster recovery and the memory leak. So what did I tell him to do? To move to Kubernetes?

我主要担心的是缺少故障转移,灾难恢复和内存泄漏。 那我叫他做什么? 要迁移到Kubernetes?

I’ll let you know what I advised below, but first of all, I tweeted and that thread gained dozens and dozens of comments. The answers ranged from “Yes Kubernetes”, to “just use Heroku”, to “just use Fargate” to myriad of other “just use X” comments.

我会在下面告诉您我的建议,但首先,我发了一条推文,该主题获得了数十条评论。 答案范围从“是Kubernetes”到“仅使用Heroku”,“仅使用Fargate”到其他“仅使用X”注释。

These kind of “just use X” comments don’t tend to appreciate the problem being solved, or the constraints. Now there was a second wave of comments that felt much more insightful to me: “tell your friend that he needs to invest in operations” — “there’s a lack of DevOps knowledge, at some point you need to hire someone to manage this”, “sell him OpenFaaS”, and even “why doesn’t he contract you to run this for him?”

这些“仅使用X”注释不会倾向于解决要解决的问题或约束。 现在,第二波评论让我感到更加深刻:“告诉您的朋友他需要投资于运营” –“缺乏DevOps知识,在某些时候您需要雇用某人来管理此事”, “卖给他OpenFaaS” ,甚至“他为什么不与您签约为他管理这笔钱?”

As much as I espouse and evangelise, and build tools for making Kubernetes easier to operate, I’m not here to give a hard sell. As you know from earlier, I’ve written a blog post showing that it’s not the only option. The learning curve for Kubernetes is just unfair, when you’re coming at it from scratch, here’s a little sample of what you need:

尽管我拥护和传播福音,并构建工具使Kubernetes易于操作,但我在这里不容小sell。 如您所知,我写了一篇博客文章,表明它不是唯一的选择。 Kubernetes的学习曲线是不公平的,当您从头开始学习时,这里有一些您需要的示例:

演示地址

Now the arkade app installed and OpenFaaS, coupled with a managed Kubernetes service, will get you really far, but it’s still too much for what my friend needed.

现在,安装了arkade应用程序和OpenFaaS ,再加上托管的Kubernetes服务,将带给您真正的帮助,但是对于我的朋友所需要的来说,这仍然太多了。

As was pointed out by the second wave of comments, he needed to invest in operations. A skilled DevOps engineer would have already taken the lowest-hanging fruits to secure the 200k users.

正如第二轮评论所指出的那样,他需要投资于运营。 一名熟练的DevOps工程师本来可以取得最大的收获,才能确保20万用户的安全。

For the memory leak, and lack of monitoring, they would have found out that Dokku supports Prometheus metrics via an add-on, they would have enabled it and installed a dashboard to monitor the situation. The information gleaned, would be passed to the developers. They may also have added code to restart the poorly performing service at regular internals.

对于内存泄漏和缺乏监控,他们会发现Dokku通过附加组件支持Prometheus指标 ,他们会启用它并安装仪表板来监控情况。 收集的信息将传递给开发人员。 他们可能还添加了代码,以便在常规内部重新启动性能不佳的服务。

For the lack of durability, the first port of call would have been to take regular VM backups. After that, they may have deployed a second Dokku droplet for load-balancing, maybe even three of them, so that the traffic could be spread.

由于缺乏持久性,第一个调用端口是进行常规VM备份。 在那之后,他们可能已经部署了第二个Dokku Droplet来进行负载平衡,甚至可能部署了其中的三个,以便可以分散流量。

Then they may have stopped there, and monitored the situation. Perhaps they would evaluate a longer-term vision for the infrastructure like using Heroku or Google Cloud Run. They would go back to the problem being solved, reevaluate the constraints, and apply their experience and problem solving skills.

然后他们可能已经停在那里,并监视了情况。 也许他们会评估对基础架构的长期愿景,例如使用Heroku或Google Cloud Run。 他们会回到要解决的问题,重新评估约束条件,并运用他们的经验和解决问题的技能。

结语 (Wrapping up)

If the term “Cloud Native” is confusing to you, if asking “Is Kubernetes is right for us” fills you with imposter syndrome, and if you’re worried about your legacy IT investment, then I hope you found something of value in this post.

如果“ Cloud Native”一词让您感到困惑,如果询问“ Kubernetes是否适合我们”会让您充满冒名顶替综合症,并且如果您担心自己的旧版IT投资,那么我希望您从中找到有价值的东西发布。

For my friend, it seems that investing in operations would be of benefit to him and his business, and as developers we may get blindsided building an effective architecture in code, but lacking in our infrastructure. We may also be under external pressures to move faster and we don’t have to bear the full weight on our own shoulders.

对于我的朋友来说,投资于运营似乎对他和他的业务都有利,而作为开发人员,我们可能会盲目地建立有效的代码架构,但缺乏基础架构。 我们也可能会承受外部压力以加快行动速度,而不必全力承担自己的肩膀。

There are many independent, certified vendors who can provide hands-on expertise, guidance and reassurance for your IT strategy. My advice is for you to have a vision for what you’d like to achieve, but to give yourself permission to make that journey over several years if needs be. After having managed everything internally, with your own skills, maybe it’s time to speak to someone external who can answer questions, and help you map out a path?

有许多独立的,经过认证的供应商可以为您的IT战略提供动手的专业知识,指导和保证。 我的建议是让您对要实现的目标有一个愿景,但是如果需要,可以允许自己进行数年的旅程。 在用自己的技能在内部管理完所有内容之后,也许是时候与可以回答问题并帮助您规划道路的外部人员交谈了吗?

说吧 (Let’s talk?)

If you liked this post, then you can get more today. Parts of this discussion were originally published in my weekly Insiders Update emails. Subscribe to follow my OSS work and to learn about Cloud Native projects, Raspberry Pi, and Kubernetes.

如果您喜欢这篇文章,那么今天您可以得到更多。 讨论的部分内容最初发布在我的每周内部人员更新电子邮件中。 订阅以关注我的OSS工作,并了解Cloud Native项目,Raspberry Pi和Kubernetes。

  • Subscribe to Insiders via GitHub

    通过GitHub订阅内部人员

Are you looking for some guidance, or an external view with one of your projects? Send me an email, or book some time to talk

您是否正在寻找一些指导或其中一个项目的外部视图? 给我发送电子邮件,或预定时间与我交谈

You may also like my recent interview on the Kubernetes Podcast by Google on Independent Open Source.

您可能还喜欢我最近在Google在独立开放源上的Kubernetes播客上接受我的采访。

翻译自: https://medium.com/@alexellisuk/then-he-asked-me-is-kubernetes-right-for-us-78695ee35289

kubernetes

你可能感兴趣的:(python,java,算法)