Create and Manage Secrets¶
Let's see how we can create and manage Secrets.
Step 1: Create a Secret¶
Apply the manifest to create the Secret:
Step 2: List Secrets¶
Resource types are case-insensitive and you can specify the singular, plural, or abbreviated forms.
The following commands produce the same output:
Step 3: Describe a Secret¶
# Command template
kubectl describe secret <secret-name>
{OR}
kubectl describe secret/<secret-name>
# Actual command
kubectl describe secret my-secret
{OR}
kubectl describe secret/my-secret
Step 4: Delete a Secret¶
# Command template
kubectl delete secret <secret-name>
{OR}
kubectl delete secret/<secret-name>
# Actual command
kubectl delete secret my-secret
{OR}
kubectl delete secret/my-secret
You can also use the manifest to delete the resource as follows: