<p>We have a k8s cluster with 10 workers. we run hundreds of pods in the cluster. we want to avoid running pods with default service account.
Need to find out the pods that are running with default service account. am able to find the number of pods using default service account with grep command but also need the pod name and the image it is using. Let us know your thoughts</p>

<ul>
<li>In Case if you want to use just kubectl without jq :</li>
</ul>
<p>needed to print both namespace and the pod name</p>
<pre><code>kubectl get pods --all-namespaces -o jsonpath='{range .items[?(@.spec.serviceAccountName == &quot;default&quot;)]}{.metadata.namespace} {.metadata.name}{&quot;\n&quot;}{end}' 2&gt;/dev/null
</code></pre>
<ul>
<li>i have added 2&gt;/dev/null to avoid printing whole json template in case if no field was found</li>
</ul>
