DevOps(Day-45) : Mastering Secrets in Kubernetes

  

  • Secrets

  • Task : Secrets in K8s

Secrets are Kubernetes objects intended for storing a small amount of sensitive data. It is worth noting that Secrets are stored base64-encoded within Kubernetes, so they are not wildly secure.

To create the Secret, choose a password and convert it to base64 as shown in below example:

    1. Create a secret.yml file which includes the base64 encoded password.

    2. To add the password in the above file you need to generate the base64 encoded password.

    3. Now you can save and run the secret.yml file.

    4. Now, change the deployment.yml file to include the configuration of the secret in the deployment.

    5. Now run the deployment file and check the status of the deployment and the secret.

    6. Check the detailed view of secretly created in K8s using describe command.

    7. Now check the running pods and navigate to a POD to view the environment variable.

      Thanks for reading my article. Have a nice day

Comments

Popular posts from this blog

DevOps(Day-97): Meta-Arguments in Terraform

DevOps(Day-95): Auto Scaling with Terraform

DevOps (Day-1) Introduction