导图社区 K8S Patterns
基础模式描述了容器化应用程序必须遵守的一些基本原则,以便成为良好的云原生公民。遵守这些原则将有助于确保您的应用程序适合在Kubernetes等云原生平台中实现自动化。
编辑于2022-06-15 13:34:32K8S Patterns
Foundational Patterns 基础模式
基础模式描述了容器化应用程序必须遵守的一些基本原则,以便成为良好的云原生公民。遵守这些原则将有助于确保您的应用程序适合在Kubernetes等云原生平台中实现自动化。
Predictable Demands 可预测的需求
Explains why every container should declare its resource profile and stay confined to the indicated resource requirements. 解释了为什么每个容器都应该声明其资源配置文件,并限制在指定的资源需求中。
Declarative Deployment 声明式部署
Shows the different application deployment strategies that can be performed in a declarative way. 展示了不同的应用部署策略,可以用声明的方式进行。
Health Probe 健康探针
Dictates that every container should implement specific APIs to help the platform observe and manage the application in the healthiest way possible. 决定了每个容器都应该实现特定的API,以帮助平台以最健康的方式观察和管理应用。
Managed Lifecycle 生命周期管理
Describes why a container should have a way to read the events coming from the platform and conform by reacting to those events. 描述了为什么一个容器应该有一种方法来读取来自平台的事件,并通过对这些事件的反应来相合。
Automated Placement 自动投放
Introduces a pattern for distributing containers in a Kubernetes multinode cluster. 介绍了一种在Kubernetes多节点集群中分发容器的模式。
Behavioral Patterns 行为模式
这一类的模式主要是围绕着Pod和管理平台之间的通信机制和互动。根据管理控制器的类型,一个Pod可以运行到完成,或者被安排定期运行。它可以作为Daemon Service运行,或者为其副本提供唯一性保证。有不同的方式来运行Pod,选择正确的Pod管理基元需要了解它们的行为。
Batch Job 批量作业
Describes an isolated atomic unit of work run until completion . 描述一个孤立的原子工作单位,直到完成.
Periodic Job 定时作业
Allows the execution of a unit of work to be triggered by a temporal event. 允许由一个时间事件触发一个工作单元的执行。
Daemon Service 守护服务
Allows running infrastructure-focused Pods on specific nodes, before application Pods are placed. 允许在特定节点上运行专注于基础设施的Pod,然后再放置应用Pods。
Singleton Service 单例服务
Ensures only one instance of a service is active at a time and still highly available. 确保每次只有一个服务实例处于活动状态,并且仍然高度可用。
Stateful Service 有状态服务
Is all about how to create and manage distributed stateful applications with Kubernetes. 是关于如何使用Kubernetes创建和管理分布式有状态的应用程序。
Service Discovery 服务发现
Explains how clients can access and discover the instances providing application services. 解释了客户如何访问和发现提供应用服务的实例。
Self Awareness 自省机制
Describes mechanisms for introspection and metadata injection into applications. 描述了对应用程序进行自省和元数据注入的机制。
Structural Patterns 结构模式
容器映像和容器类似于面向对象世界中的类和对象。容器映像是实例化容器的蓝本。但这些容器并不是孤立运行的,它们运行在其他抽象中,如Pods,它们提供了独特的运行时能力。 这一类模式的重点是在Pod中构建和组织容器,以满足不同的用例。
Init Container 初始化容器
Introduces a separate lifecycle for initialization-related tasks and the main application containers. 为初始化相关任务和主要应用容器引入了一个单独的生命周期。
Sidecar 挎斗模式
Describes how to extend and enhance the functionality of a pre-existing container without changing it. 描述了如何在不改变现有容器的情况下扩展和增强其功能。
Adapter 适配器模式
Takes an heterogeneous system and makes it conform to a consistent unified interface that can be consumed by the outside world. 把一个异构系统变成一个一致的统一的界面,可以被外界所利用。
Ambassador 代理模式
Describes a proxy that decouples access to external services . 描述了一个代理,它可以解开对外部服务的访问。
Configuration Patterns 配置模式
每个应用都需要配置,最简单的方法就是把配置存储在源代码中。这种方法有一个副作用,就是配置和代码同生共死,就像不可改变的服务器概念所描述的那样。然而,我们仍然需要灵活地调整配置,而不需要重新创建应用映像。事实上,这种重新创建会很耗时,而且对于持续交付的方法来说是一种反常的做法,在这种方法中,应用程序被创建一次,然后在部署管道的各个阶段不加修改地移动,直到它到达生产。 在这样的情况下,我们将如何使应用程序适应开发、集成和生产环境的不同设置?答案是使用外部配置数据,每个环境的配置数据都是不同的。
EnvVar Configuration 环境变量配置
Uses environment variables to store configuration data. 使用环境变量来存储配置数据。
Configuration Resource 配置资源
Uses Kubernetes resources like ConfigMaps or Secrets to store configuration information. 使用Kubernetes资源如ConfigMaps或Secrets来存储配置信息。
Immutable Configuration 不可更改的配置
Brings immutability to large configuration sets by putting it into containers linked to the application at runtime. 通过在运行时将其放入链接到应用程序的容器中,为大型配置集带来了不可更改性。
Configuration Template 配置模板
Is useful when large configuration files need to be managed for various environments that differ only slightly. 当需要为各种环境管理仅有细微差别的大型配置文件时,非常有用。