Skip to main content

Posts

Showing posts from August 11, 2020

K8s Secrets Explained.

 What is Secrets in K8s? Secrets are used to store sensitive information like Authentication Token, Passwords, SSH Keys and  Certificates. It is stored in etcd, datastore of k8s. The main advantage of the secret is that it can be updated dynamically , so if we want to change the username or password or ssh key of any of the containers inside the pod, then just changing the secret will dynamically update the existing and newely created POD's env values and ssh-key (mount as volume) . jinojosep@cloudshell:~ (boreal-physics-256910)$ kubectl create secret generic secret-demo --from-literal=username=jinouname --from-literal=password=jinomypassword secret/secret-demo created ################################ jinojosep@cloudshell:~ (boreal-physics-256910)$ kg secret NAME                  TYPE                                  DATA   AGE default-token-l5tmg   kubernetes.io/service-account-token   3      14m secret-demo           Opaque                                2      8s ###############