The API Server is the only Kubernetes components that connects to etcd; all the other components must go through the API Server to work with the cluster state.
The API Server is also responsible for the authentication and authorization mechanism. All API clients should be authenticated in order to interact with the API Server.
当用户创建一个Pod时,时序图如下:
Kubectl writes to the API server(kubectl run mywebserver --image=nginx)
API server will authenticate and authorize. Upon validation, it will write it to etcd.
Upon write to etcd, API Server will invoke the scheduler.
Scheduler decides which node the pod should run and return data to API Server. API will in-turn write it back to etcd.
API Server will invoke the kubelet in the node decided by the scheduler.
Kubelet communicates to the docker daemon via Docker socket to create a container.
Kubelet will update the status of the POD back to the API Server.
API Server will write the status details back to etcd.