Pod is the most basic deployment dispatch unit in Kubernetes, and it can contain container, which logically represents an instance of a certain application. For example, a Web site application is built from the front end, back end, and database, and these three components will run in their respective containers, so we can create a pod containing three container. This paper will do a simple analysis of the basic processing flow of kubernetes.
The pod creation process is shown in the following illustration (the image comes from the network):
Specific steps to create include:
1, the client submits the creation request, may through the API server's RESTful API, may also use Kubectl command-line tool. Supported data types include JSON and YAML.
2, API server processing user requests, storage pod data to ETCD.
3, the scheduler through the API server to view the unbound pod. Try to assign a host to the pod.
4, filter host (scheduling preselection): Dispatcher with a set of rules to filter out the requirements of the host. For example, when the pod specifies the amount of resources required, the host that has less resources than the pod needs will be filtered out.
5, host scoring (scheduling optimization): The first step to screen the requirements of the host to mark, in the host scoring phase, the scheduler will consider some of the overall optimization strategy, such as the capacity of a replication controller copies distributed to different hosts, using the lowest load of the host.
6, select the host: Select the highest scoring host, carry out binding operations, the results are stored in the ETCD.
7, Kubelet According to the scheduling results of the pod creation operation: After the binding is successful, scheduler invokes the Apiserver API to create a Boundpod object in Etcd that describes all the pod information that is bound to run on a work node. Kubelet, which runs on each work node, also periodically synchronizes boundpod information with ETCD, and once the Boundpod object that should be running on the work node is found not updated, the Docker API is invoked to create and launch the container inside the pod.
Reference Links:
Kubernetes scheduling detailed "cloud software platform development engineer Zhang Wei"
http://ju.outofmemory.cn/entry/253027
Pod creation process in Kubernetes
Http://f.dataguru.cn/thread-685212-1-1.html