Understanding the space constraint

I’m looking through one of the examples in juju help deploy and am slightly confused.

Deploy to a machine that is in the ‘dmz’ network space, but not in either the ‘cms’ nor the ‘database’ spaces:

juju deploy haproxy -n 2 --constraints spaces=dmz,^cms,^database

I see the intent… but… are the “negative” constraints redundant? That is, “^cms” and “^database” should not be required here. If it I have specified the “dmz” space, is it possible for units of the application to somehow slip into other spaces?

1 Like

Yes, a machine can be on multiple networks. Here we’re saying the two resulting machines must be on one network but not on two other networks.

Ah of course, that makes sense. Thanks for resolving this for me :slight_smile: