Skip to main content
⚡ OpenDevDocs
Kubernetes Commands
devopskubernetesReferenceBeginner

kubectl get

List one or more Kubernetes resources such as Pods, Deployments, Services, Nodes, and Namespaces with custom output formatting.

Verified: 2026-10-01
Tested on:kubernetes 1.31
Platforms:
all
#kubernetes#kubectl#get#pods#resources

Command

kubectl get pods -n default -o wide


Short Description

kubectl get lists one or more API resources in your cluster, displaying tabular status columns like readiness, restart count, age, IP address, and hosting node.


Syntax

kubectl get <resource_type> [NAME] [FLAGS]

Examples

1. List Pods Across All Namespaces

kubectl get pods -A

2. Output Full Object Definition in YAML

kubectl get deployment api-server -o yaml

3. List Services with Wide Details

kubectl get svc -o wide

4. Filter Pods by Label Selector

kubectl get pods -l app=web,environment=production

Common Options

OptionShorthandDescription
--all-namespaces-AList requested resources across all cluster namespaces.
--namespace-nSpecify target namespace (defaults to active context).
--output-oOutput format: wide, yaml, json, name, jsonpath.
--selector-lFilter resources by label key=value pairs.
--watch-wStream real-time resource state updates.

On this page