Kubectl: Get Deployments – Kubernetes

A Deployment in Kubernetes is the process of providing declarative updates to Pods.

It allows to declare the desired state in the manifest (YAML) file, and the controller will change the current state to the declared state.

Deployments can scale the number of replica Pods, enable rollout of updated code in a controlled manner, or rollback to an earlier Deployment version if necessary.

This note shows how to get the list of Deployments in Kubernetes, how to Describe deployments and how to get the Deployment details in YAML format using the kubectl command.

Cool Tip: Get Services in Kubernetes! Read more →

Get Kubernetes Deployments using Kubectl

List Deployments:

$ kubectl get deployments
- or -
$ kubectl get deployments <NAME>

Get the Deployment details:

$ kubectl describe deployments
- or -
$ kubectl describe deployment <NAME>

Get the Deployment details in YAML format:

$ kubectl get deployments -o yaml
- or -
$ kubectl get deployments <NAME> -o yaml

Cool Tip: List & Change Namespaces in Kubernetes! Read more →

Leave a Reply