Junior — Middle
How is a new application deployed in Kubernetes after using the command kubectl create deployment?
sobes.tech AI
Answer from AI
After executing the kubectl create deployment command, Kubernetes creates a Deployment object that describes the desired state of the application — number of replicas, container image, and other parameters. The Deployment controller automatically creates a ReplicaSet, which in turn launches the required number of Pods with the specified container.
The deployment process includes the following steps:
- Create Deployment — the command sends the description to the Kubernetes API server.
- Create ReplicaSet — Deployment creates a ReplicaSet that manages a set of Pods.
- Start Pods — ReplicaSet launches the required number of Pods with containers.
- Monitor status — Kubernetes ensures the number of running Pods matches the desired count.
Thus, after kubectl create deployment, the application is automatically deployed, and you can check the status with kubectl get pods and kubectl get deployments.