<p>I have problems finding the values used for selecting or displaying objects in kubernetes. I feel like I'm not using the kubernetes docs correctly or these are linked with a command I haven't learned yet.</p>
<p>Examples:</p>
<ol>
<li><p>Find all the pods on a certain node? How do you know it's in spec.nodeName</p>
<p><code>kubectl get pods --all-namespaces -o wide --field-selector spec.nodeName=&lt;node&gt;</code></p>
</li>
<li><p>Get all Pods in a running state? How do you know this value is stored in status.phase</p>
<p><code>kubectl get pods --field-selector status.phase=Running</code></p>
</li>
<li><p>Get all pods but only listing the name, How do you know it called metadata.name</p>
<p><code>kubectl get pods -o custom-columns:POD:metadata.name</code></p>
</li>
</ol>

craig goble
<p>Each resource in Kubernetes is described by some specification. You can find the detailed  spec for the resources in the documentation, for example here <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/</a>. If you navigate to the <code>Pod</code> definition (<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#pod-v1-core" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#pod-v1-core</a>) you will see all the properties of the <code>Pod</code> type with their underlying types.</p>
<p>For example, your first point, reading the <code>PodSpec</code> (<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#podspec-v1-core" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#podspec-v1-core</a>) you can see that the <code>nodeName</code> property holds the name of a node that should be used to schedule the pod.</p>
<p>Same documentation can be reviewed from the <code>kubectl</code> command. To get the documentation for <code>PodSpec</code> you can just type <code>kubectl explain pod.spec</code></p>
