Working with Deployments
Explore how to manage Kubernetes deployments using kubectl commands. Learn to create, pause, resume, update, scale, rollback, and delete deployments while monitoring pods and replica sets to maintain application availability.
We'll cover the following...
Some commands related to deployments
The table below contains some of the useful commands for deployment. Try these commands out in the terminal below the table.
Commands | Use |
| Rolls back to the previous version of specified deployment |
| Scales the number of Pods in the specified deployment |
| Auto scales the number of Pods in the specified deployment as per need to a certain maximum and minimum |
| Pauses the rollout of deployment |
| Resumes the rollout of deployment |
Observations
In the above terminal:
kubectl apply -f https://k8s.io/examples/controllers/nginx-deployment.yaml: Creates deployment.kubectl get deployments: Gets list of deployments that include recently creatednginx-deployment.kubectl rollout pause deployment/nginx-deployment: The deployment rollout gets paused.kubectl get rs: Here,