bastille icon indicating copy to clipboard operation
bastille copied to clipboard

[ENHANCEMENT] Convert containers to releases

Open jhfoo opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe. I'm thinking about using Bastille to support horizontal scaling; spinning up new containers of the same app to service increased traffic possibly load balanced via Consul.

Describe the solution you'd like Once a container is configured allow it to be converted into a release so future instances can be spun up as thin jails quickly.

Describe alternatives you've considered Thought about running templates to bare releases but stil too slow installing packages and all. Scaling is too slow.

Additional context

  1. Tried to do a soft link from a stopped jail to the releases/ folder. Bastille doesn't recognize the linked folder.

jhfoo avatar Feb 28 '23 03:02 jhfoo

I also have a similar requirement, which I could use for rolling deployments of apps. It would be nice to somehow have a kind of base-jail for other jails.

To base this feature on releases is perhaps a bit hard:

  • The base-jail jail is also based on a given FreeBSD Release. (base-jails based on releases?)
  • At the moment a thin jails uses nullfs to link the base directories. /usr/local space isn't linked. To allow user apps in child jails, the /usr/local should be a nullfs link?? (With all kinds of issues I guess)
  • I think a release based solution is pretty hard to implement

Alternative idea for this is using clones (assuming spawned childs jails/containers are disposable)

  • Use zfs clones to make an (temporary) instance of a base-jail. (The base-jail is kind of of a docker-image) Thanks to zfs clone, the jails is identical when created, and hardly consumes any space
  • The data that should survive between creations, should be put in the base-jail (or another location outside the jail) that can be linked with nullfs.
  • When updating the base-jail, you should create new temporary jail to base on this. (because clones don't get updated)

I don't know if @cedwards has any ideas (or plans) for this subject?

(Btw thank you very much for BastilleBSD, I really like it, and also the effort that has been put in this project!!)

gamecreature avatar Oct 12 '23 18:10 gamecreature

Cant the Bastille clone command be used to do something like this?

adriel-tech avatar Oct 13 '23 18:10 adriel-tech

Cant the Bastille clone command be used to do something like this?

Yeah I was thinking about that to. A 'zfs-clone' clone as an alternative option to the current copy (send/recv) clone.

(With clear warning it's a zfs clone. This is not usually what you want when copying a jail by default)

gamecreature avatar Oct 13 '23 18:10 gamecreature