Verifying Deployment Status
Checking Deployment Status
After creating a Deployment, you can use the kubectl get deployment
command to check the status of the Deployment:
kubectl get deployment my-web-app
This will output the current status of the Deployment, including the number of desired, current, and available replicas.
Inspecting Deployment Details
To get more detailed information about a Deployment, you can use the kubectl describe deployment
command:
kubectl describe deployment my-web-app
This will output information about the Deployment, including the container image, resource requirements, and the status of the underlying ReplicaSet and Pods.
Monitoring Deployment Rollouts
When you update a Deployment (e.g., by changing the container image), Kubernetes will perform a rolling update to gradually update the Pods. You can monitor the rollout progress using the kubectl rollout status
command:
kubectl rollout status deployment my-web-app
This will output the status of the rolling update, including the number of updated and available replicas.
Checking Pod Status
To check the status of the Pods managed by a Deployment, you can use the kubectl get pods
command:
kubectl get pods -l app=my-web-app
This will list all the Pods that belong to the my-web-app
Deployment, along with their status (Running, Pending, etc.).
Troubleshooting Deployment Issues
If you encounter any issues with your Deployment, you can use the kubectl logs
command to view the logs of the Pods:
kubectl logs -l app=my-web-app
This will output the logs of all the Pods managed by the my-web-app
Deployment, which can help you diagnose and troubleshoot any issues.