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>
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.
You can try
kubectl get pvc --field-selector metadata.name!=pvc1,metadata.name!=pvc2
See https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#get