air-gapped deployment, service variables

Hi! If I want to deploy a multi-container app to a device without cloud connection, is it possible to pass the Balena Cloud environment variables to the containers without declaring them directly in the compose file?

Hello @haronaut

did you try the offline updates? Offline updates - Balena Documentation

or preloading the services into the OS image and adding the device variables using balena CLI?

Thanks! I can set the variables via balena CLI.

@mpous Is there a possibility to push multiple variables all at once? I assume that every service is restarted as soon as I push a single variable.

Hello, did you check if this feature is what you need? Allow changes to variables to be batched and submitted all at once · Balena Roadmap

If this will also be available via balena cli then that’s exactly what I need.

Hi, as part of that feature, support is intended to be added in the SDK for allowing pushing multiple variable changes at once. The intention is to also have feature parity between the SDK and CLI so we should make it available in the CLI as well, although I don’t currently have an example of how this would look, nor do I have an ETA for the SDK and CLI support. I will bookmark this thread and come back to it to inform you once support for each has been added, though I advise keeping an eye on the roadmap for updates.

2 Likes

I can ensure you that it is indeed possible to pass balena cloud environment variables to containers without directly declaring them in the compose file. Balena cloud offers a feature called “device service variables” that enables you to define environment variables at the device level. These variables are then automatically passes to all containers running on the device.

1 Like