nanovms / ops-examples

A repository of basic and advanced examples using Ops
109 stars 29 forks source link

Multi Binaries #81

Closed ioneyed closed 2 years ago

ioneyed commented 2 years ago

There is some desire to be able to bind sidecar applications to your code such as Kuma.io or Kong API Gateway (declarative with plugins filtering requests) or even OPA agents running locally to the binary.

Is there an example of combining 2 binaries into a single unikernal?

eyberg commented 2 years ago

no

but you can either add the code to the application individually such as a plugin or library or you could run a klib (which adds the code independently of the application and doesn't require modification to the presumably many apps in question - if there is enough interest reach out on drift via nanovms.com)

however, taking a look at kuma - sidecar functionality like this is really k8s/containers centric, there might be much better ways of achieving the same goal (be it mtls, routing, or tracing) that doesn't involve the sidecar pattern, keep in mind that in the vast majority of unikernel deploys you are operating at the lower vm layer and not at an overlay layer so there is a ton of tooling that already exists there

ioneyed commented 2 years ago

Right, but kuma.io has a VM option that should run within the unikernal to bundle the agent with the codebase. Although those were examples I could see sidecar-like capabilities where you have multiple binaries (not libraries) that are started up by default.

ioneyed commented 2 years ago

Other things that could be interesting is a localhost (in unikernal) shard on a redis cluster or other distributed systems that your application could call out to a shard instead of the main cluster so that your deployable is more self-contained than requiring all the shared infrastructure (grafana/prometheus collectors/etc.)

All of these are just a thought of an example that allow additional binaries to be embedded and started in the unikernal outside of the primary app.

eyberg commented 2 years ago

nanos is and will always be single process only; you can put this functionality into a plug in or a klib but we will never support multiple processes in nanos - if you need that functionality just keep using linux

ioneyed commented 2 years ago

Fair enough, just seeing some of the corporate required monitoring/operations tools like Dynatrace Agents, Kuma, etc it could lead to more adoption.