Inroduce SWARM --data-path-addr flag

This new flag will allow the configuration of an interface that
can be used for data path traffic to be isolated from control
plane traffic. This flag is simply percolated down to libnetwork
and will be used by all the global scope drivers (today overlay)

Negative test added for invalid flag arguments

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
This commit is contained in:
Flavio Crisciani 2017-04-14 16:54:17 -07:00 committed by Tibor Vass
parent ba5a2dc787
commit 137a190a79
4 changed files with 24 additions and 2 deletions

View File

@ -3301,7 +3301,7 @@ _docker_swarm_init() {
case "$cur" in case "$cur" in
-*) -*)
COMPREPLY=( $( compgen -W "--advertise-addr --autolock --availability --cert-expiry --dispatcher-heartbeat --external-ca --force-new-cluster --help --listen-addr --max-snapshots --snapshot-interval --task-history-limit" -- "$cur" ) ) COMPREPLY=( $( compgen -W "--advertise-addr --data-path-addr --autolock --availability --cert-expiry --dispatcher-heartbeat --external-ca --force-new-cluster --help --listen-addr --max-snapshots --snapshot-interval --task-history-limit" -- "$cur" ) )
;; ;;
esac esac
} }
@ -3337,7 +3337,7 @@ _docker_swarm_join() {
case "$cur" in case "$cur" in
-*) -*)
COMPREPLY=( $( compgen -W "--advertise-addr --availability --help --listen-addr --token" -- "$cur" ) ) COMPREPLY=( $( compgen -W "--advertise-addr --data-path-addr --availability --help --listen-addr --token" -- "$cur" ) )
;; ;;
*:) *:)
COMPREPLY=( $( compgen -W "2377" -- "${cur##*:}" ) ) COMPREPLY=( $( compgen -W "2377" -- "${cur##*:}" ) )

View File

@ -2267,6 +2267,7 @@ __docker_swarm_subcommand() {
_arguments $(__docker_arguments) \ _arguments $(__docker_arguments) \
$opts_help \ $opts_help \
"($help)--advertise-addr=[Advertised address]:ip\:port: " \ "($help)--advertise-addr=[Advertised address]:ip\:port: " \
"($help)--data-path-addr=[Data path IP or interface]:ip " \
"($help)--autolock[Enable manager autolocking]" \ "($help)--autolock[Enable manager autolocking]" \
"($help)--availability=[Availability of the node]:availability:(active drain pause)" \ "($help)--availability=[Availability of the node]:availability:(active drain pause)" \
"($help)--cert-expiry=[Validity period for node certificates]:duration: " \ "($help)--cert-expiry=[Validity period for node certificates]:duration: " \
@ -2282,6 +2283,7 @@ __docker_swarm_subcommand() {
_arguments $(__docker_arguments) -A '-*' \ _arguments $(__docker_arguments) -A '-*' \
$opts_help \ $opts_help \
"($help)--advertise-addr=[Advertised address]:ip\:port: " \ "($help)--advertise-addr=[Advertised address]:ip\:port: " \
"($help)--data-path-addr=[Data path IP or interface]:ip " \
"($help)--availability=[Availability of the node]:availability:(active drain pause)" \ "($help)--availability=[Availability of the node]:availability:(active drain pause)" \
"($help)--listen-addr=[Listen address]:ip\:port: " \ "($help)--listen-addr=[Listen address]:ip\:port: " \
"($help)--token=[Token for entry into the swarm]:secret: " \ "($help)--token=[Token for entry into the swarm]:secret: " \

View File

@ -25,6 +25,7 @@ Options:
--autolock Enable manager autolocking (requiring an unlock key to start a stopped manager) --autolock Enable manager autolocking (requiring an unlock key to start a stopped manager)
--availability string Availability of the node ("active"|"pause"|"drain") (default "active") --availability string Availability of the node ("active"|"pause"|"drain") (default "active")
--cert-expiry duration Validity period for node certificates (ns|us|ms|s|m|h) (default 2160h0m0s) --cert-expiry duration Validity period for node certificates (ns|us|ms|s|m|h) (default 2160h0m0s)
--data-path-addr string Address or interface to use for data path traffic (format: <ip|interface>)
--dispatcher-heartbeat duration Dispatcher heartbeat period (ns|us|ms|s|m|h) (default 5s) --dispatcher-heartbeat duration Dispatcher heartbeat period (ns|us|ms|s|m|h) (default 5s)
--external-ca external-ca Specifications of one or more certificate signing endpoints --external-ca external-ca Specifications of one or more certificate signing endpoints
--force-new-cluster Force create a new cluster from current state --force-new-cluster Force create a new cluster from current state
@ -118,6 +119,15 @@ for example `--advertise-addr eth0:2377`.
Specifying a port is optional. If the value is a bare IP address or interface Specifying a port is optional. If the value is a bare IP address or interface
name, the default port 2377 will be used. name, the default port 2377 will be used.
### `--data-path-addr`
This flag specifies the address that global scope network drivers will publish towards
other nodes in order to reach the containers running on this node.
Using this parameter it is then possible to separate the container's data traffic from the
management traffic of the cluster.
If unspecified, Docker will use the same IP address or interface that is used for the
advertise address.
### `--task-history-limit` ### `--task-history-limit`
This flag sets up task history retention limit. This flag sets up task history retention limit.

View File

@ -23,6 +23,7 @@ Join a swarm as a node and/or manager
Options: Options:
--advertise-addr string Advertised address (format: <ip|interface>[:port]) --advertise-addr string Advertised address (format: <ip|interface>[:port])
--availability string Availability of the node ("active"|"pause"|"drain") (default "active") --availability string Availability of the node ("active"|"pause"|"drain") (default "active")
--data-path-addr string Address or interface to use for data path traffic (format: <ip|interface>)
--help Print usage --help Print usage
--listen-addr node-addr Listen address (format: <ip|interface>[:port]) (default 0.0.0.0:2377) --listen-addr node-addr Listen address (format: <ip|interface>[:port]) (default 0.0.0.0:2377)
--token string Token for entry into the swarm --token string Token for entry into the swarm
@ -95,6 +96,15 @@ name, the default port 2377 will be used.
This flag is generally not necessary when joining an existing swarm. This flag is generally not necessary when joining an existing swarm.
### `--data-path-addr`
This flag specifies the address that global scope network drivers will publish towards
other nodes in order to reach the containers running on this node.
Using this parameter it is then possible to separate the container's data traffic from the
management traffic of the cluster.
If unspecified, Docker will use the same IP address or interface that is used for the
advertise address.
### `--token string` ### `--token string`
Secret value required for nodes to join the swarm Secret value required for nodes to join the swarm