You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flux currently lacks first-class support for SOPS-encrypted secret decryption in Helm charts. If, for example, I wanted to load a Helm chart via a HelmRelease into my cluster and have it create some Kubernetes secrets from encrypted secrets stored in the Helm chart itself, the solutions available as I understand are:
Approach 1 ends up being slightly messy in a multi-cluster, multi-tenant scenario. Where Flux is used from a single centralised repo to pull application repos via HelmRelease resources and GitRepository sources, it becomes necessary to either:
Add the secret-generating Kustomization to the same repo storing the Helm chart code, which has the disadvantages of:
substantially increasing manifest boilerplate (e.g for each environment, kustomization.yaml, flux-ks.yaml, kustomizeconfig.yaml)
reducing local testability (since the Flux Kustomization is a CRD, it becomes cumbersome to use tools like Minikube without creating a local Flux installation)
Centralise all secret management in the centralised repo
e.g. apps/$app/overlays/$cluster/$env/{secret.enc,kustomization,kustomizeconfig,hr}.yaml
which is fairly untenable in a multi-cluster, multi-tenancy scenario in which we wish to decentralise as much workload-specific configuration as possible).
Approach 2 is feasible, but comes with its own disadvantages, which are covered fairly well in the Flux documentation on this topic.
Related issues
This issue has been raised in the past and discussed elsewhere online:
This question has been partly answered in fluxcd/flux2#4075. We have no plan to implement it ourselves this year.
About the feature itself, I think it is an acceptable one, but the decryption and values merging should all be done by the helm-controller, as it should support all the sources types (we are adding ociRepository as a source).
As I understood @davejbax is ready to implement this feature ownself. And I completely agree with his arguments.
For our company, this is a big limitation for migrating to flux, because we have a lot of helm charts in monorepo and almost every chart has the following structure:
Problem
Flux currently lacks first-class support for SOPS-encrypted secret decryption in Helm charts. If, for example, I wanted to load a Helm chart via a
HelmRelease
into my cluster and have it create some Kubernetes secrets from encrypted secrets stored in the Helm chart itself, the solutions available as I understand are:Approach 1 ends up being slightly messy in a multi-cluster, multi-tenant scenario. Where Flux is used from a single centralised repo to pull application repos via
HelmRelease
resources andGitRepository
sources, it becomes necessary to either:apps/$app/overlays/$cluster/$env/{secret.enc,kustomization,kustomizeconfig,hr}.yaml
Approach 2 is feasible, but comes with its own disadvantages, which are covered fairly well in the Flux documentation on this topic.
Related issues
This issue has been raised in the past and discussed elsewhere online:
Proposal
I'd like to propose a cleaner solution for handling this case:
HelmRelease
, named something such asvaluesFilesEncrypted
The ostensible benefits of this approach would be:
I'm happy to open a PR to implement the above, if the maintainers believe it is an acceptable idea to implement.
The text was updated successfully, but these errors were encountered: