Get startedGet started for free

Inspecting Deployments

1. Inspecting Deployments

Let’s explore how to inspect the state of a Deployment. Two useful commands to inspect the state of a Deployment are the “kubectl get” and “describe” commands. The “kubectl get deployment” command displays the ready, up-to-date, and available status of all the ReplicaSets within a Deployment, along with their ages. The “ready” field displays how many replicas of the application are available to your users. The “up-to-date” field displays the number of replicas that are fully up to date as per the current Deployment specification. The “available” field displays the number of replicas available to the users. And the “age" field displays the time the replicas have been available to the users. The “kubectl get deployment” command can also be used to output the Deployment configuration in a YAML format. This could be useful if you originally created a Deployment by using the “kubectl run” command, but then decided to make it a permanent, managed part of your infrastructure. By editing that YAML file to remove the unique details of the Deployment you created it from, you can add it to your repository of YAML files for future Deployments. Another option to inspect the state of a Deployment is through the “kubectl describe” command. Information includes the Deployment’s current state, its desired state, its replicas, its selector, and its events. And finally, a third option to inspect a Deployment is through the Google Cloud console. Displayed in the Google Cloud console is the Deployment name, the date the Deployment was created, the desired state, the current state, the number of replicas the Deployment is trying to maintain, the selector being used to match Pods, and a list of events that have occurred for the Deployment. The details here can be exported to a YAML file for future use.

2. Let's practice!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.