<p>I got admin rights on our cluster and I want to query the config yaml file which is deployed to the cluster, the file is already applied to the cluster and I want to query the file values of <code>networkPolicy</code> I mean <strong>all</strong> files with kind <code>kind: NetworkPolicy</code> , is it possible to do it from the <strong>terminal</strong> ?</p>

<p>In small cluster I can do 
<code>kubectl get deploy --all-namespaces -o yaml &gt; dep.yaml</code>
but in big cluster there is a lot of file/data ....</p>

Jenny M
<p>To get the YAML manifests of all NetworkPolicy resources in the cluster:</p>

<pre><code>kubectl get netpol --all-namespaces -o yaml
</code></pre>

<p>If you need only some of them, you can filter based on label values or field values with the <code>-l/--selector</code> and <code>--field-selector</code> options.</p>
