There isn’t currently a way to do this, via envvars or not, for a balenaCloud application, as the Supervisor API only supports the starting/stopping/restarting of entire applications rather then the container, instead of disabling specific services. We don’t expose the balenaEngine socket to any containers, so unfortunately you also can’t do it manually.
There is a way to do this if you’re using local mode (ie. for development), which is to use the state endpoints of the Supervisor to post a new state (and you’d remove the relevant service containers from your newly POSTed state to stop them from being run). The local mode endpoints are documented here although as it notes, they’re not intended for general use.
That said, we do have have several customers that do something similar, but they carry out inter-service communication at initialisation to determine which services should continue to run or which should just stop. This doesn’t stop the service containers from being started, but does mean they don’t execute their function.
I’m going to raise an internal issue to moot the prospect of service disabling, but this does carry with it several architectural questions (for example, what to do in the event of a new release of an application).
Thanks so much for the fast responses. I’ll use the supervisor API route – I already have a service that can act as an orchestrator for the other services, and I can drive its behaviour using ENV vars.
This is a fantastic platform and toolset. The more I use it, the more impressed I am.
Thanks Peter, we constantly try to reduce the friction to do edge computing, so you can focus on more important things. Hope it works well for you, feel free to get back to us if you need any additional help.