Workflow Kubernetes - <1>

Kubernetes workflow

The client creates pod process:

  1. Pod administrator creates a user requests a default by kubectl client management command api server components interact, default sends the request to the API Server.
  2. API Server will choose to process the request in accordance with the REST API which type of request (for example: when the type is created Pod Storage Pods, which is the corresponding REST Storage API).
  3. REST Storage API request will make corresponding processing result of the processing and the availability of key-value stored in the storage system Etcd.
  4. After the request of the API Server administrator kubectl response, Scheduler will be judged according to ETCD running in the cluster Pod case and Node information, Pod will need to create distributed to the available Node node. The pod is then allocated according to a set of rules can be run on their nodes, and updates the database record pod distribution.
  5. Kubelet monitoring changes in the database, the subsequent management of the life cycle of the pod, those found to be assigned to it in the pod running on the node, it will be started docker assembly, start docker components corresponding to the container (pod), on the node will run this new pod.
  6. kube-proxy running on each node of the cluster host, manage network communications, such as service discovery, load balancing. For example, when the host has data to send, it is routed to the correct pod or container. For data sent from the host, it can be found based on the request address of the remote server, and routing data correctly, in some cases using the scheduling algorithm in rotation (Round-robin) sends a request to the plurality of instances in the cluster.

Clustering capabilities of each module Function Description:

Master node:
Master node above mainly consists of four modules, APIServer, schedule, controller-manager , etcd.

APIServer : APIServer responsible kubernetes API provides a RESTful service outside, it is a unified interface system management command, any additions and deletions to the investigation have the resources to deal with APIServer then handed etcd, as shown, kubectl (provided by the customer kubernetes end tool, the tool is an internal call to kubernetes API's) and APIServer direct interaction.

Schedule :
Schedule responsible for scheduling Pod to the appropriate Node, if the scheduler as a black box, its input is a list of multiple Node pod and composed, the output is a Node of Pod and binding.
kubernetes currently provides scheduling algorithm, also retained the interface. Users define their own scheduling algorithm according to their needs.

controller manager : If APIServer do is work the front desk, then controller manager is responsible for the background. Each resource corresponds to a controller. The controller manager is responsible for the management of these controllers, for example, we created a Pod by APIServer, when the Pod is successfully created, APIServer task is complete.

ETCD : ETCD value store is a high-availability system, Kubernetes use it to store the state of each resource, in order to achieve Restful API.

Node node:
Each node Node composed mainly of three templates: kublet, kube-proxy

Proxy-Kube :
This module implements service discovery kubernetes in and reverse proxy functionality. kube-proxy forwarding support TCP and UDP connections, default group Round
Robin algorithm to forward traffic to a client and the service group corresponding to the rear end of the pod. Service discovery aspects, kube-proxy using etcd dynamics of watch mechanisms and monitoring cluster service endpoint object data, and maintain the mapping relationship to a service endpoint, thus ensuring the IP backend pod of change will not affect visitors In addition, kube-proxy also supports the session
Affinity.

kublet : kublet is Master agent in each Node node above, is the most important module Node node above, it is responsible for maintaining and managing all the containers on the Node, but if the container is not created by kubernetes, it does not manage. Essentially, it is responsible for the running of the state and the desired Pod consistent state.

Guess you like

Origin www.cnblogs.com/passzhang/p/12104660.html