k8s overall architecture:
Master node:
(Default is not to work)
kubectl: K8S a command terminal, an operation instruction sent to the client
k8s native components :( deployment k8s than essential components)
API server: a front-end interface k8s cluster, a variety of client tools and other components k8s can manage it by k8s cluster resources, which provides HTTP / HTTPS RESTful API, namely k8s API
Scheduler: is responsible for deciding the Pod on which Node run, when scheduled, will take full account of the topology of the cluster, the current load of each node, as well as high availability, performance, and affinity data needs
Controller Manager: a variety of resources is responsible for managing cluster resources are expected to ensure that the state, which consists of a variety Controller, including Replication Controller, Endpoints Controller, Namespace Controller , Serviceaccounts Controller etc.
Etcd: the state is responsible for storing information k8s cluster configuration information and resources when data changes, etcd will quickly notice k8s related components. Third-party components, meaning that it has alternatives, such as: Consul, zookeeper
Pod: The minimum constituent unit k8s cluster, a Pod, may run one or more containers, in most cases, only a Pod within a container Container
Flannel: cross host communication k8s cluster network solution that can guarantee the Pod. Third-party solutions, there are alternative
Node node:
kubelet: It is Node's agent (the agent), to determine when the Scheduler is running on a Node Pod, Pod specific configuration information will be sent to the node kubelet, kubelet will create and run a container according to the information, and Master Report Operating status
kube-proxy: responsible for access to service the TCP / UDP data traffic to the back-end of the container, if there are multiple copies, kube-pory will achieve load balancing
Run an example:
// Create a deployment resource object. Pod Controller
[root@master ~]# kubectl run test-web --image=httpd --replicas=2
Analysis of the various components of the role of architecture and process:
- kubectl send a request to the API server to deploy
- API server notify the Controller Manager to create a Deployment resources
- Scheduler to perform scheduled tasks, the Pod two copies distributed to node01 and node02
- node1 and kubelet on node02 create and run Pod on each node
supplement:
- Configuring applications and the current state of information being given etcd, the execution kubectl get pod API server will read it from the etc
These data
- flannel will assign an IP for each Pod, but this time did not create Service resources, the current kube-pory not involved