-
Notifications
You must be signed in to change notification settings - Fork 229
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
Clarification around variable handling in new Fleet project #2929
Comments
As a concrete example of something that is simple in my head but apparently difficult to implement, I have two sets of files as follows:
The above works fine. Then I try and do the same thing in the root of the repository, :
This fails with My eventual goal is to have the entire config in a single configmap with nesting so that I can use |
try quote the values |
Thanks a ton @skanakal that resolved the error! But it raises a few more questions:
|
The helm values templating is documented here: https://fleet.rancher.io/ref-fleet-yaml#templating Values are processed in different stages of the lifecycle: https://fleet.rancher.io/ref-bundle-stages
|
I added documentation to https://fleet.rancher.io/ref-fleet-yaml#values |
I'm running into a lot of confusion while trying to handle variables in a gitops repo with the following structure:
The repo consists of a mixture of external Helm charts for products like EMQX, InfluxDB, Traefik, etc., and our own code deployed as Helm charts like frontend, backend, embedded, etc. The infrastructure will be deployed to multiple different clusters, and I need to be able to define different config for each cluster. I want to eventually use external-secrets with the
aws-ssm-secret.yaml
file (which is in.gitignore
and not checked in to the repo) to dynamically pull secrets from AWS SSM Parameter store to configure each target cluster without storing any secrets in git. For this reason I want to keep the repo as DRY as possible, so for example the EMQX config required in multiple locations below should reference a single location for configuration:I have been struggling to understand how I can define values like
1883
,emqx_user
andemqx_s3cret
in one central location and have the various bundle dirs access that value. I've read #671 and #1164 and documentation and fleet-examples repo exhaustively but I still cannot understand what the intended approach is here given the architecture of Fleet. Should I:values.yaml
key, store the entire config for all apps in it as a block, and read it in each bundle withvaluesFrom
?helm.values
in the top-levelfleet.yaml
file and read the values from here into sub-levelfleet.yaml
files withhelm.values.emqx.username: ${ .Values.emqx.username }
?targetCustomizations
to do the same thing? I would like to avoid spreading targetCustomizations across many files if possible, to reduce maintenance burden when e.g. adding a new target clusterbackend/templates/configmap.yaml
, declarehelm.values
in the relevantfleet.yaml
and access values withGW_EMQX_CLIENT_USERNAME: {{ .Values.emqx.username }}
?spec.templateValues
at the cluster level (how??) and access them with${ get .ClusterValues "emqx.username" }
? Or do something similar with labels/annotations as described here?I would greatly appreciate more extensive documentation and an example of how to handle sharing values in the fleet-examples repo, as it was very helpful to get started with Fleet but is lacking for a beginner when attempting anything slightly more complicated.
More generally, does the structure of the repo above look logical, or have I created more problems for myself with this structure? Is it normal to have so many
fleet.yaml
files at all levels, or have I misunderstood something about how Bundles are created? Would it be possible/better to have only onefleet.yaml
file at the base level and somehow have it configure everything else as Helm subcharts?Thanks for any help, I tried asking on Rancher Slack first but didn't receive any response there, so trying here.
The text was updated successfully, but these errors were encountered: