<p>Example : I would like to get all namespaces which are running more than 3 days. I have already sorted my namespaces by label and creation timestamp with help of this command:
<em><strong>kubectl get namespaces -l provisioner=foo --sort-by=.metadata.creationTimestamp</strong></em></p>

Danil Savchenko
<p>If you could use <code>shell/bash</code>:</p>
<pre><code>kubectl get ns -o jsonpath='{range .items[*]}{.metadata.name} {.metadata.creationTimestamp}{&quot;\n&quot;}{end}' | while read -r name timestamp; do
        echo &quot;$name&quot; | awk -v current_time=$(date +%s) -v three_days_back=$(date +%s -d &quot;3 day ago&quot;) -v ns_time=$(date --date=&quot;${timestamp}&quot; +%s) '(current_time - ns_time) &gt;(current_time - three_days_back){print $0}';
done
</code></pre>
