Kubernetes

How to commit secrets to Git and in general how to use encrypted secrets?

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

One possible process would be as follows:

  1. You create a Kubernetes secret (but don't commit it)
  2. You encrypt it using some 3rd party project (.e.g kubeseal)
  3. You apply the seald/encrypted secret
  4. You commit the the sealed secret to Git
  5. You deploy an application that requires the secret and it can be automatically decrypted by using for example a Bitnami Sealed secrets controller