I want a set of apps to use a specific range of ports and the rest of the apps to use another range
On mesos-agent I've set: --resources="ports(*):[8000-9000, 31000-32000]"
I want to spawn 100 × APP1 and use BRIDGE network with hostPorts in portbindings from range 8000-9000
and the rest of apps (APP2,APP3,...APPN) to use range 31000-32000
.
Is it possible?
Right now APP2,3 ... APPN can take ports from range 8000-9000
, which for me is not desirable.
UPDATE: I created a role for the resource port range 8000-9000
(static reservation). Checked in the mesos-master:5050/slaves
and it seems to be ok
"reserved_resources": {
"app1": {
"disk": 0.0,
"mem": 0.0,
"gpus": 0.0,
"cpus": 0.0,
"ports": "[8000-9000]"
}
}
and
"reserved_resources_full": {
"app1": [{
"name": "ports",
"type": "RANGES",
"ranges": {
"range": [{
"begin": 8000,
"end": 9000
}]
},
"role": "app1",
"reservations": [{
"type": "STATIC",
"role": "app1"
}]
}]
}
it was also assigning zero to disk, mem etc. don't know why it's acting like this. In marathon I've added:
"acceptedResourceRoles": [
"app1"
]
But it didn't deploy the app. I've put marathon logging into trace:
Considering resources with roles {app1} without resident reservation labels. Not all basic resources satisfied: cpus NOT SATISFIED (0.1 > 0.0), mem NOT SATISFIED (512.0 > 0.0) (mesosphere.mesos.ResourceMatcher$:marathon-akka.actor.default-dispatcher-33)
I then modified:
"acceptedResourceRoles": [
"app1",
"*"
]
And now it says:
Considering resources with roles {app1, *} without resident reservation labels. Cannot find range with host port 8111 for run spec
There is nothing in the docs regarding resident reservation labels
. There is reservation labels
but it doesn't say how to create or add a label or just a small example. For roles there is something linked to ACLs but very fuzzy and it seems to get into users and permissions, not what resourse reservation is about.