-
Notifications
You must be signed in to change notification settings - Fork 193
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
SOPS: Decryption does not work for envs in secretGenerator #1271
Comments
Do you have .sops.yaml in the root of the repo? creation_rules:
- path_regex: podinfo.env
key_groups:
- age:
- age1qwer1234 # Your key goes here |
Yes and the encrypted podinfo.env file looks good to me. When I replace |
We do look for the envs files here:
--input-type=env to the sops encrypt command.
|
I actually already tried both Here's what my file looks like:
|
@Do-min-ik your code works fine for me, I do not have any issues with encrypted secret data. |
Yup, the example provided does indeed work. The culprit is actually my "pre-processing". Instead of the actual files I'm calling |
There used to be the following comment in kustomization_controller.go: I'm pretty new to Go but I guess this is the reason why my "pre-processed" output doesn't work. At this point my |
This cannot work since the SOPS metadata is not present in the final secret for env files. You either let Flux build the secrets or you encrypt the Kubernetes secret yaml after you build it with kustomize. |
Yes, that's what I meant. Closing this now because it's not a problem with Fluxcd but rather wrong usage. |
Description
I'm trying to use SOPS to replace plaintext secrets in my .env files with encrypted ones. However, I can't get fluxcd to actually decrypt
Secret
s generated bysecretGenerator
andenvs
.Example
I'm using the example from #463:
Create an env file:
Encrypt it with SOPS:
Create a kustomization.yaml that generates an env secret:
Configure Flux to decrypt the secret before apply:
Expected behavior:
secrets
contains the unencrypted values of ROUTER_PASSWORD and DB_PASSWORDActual behavior:
secrets
is actually still encrypted and contains SOPS infoVersion
I first encountered this behavior in version 2.3.0 but have since upgraded to version 2.4.0.
The text was updated successfully, but these errors were encountered: