Sunday 19 July 2020

Kubernetes: Get the Pods in specific namespace

'kubectl get pods' command return all the pods in the 'default' namespace.

$kubectl get pods
NAME               READY   STATUS    RESTARTS   AGE
employee-service   1/1     Running   0          8m8s

If you want to know information about all the Pods running in specific namespace use the option -n.

 

For example, below command return all the Pods in the namespace ‘kube-system’.

 

kubectl get pods -n kube-system

$kubectl get pods -n kube-system
NAME                               READY   STATUS    RESTARTS   AGE
coredns-66bff467f8-mdqf8           1/1     Running   4          31d
coredns-66bff467f8-qrv7b           1/1     Running   4          31d
etcd-minikube                      1/1     Running   4          31d
kube-apiserver-minikube            1/1     Running   4          31d
kube-controller-manager-minikube   1/1     Running   8          31d
kube-proxy-9zlxd                   1/1     Running   4          31d
kube-scheduler-minikube            1/1     Running   8          31d
storage-provisioner                1/1     Running   8          31d




Previous                                                    Next                                                    Home

No comments:

Post a Comment