<p>I have the <code>kubectl</code> to delete 1 secret:</p>
<pre><code>kubectl delete -n my_name_space secret secret_name
</code></pre>
<p>If I want to delete all secrets of type <code>my_type</code> how can I do that?</p>
<p>Also how can I add filter to delete secrets older than 3 days?</p>

Slava
<p>In order to get secrets of a particular type, you can use <code>--field-selector</code>. Here, is an example:</p>
<pre><code>kubectl get secret --all-namespaces --field-selector type=Opaque   
</code></pre>
<p>For deleting resources older than x days, please check this thread.
<a href="https://stackoverflow.com/questions/48934491/kubernetes-how-to-delete-pods-based-on-age-creation-time">Kubernetes: How to delete PODs based on age/creation time</a></p>
