Sodamhan.com

TL;DR

kubectl get

Get Kubernetes objects and resources. More information: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#get.

  • Get all namespaces in the current cluster:

kubectl get namespaces

  • Get nodes in a specified namespace:

kubectl get nodes --namespace namespace

  • Get pods in a specified namespace:

kubectl get pods --namespace namespace

  • Get deployments in a specified namespace:

kubectl get deployments --namespace namespace

  • Get services in a specified namespace:

kubectl get services --namespace namespace

  • Get all resources in a specified namespace:

kubectl get all --namespace namespace

  • Get Kubernetes objects defined in a YAML manifest file:

kubectl get --file path/to/manifest.yaml

This document was created using the contents of the tldr project.