New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Network scoped alias support #19242
Network scoped alias support #19242
Conversation
@cpuguy83 @vdemeester @calavera @icecrime I have temporarily included the engine-api vendoring commit in this PR to help CI succeed. I will rebase this PR once we have an officially vendored in the engine-api dependency. We didn't cover the UX portion during the maintainers meeting. Hoping to get some consensus in this PR. |
@@ -100,6 +101,7 @@ func Parse(cmd *flag.FlagSet, args []string) (*container.Config, *container.Host | |||
cmd.Var(&flVolumes, []string{"v", "-volume"}, "Bind mount a volume") | |||
cmd.Var(&flTmpfs, []string{"-tmpfs"}, "Mount a tmpfs directory") | |||
cmd.Var(&flLinks, []string{"-link"}, "Add link to another container") | |||
cmd.Var(&flAliases, []string{"-network-alias"}, "Add network scoped alias for the container") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest renaming this to --net-alias
to make it more convenient and consistent with --net
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also the variable name should be flNetAliases
UX wise: Also, we should make it very clear the relationship between Other than that, you have my +1. |
What happens if you are connected to a network already and you want to use an additional alias? |
@cpuguy83 we dont have the support to dynamically updating the alias. the only way is to disconnect and reconnect with the list of new aliases. |
Also seems possible for multiple containers to specify the same alias on a network. |
@cpuguy83 yes. it is expected (and is a requirement for compose). The expected behavior in 1.10 is to provide high availability between the containers sharing the alias in that network. When one container goes down another one will start serving the request. We are not providing built-in load-balancing yet. |
design +1 from me as well with the changes mentioned by @tiborvass |
@cpuguy83 @tiborvass rebased on top of engine-api v0.2.1 and addressed your comments. The docs has some dependencies on #19229. Once it is merged, I will rebase this PR again to finish up the docs. PTAL. |
@@ -100,6 +101,7 @@ func Parse(cmd *flag.FlagSet, args []string) (*container.Config, *container.Host | |||
cmd.Var(&flVolumes, []string{"v", "-volume"}, "Bind mount a volume") | |||
cmd.Var(&flTmpfs, []string{"-tmpfs"}, "Mount a tmpfs directory") | |||
cmd.Var(&flLinks, []string{"-link"}, "Add link to another container") | |||
cmd.Var(&flAliases, []string{"-net-alias"}, "Add network scoped alias for the container") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mavenugo network-scoped
LGTM (after tibor's comments) |
@tiborvass @jfrazelle @cpuguy83 rebased and addressed comments. PTAL. |
@@ -115,6 +115,8 @@ func (cli *DockerCli) CmdNetworkConnect(args ...string) error { | |||
flIPv6Address := cmd.String([]string{"-ip6"}, "", "IPv6 Address") | |||
flLinks := opts.NewListOpts(runconfigopts.ValidateLink) | |||
cmd.Var(&flLinks, []string{"-link"}, "Add link to another container") | |||
flAliases := opts.NewListOpts(nil) | |||
cmd.Var(&flAliases, []string{"-alias"}, "Add network scoped alias for the container") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
network-scoped
i thought you'd grep it ;)
this time I grep'ed and caught 2 more in the comments :)... fixed now. |
code lgtm, but haven't tested yet |
ping @cpuguy83 @thaJeztah |
One thing that's a little weird, a container that is not explicitly named can not be resolved by an alias. |
Ping @vdemeester |
A tiny last comment but overall great docs LGTM 🐍 |
Windows failure is unrelated and am seeing the same failure in multiple PRs. |
@mavenugo yep 😭 |
Signed-off-by: Madhu Venugopal <madhu@docker.com>
ping @mavenugo looks like you missed the network-connect man page can you add that, then we should be ready to go! |
@thaJeztah I forgot to comment on that earlier. This particular file needs some updates for multiple options. (ip, ip6, link and alias). I thought of addressing it via the other issue opened for addressing the docs. Is that okay ? |
Alright, let's do that 😄 LGTM |
all 💚 merging! 🎉 |
Thanks all. |
🎉 |
Part #2 of the proposal : #18699 which brings in the
network scoped alias
support.This PR + the local alias support (#19229) fixes #18699