Sequential Breakdown of the Process
Learn about the sequence of events involved in the process of creating a ReplicaSet.
We'll cover the following
Step by step process
The sequence of events that occur with the kubectl create -f go-demo-2.yml
command is as follows:
-
The Kubernetes client (
kubectl
) sends a request to the API server requesting the creation of a ReplicaSet defined in thego-demo-2.yml
file. -
The controller is watching the API server for new events, and it detects that there is a new ReplicaSet object.
-
The controller creates two new Pod definitions because we have configured the replica value as 2 in
go-demo-2.yml
file. -
Because the scheduler is also watching the API server for new events, it detects that there are two unassigned Pods.
-
The scheduler decides which node to assign the Pod to and sends that information to the API server.
-
The kubelet is also watching the API server. It detects that the two Pods are assigned to the node it is running on.
-
The kubelet sends requests to Docker requesting the creation of the containers that form the Pod. In our case, the Pod defines two containers based on the
mongo
and theapi
image. So in total, four containers are created. -
Finally, the kubelet sends a request to the API server notifying it that the Pods are created successfully.
Get hands-on with 1400+ tech skills courses.