Reputation: 1643
I ran:
kubectl api-resources | grep "External"
externalmetrics metrics.aws true ExternalMetric
I want to delete this metrics.aws
API resource, but I am not even sure how it was deployed. How can I delete this safely?
Upvotes: 11
Views: 12032
Reputation: 3284
kubectl get crds | grep externalmetrics
kubectl get externalmetrics
kubectl delete externalmetrics --all
kubectl delete crd externalmetrics
kubectl api-resources
Update:
If you see error: the server doesn't have a resource type "v1beta1"
error then run the following command to remove it:
kubectl delete apiservice v1beta1.metrics.k8s.io
Upvotes: 15
Reputation: 1
I had a similar issue; I wanted to completely remove PodSecurityPolicy, which was added when installing a kube-prometheus chart.
podsecuritypolicies psp policy/v1beta1 false PodSecurityPolicy
This worked for me:
kubectl get apiservices.apiregistration.k8s.io
-> this returns the list.
kubectl delete apiservice v1beta1.policy
-> this deletes it.
Upvotes: 0