什么是kubernetes?

Kubernetes是一种用于管理容器化工作负载和服务的便携式,可扩展,开源平台,便于声明性配置和自动化。它具有一个大,快速增长的生态系统。Kubernetes服务,支持和工具可广泛使用。

This page is an overview of Kubernetes.

Kubernetes是一种用于管理容器化工作负载和服务的便携式,可扩展,开源平台,便于声明性配置和自动化。它具有一个大,快速增长的生态系统。Kubernetes服务,支持和工具可广泛使用。

Kubernetes的名称来自希腊语,意思是舵手或飞行员。K8S作为缩写结果,从计算“k”和“s”之间的八个字母。谷歌在2014年开放了Kubernetes项目.Kubernetes结合了超过15年的谷歌经验running production workloads at scale with best-of-breed ideas and practices from the community.

Going back in time

让我们来看看为什么Kubernetes通过及时追溯到这么有用。

部署evolution

传统部署时代:Early on, organizations ran applications on physical servers. There was no way to define resource boundaries for applications in a physical server, and this caused resource allocation issues. For example, if multiple applications run on a physical server, there can be instances where one application would take up most of the resources, and as a result, the other applications would underperform. A solution for this would be to run each application on a different physical server. But this did not scale as resources were underutilized, and it was expensive for organizations to maintain many physical servers.

Virtualized deployment era:As a solution, virtualization was introduced. It allows you to run multiple Virtual Machines (VMs) on a single physical server's CPU. Virtualization allows applications to be isolated between VMs and provides a level of security as the information of one application cannot be freely accessed by another application.

虚拟化允许更好地利用物理服务器中的资源,并允许更好的可伸缩性,因为可以轻松地添加或更新应用程序,从而降低硬件成本等等。使用虚拟化,您可以将一组物理资源显示为一次性虚拟机集群。

每个VM都是一个全机运行所有组件,包括其自己的操作系统,在虚拟化硬件的顶部。

Container deployment era:容器are similar to VMs, but they have relaxed isolation properties to share the Operating System (OS) among the applications. Therefore, containers are considered lightweight. Similar to a VM, a container has its own filesystem, share of CPU, memory, process space, and more. As they are decoupled from the underlying infrastructure, they are portable across clouds and OS distributions.

容器变得流行,因为它们提供额外的福利,例如:

  • 与VM图像使用相比,Agile应用程序创建和部署:增加容器图像创建的缓解和效率。
  • 连续开发,集成和部署:提供可靠和频繁的容器图像构建和部署,快速高效回滚(由于图像不可变形)。
  • 开发和ops的关注分离:在构建/释放时间而不是部署时间创建应用程序容器图像,从而从基础架构解耦应用程序。
  • 可观察性不仅是OS级信息和指标,还不仅是应用健康和其他信号。
  • Environmental consistency across development, testing, and production: Runs the same on a laptop as it does in the cloud.
  • 云和操作系统分销便携性:在ubuntu,rhel,核心,内部房屋,主要公共云和其他地方运行。
  • 以应用程序为中心的管理:提高在虚拟硬件上运行OS的抽象级别以使用逻辑资源在OS上运行应用程序。
  • 松散耦合,分布式,弹性,解放的微服务:应用程序被打破到较小的独立件中,可以动态部署和管理 - 不是在一个大型单一机器上运行的单片堆栈。
  • 资源隔离:可预测的应用程序性能。
  • Resource utilization: high efficiency and density.

为什么你需要kubernetes和它可以做的事情

容器是捆绑和运行应用程序的好方法。在生产环境中,您需要管理运行应用程序的容器,并确保没有停机时间。例如,如果容器下降,则需要启动另一个容器。如果系统处理此行为,它不会更容易吗?

这就是Kubernetes如何拯救!Kubernetes为您提供了一个框架来重新定位分布式系统。为您的应用程序负责缩放和故障转移,提供部署模式等。例如,Kubernetes可以轻松管理系统的金丝雀部署。

Kubernetes为您提供:

  • 服务发现和负载平衡Kubernetes can expose a container using the DNS name or using their own IP address. If traffic to a container is high, Kubernetes is able to load balance and distribute the network traffic so that the deployment is stable.
  • 存储编排Kubernetes allows you to automatically mount a storage system of your choice, such as local storages, public cloud providers, and more.
  • 自动卷展览和回滚您可以使用Kubernetes描述已部署的容器的所需状态,并且可以以受控速率将实际状态更改为所需状态。例如,您可以自动化Kubernetes为部署创建新容器,删除现有容器并将其所有资源用于新容器。
  • 自动箱包装您可以使用它可以用于运行容器化任务的节点集群提供Kubernetes。您告诉Kubernetes每个容器需要多少CPU和内存(RAM)。Kubernetes可以将容器装入节点上,以充分利用您的资源。
  • 自我修复Kubernetes restarts containers that fail, replaces containers, kills containers that don't respond to your user-defined health check, and doesn't advertise them to clients until they are ready to serve.
  • 秘密和配置管理Kubernetes允许您存储和管理密码,OAuth令牌和SSH键等敏感信息。您可以在不重建容器图像的情况下部署和更新秘密和应用程序配置,而不会在堆栈配置中泄露秘密。

什么kubernetes不是

Kubernetes is not a traditional, all-inclusive PaaS (Platform as a Service) system. Since Kubernetes operates at the container level rather than at the hardware level, it provides some generally applicable features common to PaaS offerings, such as deployment, scaling, load balancing, and lets users integrate their logging, monitoring, and alerting solutions. However, Kubernetes is not monolithic, and these default solutions are optional and pluggable. Kubernetes provides the building blocks for building developer platforms, but preserves user choice and flexibility where it is important.

Kubernetes:

  • 不限制支持的应用程序类型。Kubernetes旨在支持极其多样化的工作负载,包括无状态,有状态和数据处理工作负载。如果应用程序可以在容器中运行,它应该在Kubernetes上运行很好。
  • 不部署源代码,不会构建您的应用程序。连续集成,交付和部署(CI / CD)工作流程由组织文化和偏好以及技术要求确定。
  • 不提供应用程序级服务,例如中间件(例如,消息总线),数据处理框架(例如,Spark),数据库(例如,MySQL),缓存,或群集存储系统(例如,Ceph)作为内置服务。此类组件可以在Kubernetes上运行,和/或可以通过便携式机制(例如)在Kubernetes上运行的应用程序访问Open Service Broker
  • 不决定日志记录,监控或警报解决方案。它提供了一些作为概念证明的集成以及收集和导出指标的机制。
  • Does not provide nor mandate a configuration language/system (for example, Jsonnet). It provides a declarative API that may be targeted by arbitrary forms of declarative specifications.
  • Does not provide nor adopt any comprehensive machine configuration, maintenance, management, or self-healing systems.
  • Additionally, Kubernetes is not a mere orchestration system. In fact, it eliminates the need for orchestration. The technical definition of orchestration is execution of a defined workflow: first do A, then B, then C. In contrast, Kubernetes comprises a set of independent, composable control processes that continuously drive the current state towards the provided desired state. It shouldn't matter how you get from A to C. Centralized control is also not required. This results in a system that is easier to use and more powerful, robust, resilient, and extensible.

What's next

Last modified April 30, 2021 at 9:43 PM PST :DOCS(概述):在K8S缩写时添加信息(170304E28)