Work with cluster and resources using kubectl
Here i suggest different scenario with resources in cluster(cloud-managed, bare-metal and local such as minikube) Before starting work with cluster you can see on this article
Usually metadata consists field labels and one of popular labels is release
$>kubectl get po -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.metadata.labels.release}{"\n"}{end}'The expression selecting name of each pod and release from .metadata.labels
Get all pods with same release
$>kubectl get po -l release=<my-release>$>kubectl get po --field-selector spec.nodeName=<node-name>The expression selecting all pods deployed on node with name <node_name>
For determination all nodes in cluster you can run
$>kubectl get nodesOften you can get error
Error from server (Forbidden): nodes is forbidden:because user in kubeconfig doesn't have permissions on some commands
kubectl get po --field-selector status.phase=Failed --all-namespaces