What is the process of creating a pod in k8s?

The process of creating a Kubernetes Pod is as follows:

  1. Users send requests to create Pod either through the Kubernetes API or command-line tools, such as kubectl.
  2. After receiving the request, the API Server verifies the user’s identity and permissions, and then forwards the request to the Kubernetes controller.
  3. When the ReplicaSet controller or Deployment controller in the controller manager receives a request, it generates configurations for one or more Pods based on the definition and rules of the Pod.
  4. The controller sends the generated Pod configuration to the scheduler.
  5. The scheduler selects a suitable node to run the Pod based on resource usage in the cluster and scheduling policies.
  6. The scheduler writes the selected node information into the Pod configuration and returns the configuration to the controller.
  7. The controller sends the updated Pod configuration to the API Server.
  8. The API Server saves updated Pod configurations in etcd, acting as the storage engine for the entire cluster.
  9. The kubelet process on nodes regularly fetches Pod configurations from the API Server.
  10. The kubelet creates and runs one or more containers on a node based on the configuration information of the Pod, forming a Pod.
  11. The kubelet sends updates on the status of the Pod to the API Server so that users can view the running status of the Pod.

In this process, the controller is responsible for generating and managing Pod configurations, the scheduler is responsible for assigning Pods to appropriate nodes, and the kubelet is responsible for creating containers on nodes and monitoring their runtime status.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds