Support spawning containers through Kubernetes API
See original GitHub issueFeature Suggestion
Hello all. At my place we’ve been looking into using backstage and have just bumped into something (sorry if this has been discussed before).
Several plugins (eg techdocs and the scaffolder) work by spawning external processes, with the choice of running either locally or with Docker. Running locally is fine in development but it’s not ideal if your API server gets OOM-killed because techdocs had a lot of work to do; running in Docker is better in principle, but because Backstage talks directly to the Docker agent, it’s not ideal if you’re running in a modern cloud environment (ie Kubernetes). The API server would have to be run as a privileged container which is a security nightmare.
What would be nice is if it also supported spawning these subprocesses by talking to the Kubernetes API. This would obviously be a complicated thing to implement, but would bring it in line with how other things are typically run nowadays.
Possible Implementation
An implementation might create a Job
in a given cluster and namespace that runs the subcommand, and watches until the job is complete, then doing whatever final necessary steps.
A significant complication is with storage - the current implementation uses Docker mounts to extract file output. Doing the equivalent with k8s storage APIs will involve code gymnastics of some sort.
Maybe this would also present an opportunity to centralise the ‘runner’ functionality (which is largely duplicated between different plugins at the moment AFAICT - eg, here and here)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:6 (5 by maintainers)
Top GitHub Comments
Just saw @taras raise a similar suggestion here for running in other backends https://github.com/backstage/backstage/issues/3708
@tragiclifestories yep. closing this in favour of #3746