OpenShift - Deleting Secrets using the oc delete secret command

by
Jeremy Canfield |
Updated: October 21 2020
| OpenShift articles
If you are not familiar with the oc command, refer to OpenShift - Getting Started with the oc command.
Before you can use the oc delete secret command, you must first use the oc login command to login, and also use the oc project command to select the project that contains the secrets.
You may also want to use the oc get secrets command to display the secrets that have already been created.
oc get secrets
NAME TYPE DATA AGE
mysecret1 Opaque 1 133d
mysecret2 Opaque 1 133d
mysecret3 Opaque 1 127d
The oc delete secret command followed by the name of a secret can be used to delete a secret.
oc delete secret mysecret1
If the secret is successfully deleted, the following will be displayed.
secret "mysecret1" deleted
Did you find this article helpful?
If so, consider buying me a coffee over at