Commands related to Kubernetes Secrets
Enter the command to create a Secrets using –from-literal flag:
kubectl create secret generic [NAME] --from-literal=username=myName --from-literal=password=myPassword
Enter the command to creating a Secret from a configuration file:
kubectl apply -f [SECRET_FILE_NAME]
Enter the command to get the list of Secrets in the cluster:
kubectl get secrets
Enter the command to get additional information about a Secret:
kubectl describe secret [NAME]
Enter the command to delete a Secret:
kubectl delete secret [NAME]
How To Use Kubernetes Secrets As Files In Containers ?
Secrets are Objects in Kubernetes that are used to store the data and credentials that we would not want to share with others. Secret is a Kubernetes component just like Configmap but the difference is that it’s used to store secret data credentials and it stores this data not a plain text format but in base64 encoded format. In this article, we will see a brief introduction to Kubernetes Secrets and a tutorial on How to use Kubernetes Secrets as files in containers.