hi,
i like to know what component in kubernetes cluster create pods,deployments,so on.
kubectl apply -f yaml file ->send request to apiserver->send request to job controller?
then job controller will create the object(deploy,pod,so on).
is correct?
In general parlance, an “object” is a single instance of a REST resource in the API. So when you ‘kubectl create’, the API server either ACKs your request, meaning the object was created or NAKs it, meaning it was not created.
Once created, any number of controllers can asynchronously actuate that object. For example, kubelet will configure and run containers to actuate a pod.
Let`s say i like to create pod.
api server will receive the pod creation request (kubectl).This api server will contact resource controller,This resource controller will contact api server and this api server will contact kubelet on node picked by scheduler. kubelet on that node will create this pod.
Kubelet will use the docker container runtime,and this will create the containers,kubelet will put those container in pod.
correct?
The problem is that “creates” is an ambiguous word.
Sometimes users create pods. More often users create deployments or jobs, which are implemented as controllers, and those controllers create the pods. All of them (user, deployment controller, job controller, etc) are API clients.
They are actually asking the API server “please create a pod that looks like…” via an HTTP POST operation. Assuming the API is able to do that for this call, it saves a record in the database.
There are other API clients which watch the API for changes to pods, which will be notified that a new pod was created. Fore example the scheduler and kubelet (but also others).
The scheduler picks a node. The Kubelet will then create and run containers on that node. We sometimes call that “actuation” because it is making the pod real.
Hope that helps.
then kubelet will create container on node and the coresponding controller create the pod?i mean kubelet works with controller and the containers then that pod will be configured and actuated?
“and those controllers create the pods”
" The Kubelet will then create and run containers on that node"
The controller run in control plane.
kubelet will create container on node
Yes, though I would say “run” rather than “create”
the coresponding controller create the pod?
I don’t know what this means - Pods are not a real thing, except in the API
by coresponding controller,i mean-let`s say we use deployment kind,in yaml,then deployment controller will be used.
The deployment controller creates or destroys pods in the API in order to fulfill the desired replica count.
If there are too few pods, it creates some. If there are too many it deletes some.