History of Kubernetes Development
-
K8S has a development history of 5 years, evolved from Google's Brog
-
Native operation: the application is deployed on the server
-
Upgrade operation: using virtualization technology, relatively cumbersome
-
docker operation: containerization technology, shielding the details of different operating systems
多种不同类型的云服务器,docker engine当前运行的环境进行迁移的话。不用类型的云服务器之间进行迁移,迁移成本会比较大。
有了kubernetes技术之后,所有的容器编排都可以运行在K8S之上
gRPC:服务层面远程调用
Linked:解决代理转发流量问题
云原生组织项目:K8S——基础设施支撑
云原生:不管运行在哪一种云上,还是熟悉的样子
容器编排技术:Kubernetes
Kubernetes做容器编排
Docker Swarm也做容器编排
Kubernetes
The learning journey begins - understand the basic component concepts
Pod
- How K8S manages containers
- The smallest operating unit of K8S is pod, which is a combination of one or more containers
- What are pods? A pod is a combination of one or more containers, sharing storage and networking
ReplicaSet
- It is mainly used to balance and stabilize the operation of pods, and to manage pods. The number of pods can be specified
- The essence is to define how many pods to run
- official explanation
A Replicaset is defined with fields, including a selector that specifies how to identify pods it can acquire, a number of
replicas indicating how many pods it should be maintaining,and a pod template specifying the data of new pods it should create to meet the number of replicas criteria.
副本集是用字段定义的。包含一个选择器指定如何识别它可以获取的pod。表示应该维护多少个pod的副本。和一个pod模版指定它应该创建的新的pod的数据以满足副本数量标准
Deployment
- Used to manage ReplicaSet and Pod
- official explanation
A Deployment controller provides declarative updates for Pods and Replicasets.
You describe a desired state in a Deployment, and the Deployment controller changes the actual state to the desired state at a
controlled rate. You can define Deployments to create new Replicasets, or to remove existing Deployments and adopt all their
resources with new Deployments.
部署控制器为pod和副本集提供声明式更新
你描述了部署中所需要的状态,并且部署控制器以受控速率将实际状态改为期望状态。你可以定义部署去创建新的副本集,或者移除已经存在的部署并采用其资源去做新的部署
Service
Pod classification
- Classify pods in the form of key-value, called labels
- Use LABEL to manage these labels
- How to associate Pods?
- Call a Pod with the same type of LABEL a Service
- There is a selector selector in Service to select pods with the same lable label
- official explanation
label are key/value pairs that are attached to objects, such as pods
标签是附加到对象(如pod)上的键值对
An abstract way to expose an application running on a set of pods as a network service.
with kubernetes you do not need to modify your application to use an unfamiliar service discovery mechanism. Kubernetes gives
pods their own IP addresses and a single DNS name for a set of Pods, and can load-balance across them
以一种抽象的方式将运行在一组POD上应用程序公开为网络服务。
使用kubernetes,你不需要使用不熟悉服务发现机制去更新你的应用程序
Kubernetes分配给pods属于它们自己的IP地址以及给一组pod分配一个单独的DNS名称,并且能够通过它们实现负载均衡
LABEL
- The label that exists for each pod is called LABEL
Node
- Our pod will eventually run on each node node, and the node is a worker node in the k8s cluster
A node is a worker machine in Kubernetes, previously known as a minion.A node may be a VM or physical machine, depending on the
cluster.Each node contains the services necessary to run pods and is managed by the master components.
节点是Kubernetes的工作机器,之前被称为仆从。节点可以是虚拟机或者物理机器,具体取决于集群。每一个节点都包含着必须的服务去运行pod并且由master组件去管理。
work process
cluster entry
- How requests reach the master node
kubectl
-
Command components for manipulating clusters
-
Authentication/authorization is required before accessing the portal
-
The request arrives, API Server: runs on the manager node and receives the request from kubectl
-
After receiving the request, which node is the pod created on? Need a strategy to decide - Scheduler
-
After the node is selected, who will make the specific sending request? Distributed by the Controller Manager in the Manager node
-
After the request is sent, how to receive the request in the worker node? kube-proxy runs on the worker node to receive requests
-
Next create a pod, each worker node has a kubelet component that can be used to create a pod
-
The container is running in the pod, and each worker node has the support of the docker environment, that is, the docker engine
distributed storage
- As a cluster, the content in the cluster needs to be stored
- The etcd component is a component used by Kubernetes for distributed storage
DNS
- Pods may run on different nodes.
- How to access it?
- Kubernetes provides dns components for domain name resolution
visual interface
- The Dashboard component provides a visual interface to display the status of the entire cluster