flux-envsubst
At jaconi, we frequently recommend Flux along with the
kustomize-controller to our customers. These two work great when using
GitOps! However, developers do not want to create pull requests during development. They use Kustomize locally and apply
the rendered Kubernetes manifests using kubectl
. That way, some functionality provided by Flux gets lost, leading to a
couple of problems. We created flux-envsubst to solve these problems.
You can find the source code and installation instructions at GitHub: https://github.com/jaconi-io/flux-envsubst.
Variable Substitution
Flux supports variable substitution.
This Flux feature is not supported by Kustomize. Flux suggests using Drone’s
envsubst for local development. However, envsubst does not respect the
kustomize.toolkit.fluxcd.io/substitute: disabled
annotation / label:
flux-envsubst
does, though:
SOPS
Flux supports SOPS while Kustomize does not:
flux-envsubst
ignores SOPS secrets
allowing local development without manually decrypting secrets (which might not even be possible without proper key
access).
.env Files
flux-envsubst
allows variable substitution from .env
files. When having a couple of variables, an .env
file makes
things a lot more readable.