How to check in secrets in Git

Since you want to check in some secrets in your Git repository as a DevOps approach. However, you don’t want to have a security issue with storing them in plaintext or just linux encoded. Therefore you can encrypt the whole Secret with seal. Consider that just the cluster where the sealSecret-controller is installed can decrypt it. Also you have to store it in the correct namespace

oc create secret generic my-secret-name \
  --from-literal=git-token='<TOKEN-HERE>' \
  --dry-run=client -o yaml \
  -n target-namespace | kubeseal -w my-secret-name.yaml \
  --controller-namespace operator-sealed-secrets \
  --controller-name sealed-secrets-controller \
  -o yaml \
  -n target-namespace
  
# Customize:
# my-secret-name -> Name of the secret
# git-token -> Name of the key
# <TOKEN-HERE> -> Value for the key above
# target-namespace -> your namespace where the secret should be stored
# my-secret-name.yaml -> local file name where the secret is stored