I have more than 4000 pvc in my kubernetes aws eks cluster.
From those 4000+ pvc I have to delete almost 3999 pvcs and not delete like 30 pvc.
I will be using the command:
kubectl delete pvc --field-selector metadata.name!=<name not to delete>
to test before I will be using
kubectl get pvc --field-selector metadata.name!=<name not to delete>
- now when i use the command and add the pvc name of only ONE PVC in place of "name not to delete" the command works.. but when I add another pvc name rather than ONE like "kubectl get pvc --field-selector metadata.name!=pvc1 pvc2" .. it does NOT work
as I mentioned I do not want to delete 30 pvc but the rest 4000 I do want to delete... so I need to add those 30 pvc in front of the command. So I need help regarding that.
- Now I also want to try to select resources in bacth by LABELS of AGE.. I only want to select pvc which are more than 2 days old.. how do I do that?