This is 1m read blog from Kuberneteslab. In this article we will look into some commands to get resources from Kubernetes cluster using Kubectl.

To get the resource of particular type:

To get pod:

$ kubectl get pod -n namespace

To get deployment:
$ kubectl get deployment -n namespace

To get replicasets:
$ kubectl get replicaset -n namespace

To get service:
$ kubectl get service -n namespace

To get persistent volume:
$ kubectl get pv -n namespace

To get from all namespaces :
$ kubectl get po -A

You can use -A option with rest of Kubernetes object too.

To get all resources from all namespaces:
$ kubectl get all -A

Notify of
Inline Feedbacks
View all comments