Apologies in advance for how long this will be...
Ok. Let's start here. Given the way docker networking works, I don't think this is actually possible. Docker is powerful, but it does complicate things from time to time, particularly with docker networking. I've found that it cannot truly emulate segregated environments. It's usually good enough and I think you can do what you want but since those servers are all in the blue network, any ports you expose are going to be accessible from any other server in the blue network. So I don't think you'll want them in the blue network. Are you sure you want them in one network?
If we take a step back instead and just focus on the goal:
You can accomplish this with the existing docker compose environment, just by having more than one identity. I think that's how I'd recommend you start out. After you get that working, the next stop imo will be to remove your containers from the blue network and segregate them from one another, but that'll be after you get your feet under you OpenZiti-wise...
So here's what I recommend:
- update your docker compose file with the "extra servers" in both the red and blue networks
- create new identities in the ZAC or using the ziti CLI
- authorize the blue router (
ziti-private-blue
) to offload ALL "admin" services
- authorize the red router (
ziti-private-red
) to offload "Staff" services
- authorize whichever users you want to access whichever services you want
So in practicality that would be something like this - i hope this makes sense (after updating your compose file):
- deploy your web servers in the 'admin' network and for every 'admin' server you deploy, create an OpenZIti service and assign that service an attribute of "admin-service"
- deploy your web servers in the 'staff' network and for every 'staff' server you deploy, create an OpenZIti service and assign that service an attribute of "staff-service"
For example, with the ziti cli that would look something like this. Step 1 make services with the "admin" or "staff" attributes....
(These are not full and complete samples... If you get lost and feel like you want/need it, I could make a video that does more educating around this topic... )
ziti edge create service admin-service-1 --configs "admin.intercept.config-1,admin.host.config-1" -a "admin-service"
ziti edge create service staff-service-1 --configs "staff.intercept.config-1,staff.host.confg-1" -a "staff-service"
Now you have services (and presumably configs), now you authorize those services. Give the routers access to 'bind' (or host) the services:
ziti edge create service-policy admin-bind-policy Bind --identity-roles '@ziti-private-blue' --service-roles "#admin-service"
ziti edge create service-policy staff-bind-policy Bind --identity-roles '@ziti-private-red' --service-roles "#staff-service"
Now, authorize the specific users to access specific services:
ziti edge create service-policy admin-1-dial Dial --identity-roles '@some-admin-user' --service-roles "@admin-service-1"
ziti edge create service-policy staff-1-dial Dial --identity-roles '@some-staff-user' --service-roles "@staff-service-1"
I hope all that helps, I hope it all makes sense. If it's too long or too dense, let us know and we can try to clear anything up.