Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use with SOPS? #3

Open
highb opened this issue Mar 30, 2022 · 2 comments
Open

How to use with SOPS? #3

highb opened this issue Mar 30, 2022 · 2 comments

Comments

@highb
Copy link

highb commented Mar 30, 2022

Hi there @jessesuen ! Thanks for providing this interesting ArgoCD pattern. I'm trying to make use of it in my own CD experiment that uses SOPS for secrets encryption. I have a secret file that is encrypted with SOPS and called as a resource using Kustomize. When I follow the pattern outlined in this repo and get my "rendered YAML branches", I've found that the SOPS doesn't know what to do with it because the whole file wasn't encrypted originally with SOPS, only one YAML document in the big all.yaml file.

Do you have any workarounds for this? Is there something I'm missing about how SOPS should be used in this context?

@highb
Copy link
Author

highb commented Mar 30, 2022

The workaround I've thought of is to use a different tool such as Vault or sealed-secrets that do the decryption on the cluster itself. Perhaps that the way to go.

@jessesuen
Copy link
Member

The workaround I've thought of is to use a different tool such as Vault or sealed-secrets that do the decryption on the cluster itself. Perhaps that the way to go.

Right. This technique won't work for SOPS, or any technique which results in the decrypted/sensitive secrets being stored in the branch in plaintext for all to see.

It will only work if the decryption or fetch of the secret happens in-cluster. Some tools which do this are:

Another possibility that will allow you to use SOPS, is to still use an env/prod branch, but instead of containing rendered YAML, it is an actual mirrored branch of main. argo-cd would still perform the templating since the Application path would point to a kustomize base under env/prod.

Pros:

  • retain the benefit of shielding prod from changes to the common base (since prod points to a different branch)
  • can use SOPSs

Cons:

  • upgrading kustomize in argo-cd is still risky
  • lose the benefit of a readable diff of manifest changes (since it is obfuscated behind kustomize build)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants