Kubernetes Operation Flow
In Kubernetes, the process for creating a new pod is as follows.

- A request to create a pod is sent to the kube-apiserver on the Master Node.
- The kube-apiserver stores the new state in etcd.
- The kube-apiserver detects the state change in etcd and requests the kube-controller-manager to create a new pod.
- The kube-controller-manager informs the kube-apiserver about the creation of a new pod (no assign), and the kube-apiserver, upon receiving this, stores it in etcd.
- When the kube-scheduler identifies a pod (no assign) via the kube-apiserver, it finds a suitable Worker Node and updates etcd via the kube-apiserver to assign the pod to that node.
- The kubelet on each Worker Node checks if there are any pods assigned to its Node but not yet created, and if so, it creates the pod.
- The kubelet on that Worker Node periodically reports the pod's status to the API server.
Looking at the flow, we can see that each component communicates not directly with each other, but through the API Server.
Furthermore, each component checks its current state and operates independently.
kubectl [command] [type] [name] [flags]
command #
The command to be executed by kubectl. Examples include get, create, delete, apply, etc.
type #
The type of Kubernetes object the command applies to. Examples include pod, service, deployment, etc.
name #
The name of the Kubernetes object the command applies to. For example, for a pod, you specify the pod's name.
flag #
Options that affect command execution. Examples include --namespace, --selector, --output, etc.