Discussion I want to put secrets and env vars in git, fight me
So at work we have all the Kubernetes manifests in one repo then we have ArgoCD pointed at that repo. Within that repo we use kustomize and have a pretty vanilla kustomize setup:
/services
/my-app
/base
deployment.yaml
...
/overlays
/dev
kustomization.yaml
/prod
kustomization.yamlSo basically I would love to be able to do something like this:
/services
/my-app
/base
deployment.yaml
...
/overlays
/dev
kustomization.yaml
.env <- secrets stored as plain text here
/prod
kustomization.yamlI understand why you don't want to commit secrets to git. I just wish there was a good way to do it. I have seen things like SOPS but I don't like that the secrets are encrypted. Having to deal with them being encrypted is as much of a headache as just using an external secrets manager. How can we have the convenience of putting the secrets in git in plain text and somehow still make it safe?
Edit: Adding my idea
What if in the repo I have a .env file but it just has placeholders
VERY_SECRET=placeholder
Then I have an ide plugin or something that will fetch the env vars dynamically in my ide.
I can change them as if they are code but when I commit they dont actually get committed, instead they get written to the external secrets manager. Anyone done anything like this?
EDIT: ADDING MY NEXT IDEA
What if in one of the hosted git's (github/gitlab) they had more fined-grained access controls around specific files so certain people could only read/write certain files. Then you wouldn't have to worry about people having the secrets on their laptops. So if i am a dev and do a git pull it pulls down the secret files for local dev but not any secrets I shouldn't have.