协调作用
Controllers actuate Resources by reading the Resource they are Reconciling + related Resources, such as those that they create and delete.
控制器不关心事件,只有当期望的状态和集群现有状态不一致时才开始协调。
1.Deployment控制器创建/删除ReplicaSets
2.ReplicaSet控制器创建/删除Pods
3.Scheduler(控制器)关联主机节点到Pods
4.Node(控制器)在节点运行Pods里的容器
监视作用
Controllers actuate Resources after they are written by Watching Resource Types, and then triggering Reconciles from Events. After a Resource is created/updated/deleted, Controllers Watching the Resource Type will receive a notification that the Resource has been changed, and they will read the state of the system to see what has changed (instead of relying on the Event for this information).
1.Deployment控制器监视Deployments + ReplicaSets (+ Pods)
2.ReplicaSet控制器监视ReplicaSets + Pods
3.Scheduler(控制器)监视Pods
4.Node(控制器)监视Pods(+ Secrests + ConnfigMaps )
Kubernetes资源APIs(Kubernetes Resource APIs)
1.Pods
容器(Containers)运行在调度到主机的节点上的Pods里面。
Pods运行一个应用的单副本并提供如下:
Compute Resources (cpu, memory, disk)
Environment Variables
Readiness and Health Checking
Network (IP address shared by containers in the Pod)
Mounting Shared Configuration and Secrets
Mounting Storage Volumes
Initialization
kubectl概览
1.列出Kubernetes资源
2.从配置文件中创建资源
3.从命令行生成一个配置文件
4.查看通过Kubernetes资源创建的
Pods
5.调试容器
Kubernetes资源(Resources)和控制器(Controllers)概览
1.资源(Resources)
像Deployments, Services, Namespaces等Kubernetes对象的实例称为资源。
运行容器的资源常常叫做工作负载(Workloads)。
Deployments,StatefulSets,Jobs,CronJobs,DaemonSets等都是工作负载。
用户通过定义一些文件交给资源APIs(Resources APIs)来应用到Kubernetes集群。那些文件常常被称为资源配置(Resouce Config)
一般通过
2.资源结构(Resources Structure)
一般地,资源有如下组件构成:
TypeMeta: Resource Type apiVersion and kind.
ObjectMeta: Resource name and namespace + other metadata (labels, annotations, etc).
Spec: the desired state of the Resource - intended state the user provides to the cluster.
Status: the observed state of the object - recorded state the cluster provides to the user.
Resource Config written by the user omits the Status field.
一个简单示例Deployment资源的资源配置(Resource Config)如下:
3.控制器(Controllers)
控制器提供Kubernetes APIs。他们观察系统到的状态,监听到资源(像资源的创建更新和删除)或者系统(像Pod或主机节点死掉)的变化,然后尽职尽责的执行用户(如通过资源配置)或自动化(如自动伸缩)的指示。
比如,当用户创建一个Deployment, 如果这个Deployment存在,Deployment控制器(Deployment Controller)会检查对比已存在的 ReplicaSet,如果不存在,则会创建ReplicaSet。
4.控制器结构(Controller Structure)
Controllers actuate Resources by reading the Resource they are Reconciling + related Resources, such as those that they create and delete.
控制器不关心事件,只有当期望的状态和集群现有状态不一致时才开始协调。
1.Deployment控制器创建/删除ReplicaSets
2.ReplicaSet控制器创建/删除Pods
3.Scheduler(控制器)关联主机节点到Pods
4.Node(控制器)在节点运行Pods里的容器
Controllers actuate Resources after they are written by Watching Resource Types, and then triggering Reconciles from Events. After a Resource is created/updated/deleted, Controllers Watching the Resource Type will receive a notification that the Resource has been changed, and they will read the state of the system to see what has changed (instead of relying on the Event for this information).
1.Deployment控制器监视Deployments + ReplicaSets (+ Pods)
2.ReplicaSet控制器监视ReplicaSets + Pods
3.Scheduler(控制器)监视Pods
4.Node(控制器)监视Pods(+ Secrests + ConnfigMaps )
Kubernetes资源APIs(Kubernetes Resource APIs)
1.Pods
容器(Containers)运行在调度到主机的节点上的Pods里面。
Pods运行一个应用的单副本并提供如下:
Compute Resources (cpu, memory, disk)
Environment Variables
Readiness and Health Checking
Network (IP address shared by containers in the Pod)
Mounting Shared Configuration and Secrets
Mounting Storage Volumes
Initialization
2.工作负载(Workloads)
TBD...
原文链接:https://kubectl.docs.kubernetes.io/