I have a project that I have developed that uses custom device/fleet variables as it configuration. I want to deploy this project at multiple locations. For example, I may need 25 devices at location A, 15 devices at location B, etc. Each location with need to have different values set for the variables. Is there an easy way to manage this so that:
- I only have one code base/fleet
- Can easily set the release version based on the location, and
- Be able to easily manage the variable values set for each location?
I know I can achieve 1) and 2) fairly easily, by applying custom tags to each device. For example, I can add the tag location
and assign values of A
, B
, C
, … I can then filter on those tags and set separate release versions for each location, but can I then easily set separate variables for each location? The only way I have seen this can be done is to set them one at a time on the device level, but this isn’t practical for a large fleet. I really need a way to set them at the custom tag level.
Can this be done? If not is their some other way I can structure things? For example, I could have multiple fleets, one for each location, but then I can potentially have a different code base in each fleet. Is there a way to easily keep all of the fleets in sync with all of the same releases, etc?
Any guidance on how to manage this is greatly appreciated.
Hello, tags do seem to fit your use case. You can select multiple devices in the “device summary” page and set all their tags at once. If you have the tag set for a location, do you also need to set a variable as well? You can access the tags and their values using the balena API: Resources - Balena Documentation
I appreciate it’s hard to see at this point, but it sounds like this functionality (and the linked single/multi app) will help here: Enable staged rollouts of releases across devices · Balena Roadmap
The installable apps work will allow you to use fleets as an organizational unit whilst keeping your code base held in an app and the same across all fleets. cc @rahul-thakoor
Thank you for the reply @alanb128 . You mention the following:
I can easily select multiple devices, but I don’t see where I can then set all of their tags at one. Once the devices are selected where do you go to be able to set the tags?
Thank you @chrisys for the suggestion. I did see the Apps portion of the dashboard and that does seem to be the most promising, but the ability to deploy to fleets does not seem to be implemented yet, Do you know when this feature will be available?
After selecting one or more devices, click the “Modify” button, scroll towards the bottom of the drop down list and select “manage tags”.
Sorry I misspoke in my last message. I need to set the device variable, not the device tags. Sorry for the confusion. So that page allows me to edit the tags but sadly not the device variables.
Aside from updating them one by one, is the balena API the only other way to do this currently?
@derekseiple we’re actively working on it but I can’t give an idea of timeframes unfortunately - it’s quite a large project needing changes across a lot of significant chunks of the platform so a lot to orchestrate, but we are making progress.
You’re right though, there isn’t a way to make bulk changes to device variables short of using the API. I think there probably should be, and I see you already found and upvoted the roadmap item which is the best thing to do right now.
Thank you for all the feedback. I will keep an eye on the progress of the Apps feature.