[Container arrangement] Getting to know Kubernetes for the first time

Table of contents

1 Introduction

2. Why k8s is needed

3. What can k8s do?

4. What is k8s not?


1 Introduction

Extract from the official website: Overview | Kubernetes

        The name Kubernetes is derived from Greek, meaning 舵手or 飞行员. The abbreviation k8s is due to the eight-character relationship between k and s. Google open sourced the Kubernetes project in 2014. Kubernetes builds on Google's decades of experience running production workloads at scale , incorporating the best ideas and practices from the community.

        Kubernetes is a portable, extensible, open source platform for 管理容器化的工作负载和服务,可促进声明式配置和自动化. Kubernetes has a large and rapidly growing ecosystem with a wide range of services, support, and tooling available.

        Since the release of the first version in 2014, Kuberetes has quickly gained popularity in the open source community, and many influential companies including Red Hat and VMware have joined the development and promotion camp. At present, Kubernetes has become the fastest growing container orchestration product with the highest market share.

2. Why k8s is needed

Extract from the official website: Overview | Kubernetes

Traditional Deployment Era:

        In the early days, organizations ran applications on physical servers. 由于无法限制在物理服务器中运行的应用程序资源使用,因此会导致资源分配问题. For example, if multiple applications are running on the same physical server, it may happen that one application consumes most of the resources, causing the performance of other applications to degrade. 一种解决方案是将每个应用程序都运行在不同的物理服务器上, 但是当某个应用程式资源利用率不高时,剩余资源无法被分配给其他应用程式, 而且维护许多物理服务器的成本很高.

The era of virtualization deployment:

        Therefore, virtualization technology was introduced. Virtualization technology allows you to run multiple virtual machines (VMs) on a single physical server CPU. 虚拟化能使应用程序在不同 VM 之间被彼此隔离,且能提供一定程度的安全性, 因为一个应用程序的信息不能被另一应用程序随意访问.

        Virtualization technology can better utilize the resources of physical servers, and because applications can be easily added or updated, it can have the benefits of higher scalability, lower hardware costs, and so on. With virtualization, you can present a set of physical resources as a cluster of disposable virtual machines.

每个 VM 是一台完整的计算机,在虚拟化硬件之上运行所有组件,包括其自己的操作系统

Container Deployment Era:

        Containers are similar to VMs, but with looser isolation features that allow the sharing of an operating system (OS) between containers. Therefore, containers are considered more lightweight than VMs. And similar to a VM, each container has its own file system, CPU, memory, process space, and more. Since they are decoupled from the infrastructure, they are portable across clouds and OS releases. 容器的出现解决了应用和基础环境异构的问题,让应用可以做到一次构建,多次部署. There is no denying that containers are a great way to package and run applications, so container deployment has become popular. But with the popularity of container deployment, there are still some problems that are not solved by container-based deployment alone:

  • In a production environment, you need to manage the containers running the application and ensure that the service does not go offline. For example, if one container fails, you need to start another container.

  • When the concurrency is high, you need to start multiple application containers to improve the high availability of the system and ensure that multiple containers can be load balanced.

  • When maintaining and upgrading the version, you need to re-deploy the running application container. When deploying, you must back up the previous application container. Once an error occurs, you need to manually start the previous container to ensure the system is running.

如果以上行为交由给系统处理,是不是会更容易一些?那么谁能做到这些?

3. What can k8s do?

Extract from the official website: Overview | Kubernetes

        This is what Kubernetes is here to do! Kubernetes 为你提供了一个可弹性运行分布式系统的框架. Kubernetes takes care of your scaling requirements, fails over your applications, provides deployment modes, and more. Kubernetes gives you:

  • Service discovery and load balancing

    Kubernetes can expose containers using DNS names or their own IP addresses. If there is a lot of traffic coming into the container, Kubernetes can load balance and distribute the network traffic, making the deployment stable.

  • Storage Orchestration

    Kubernetes allows you to automatically mount the storage system of your choice, such as local storage, public cloud providers, etc.

  • Automatic deployment and rollback

    You can describe the desired state of a deployed container using Kubernetes, which can change the actual state to the desired state at a controlled rate. For example, you can automate Kubernetes to create new containers for your deployment, delete existing containers and use all their resources for new containers.

  • Automatically complete box packing calculation/automatic resource scheduling

    You provide Kubernetes with a cluster of many nodes on which to run containerized tasks. You tell Kubernetes how much CPU and memory (RAM) each container needs. Kubernetes can schedule these containers onto your nodes as needed to make optimal use of your resources.

  • self-healing/self-healing ability

    Kubernetes will restart failed containers, replace containers, kill containers that do not respond to user-defined health checks, and not notify clients of them until they are ready for service.

  • Key and configuration management

    Kubernetes allows you to store and manage sensitive information such as passwords, OAuth tokens, and ssh keys. You can deploy and update secrets and application configurations without rebuilding container images, or exposing secrets in stack configurations.

4. What is k8s not?

        Kubernetes 不是传统的、包罗万象的 PaaS(平台即服务)系统. Since Kubernetes runs 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 allows users to integrate their logging, monitoring, and alerting schemes. However, Kubernetes 不是单体式(monolithic)系统those default solutions are optional and pluggable. Kubernetes provides the foundation for building a developer platform, but retains user choice where it matters, allowing for greater flexibility.

Kubernetes:

  • There is no limit to the types of applications supported. Kubernetes is designed to support an extremely wide variety of workloads, including stateless, stateful, and data processing workloads. If an application can run in a container, it should run just fine on Kubernetes.

  • Source code is not deployed and your application is not built. Continuous integration (CI), delivery, and deployment (CI/CD) workflows depend on an organization's culture and preferences, as well as technical requirements.

  • Does not provide application-level services as built-in services, such as middleware (such as message middleware), data processing framework (such as Spark), database (such as MySQL), cache, cluster storage system (such as Ceph). Such components can run on Kubernetes and/or can be accessed by applications running on Kubernetes through portable mechanisms such as open service proxies .

  • Not a logging, monitoring or alerting solution. It integrates some functionality as a proof of concept and provides mechanisms to collect and export metrics.

  • Languages ​​and systems (such as jsonnet) that do not provide or require configuration, provide a declarative API that can be composed of any form of declarative specification.

  • No comprehensive machine configuration, maintenance, management, or self-healing system is provided nor employed.

  • Also, Kubernetes is not just an orchestration system, it actually eliminates the need for orchestration. The technical definition of orchestration is the execution of a defined workflow: first do A, then B, then C. Kubernetes, on the other hand, consists of a set of independently composable control processes that continuously drive the current state to a provided desired state. You don't need to care about how to move from A to C, and you don't need centralized control, which makes the system easier to use and more powerful, the system is more robust, more elastic and scalable.

おすすめ

転載: blog.csdn.net/weixin_53678904/article/details/132018062