Add support for host mode port PublishMode in services#27917
Add support for host mode port PublishMode in services#27917tonistiigi merged 1 commit intomoby:masterfrom
Conversation
937850b to
eb65aa2
Compare
mavenugo
left a comment
There was a problem hiding this comment.
@mrjana Can you pls document if this will impact existing services (without the PublishMode) and also any compatibility concerns with a mixed cluster of 1.13 manager and 1.12 based workers and vice-versa. Also things to consider for upgrades and downgrades.
cli/command/service/create.go
Outdated
There was a problem hiding this comment.
Given that we have 2 independent publish flags, should we move -p above to hidden ?
flags.MarkHidden("p")
There was a problem hiding this comment.
Edit: I see the proposal now, commented below
cli/command/service/opts.go
Outdated
There was a problem hiding this comment.
should we instead change convertPortToPortConfig to take in PublishMode instead of walking the configs again as follows ?
cli/command/service/update.go
Outdated
There was a problem hiding this comment.
Similar to the above comment, shall we hide the existing flag ?
|
The design was reviewed under moby/swarmkit#1645 . moving to code-review. |
|
I put it back to design, I'm a bit confused; we now have three flags (6 if we look at I can see that being very confusing for users, and wonder if we can find a better approach |
|
@thaJeztah ok. do you have any suggestions ? Lets start from there. |
|
Current options in
|
|
Some feature requests;
|
|
So, my concerns are that (first of all) we tried the Also, more features will be added in future, and we end up with even more flags. I'm not sure if the current In future we can add "porcelain" flags for easier use, if requested. |
|
@thaJeztah I like this idea which helps with the issue of "grouping" related flags together at the CLI level (which is ofcourse already possible in engine-API & protobuf structures). I wish we make this a consistent pattern and introduce such a "grouping" concept that can be used for more such use-cases. |
|
LGTM |
|
@icecrime @cpuguy83 @aluzzardi can you please add your comments / opinion on the UX as proposed by this PR vs @thaJeztah's proposal ? Given the code-freeze is round the corner, it will be great to have an answer soon so that we can also do integration-testing with WS2016 as well. |
|
The |
|
Sebastiaan's proposal makes sense to me. Yes it's verbose, but it's maybe better to get the fundamentals right (as in: non-ambiguous, and future-proof). |
|
thanks @icecrime @cpuguy83 @vdemeester. @thaJeztah @mrjana shall we reuse --publish flag and overload it with both the formats ? For example,
etc... |
|
If we can do it "technically", I am not against reusing the flag One thing we should look at is how "removing" a published port will work in |
|
ping @dnephin. Can you please chime in on the port publication format that is being discussed here? This will override the micro format specification that has been used so far. |
cli/command/service/opts.go
Outdated
There was a problem hiding this comment.
These should be publish-ingress-rm, publish-host-rm, same with the add flags
cli/command/service/create.go
Outdated
There was a problem hiding this comment.
Edit: I see the proposal now, commented below
|
Oh, I see the proposal for having the new flags use a different format. I think that makes sense. We need a way to expose more information, and following the mount syntax sounds correct. I think we should deprecate the old |
|
Rebased |
Add api/cli support for adding host port PublishMode in services. Signed-off-by: Jana Radhakrishnan <[email protected]>
|
Linking #28463 (comment) which should be documented as part of the documentation changes for this PR |
|
@mavenugo @thaJeztah I use this command it works. |
|
@rootsongjc no, currently only "host" or "ingress". Be aware that after UX reviews, the |
|
Here was the original UX proposal: For mount, the syntax complexity made sense due the use of volume options and arbitrary filesystem paths. Ports are much, much simpler and forcing people to navigate this morass for simple port definition isn't great. I am not sure I understood the main impetus behind using the csv-style syntax. |
|
Oh no, this seems to make things more complex. does this mean there is no straight --publish [port:]port syntax defaulting to the ingress network any more? Is there any documentation on how this affects DNS resolution and any differences between networking for the two modes. I guess this helps to fix external connections to services like kafka, and removes a potential routing hop if you are using nginx. Is that the rational behind this? I also dont see the documentation for this in https://github.com/docker/docker/blob/master/docs/reference/commandline/service_create.md |
|
@Richard-Mathie no worries, the "simple" syntax will stay as well; see #28943, and the discussion on #28527 |
|
Documentation is added here; https://github.com/docker/docker.github.io/blob/2248f78dabc2b0e5092fd550ad0aa3c15d41e2b0/engine/swarm/services.md#publish-ports, but we should add it to the command line reference as well |
Add api/cli support for adding host port PublishMode in services.
Signed-off-by: Jana Radhakrishnan [email protected]