Stacks? #94
Replies: 3 comments 6 replies
-
I'm glad you asked this. There is no such isolation as you described but the current design allows it to be introduced at some point and I've been thinking about it for a while. I didn't like how stacks are implemented in Docker Swarm and Compose, namely, how service names are prefixed with I was thinking of a namespace/environment/project concept similar to k8s/Render but decided to not complicate things from the very beginning. For now, there is only one namespace. If a service is called I believe we can introduce namespaces incrementally if we want to. For example, all the services created before the namespace feature was introduce could be assigned to the Regarding network isolation for stacks/workloads, IMO the Docker model with using multiple networks and assigning services/containers to them is quite coarse and not flexible enough as I'd like to have. So I decided to use the same approach Tailscale, Fly.io, k8s use, namely, one flat network for the cluster and provide the policy-based isolation on top of it. The network itself just provides the connectivity, and the policies (ACLs, security groups, what ever concept we come up with) can define the fine-grained permissions to isolate specific workloads. We can define reasonable default policies, e.g. to isolate namespaces or stacks from each other if we come up with a way to define stacks. But we don't support policies yet, and similarly to namespaces, they could be introduced in the future. That's my current thinking. Do you like the Docker Swarm stack design or can you think of an ideal design for you? |
Beta Was this translation helpful? Give feedback.
-
My use case is that I would:
|
Beta Was this translation helpful? Give feedback.
-
I prefer the way Docker uses multiple networks. Leveraging iptables/nft_tables on each host to isolate subnets based on network type feels pragmatic to me and these tools provide a ton of flexibility, I think. I like the idea of policy/ACL but it also feels like re-inventing the wheel when networking is something that uncloud (and docker) still has to deal with anyway. For instance, namespacing issues you discussed are already a solved problem for overlay/docker since dns/hosts is configured per subnet: Within the stack's own network each service, which needs a unique name, is addressable by that name only. Across attachable/overlay networks they can be addressed by project-service. For my own use case -- I heavily use overlay networks without using swarm deployments specifically. Birdseye:
The cognitive load is low once this is setup, for me. The And since all of this is "just" iptables it's easy for me to extend networking behavior without needing any explicit docker configuration: in addition to trafficjam I have pre-configured rules on each node that
Using uncloud with one, flat network would mean losing all of that implicit isolation, trafficjam, and my established rules that all leverage tried-and-tested tools already available on almost all linux distros. Or having to convert them to policies and hoping uncloud doesn't have any bugs in whatever wheel it reinvents to get feature parity with the existing tools. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Does the "stack" concept have place in uncloud?
Apps usually have more than a single component (say, an app + a DB), so a stack would provide a namespace for services (so StackA's
app
can calldb
to its DB service, and not clash with StackB'sdb
).Stacks may offer network isolation (ie, deploy services in stack-specific Docker network), and only expose services with
x-ports
to the Caddy server (using a globally shared network, or creating ad-hoc networks for eachCaddy<->exposed service
pair).If network isolation is implemented, there should also be ways to override it and allow connecting services from different stacks (just like in the Caddy example).
Beta Was this translation helpful? Give feedback.
All reactions