-
Notifications
You must be signed in to change notification settings - Fork 2
Map
subutai map <protocol> -i|--internal <socket> -e|--external [RH port] -d|--domain [domain name] -c|--cert [path] -p|--policy [balance method] [-r|--remove]
- create port mapping
Options:
protocol - specifies required protocol for mapping and might be http, https, tcp or udp.
-i|--internal - peer's internal socket that should be exposed. Format should be <ip>:<port>
-e|--external - optional parameter which shows desired RH socket where internal socket should be mapped. If more than one container mapped to one RH port, those containers are being put to the same backend group. Allowed port value must be in range of 1000-65535
-d|--domain - should be only specified for http and https protocols mapping
-c|--cert - path to SSL pem certificate for https protocol
-p|--policy - balancing methods (round-robin by default, least_time, hash, ip_hash)
-l|--list - list mapped ports
-r|--remove - optional flags shows that specified mapping should be removed. If not set, "add" operation is assumed
Examples:
map container's 172.16.31.3 port 3306 to the random port on RH
subutai map tcp -i 172.16.31.3:3306
192.168.0.1:46558
add 172.16.31.4:3306 to the same group
subutai map tcp -i 172.16.31.4:3306 -e 46558
192.168.0.1:46558
remove container 172.16.31.3 from mapping
subutai map tcp -i 172.16.31.3:3306 -e 46558 -r
map 172.16.25.12:80 to RH's 8080 with domain name example.com
subutai map http -i 172.16.25.12:80 -e 8080 -d example.com
192.168.0.1:8080
add container to existing example.com domain
subutai map http -i 172.16.25.13:80 -e 8080 -d example.com
192.168.0.1:8080
list existing mappings
subutai map -l
tcp 0.0.0.0:46558 172.16.31.4:3306
http 0.0.0.0:8080 172.16.25.12:80 example.com
http 0.0.0.0:8080 172.16.25.13:80 example.com
Description:
As a result, external socket and exit code 0 will be returned if command succeeded, otherwise exit code will be 1. When desired RH port is not specified, random free port is being assigned automatically.
note: partially, new binding overlaps with subutai proxy command, but in sake of compatibility we should keep both of them for a while