Delete SSL certificate in Kubernetes

Viewed 3506

Trying to delete an SSL certificate with:

kubectl delete cert mywebsite-tls

Or it's secret, with:

kubectl delete secret mywebsite-tls

Just causes them to be 'respawned' again:

NAME                  READY   SECRET                AGE
mywebsite-tls         False   mywebsite-tls         3s # <--- not desired

How can I actually delete this permanently? Alternatively, how can I force it to be re-issued?

This setup is on DigitalOcean and follows this guide using cert-manager if it helps.

2 Answers

Had the same problem for a while.

For me it was because I use the ingress-shim.

Check and see if you have an ingress with

spec.tls.secretName

Have you tried adding the namespace parameter?

$ kubectl delete cert mywebsite-tls -n <cert_namespace>
Related