kubectl get pods by namespace code example
Example 1: kubectl list context
# list kubernets contexts
kubectl config get-contexts
Example 2: kubernetes get services
# Get pods in default namespace
kubectl get services
#Get Pods in my-namespace
kubectl get services -n my-namespace
#Get Pods in all namespaces
kubectl get services --all-namespaces