Support for Windows service discovery#25987
Support for Windows service discovery#25987mavenugo merged 2 commits intomoby:masterfrom msabansal:dnssupport
Conversation
|
Thanks @msabansal. Have you submitted the libnetwork related changes to |
|
@icecrime Yes it is being verified at moby/libnetwork#1412 |
|
@msabansal am trying this patch in my setup
Both are running in default Container1's DNS server is populated with Default-gateway ip as designed - Same with container2 as well But pinging between the containers using the container-name fails. Whereas if I do Do you know why the DNS lookup fails from within the container ? |
|
@msabansal digged a little bit more and figured out that DNS lookup on |
|
@mavenugo Typically in linux an unqualified name will be sent with a |
|
@mavenugo Yes. We have it fixed but it requires updated images which we are going to ship. Can you please run You should be able to see AllowUnqualifiedDnsQuery key set for Windows contianers. (for HyperV containers it requires image update.) |
api/types/network/network.go
Outdated
There was a problem hiding this comment.
I dont think we should expose the endpoint DNS settings to the docker API just yet.
I think we should reuse the daemon / container --dns configurations as is and can set the endpoint level DNS settings at libnetwork.
When we are ready to expose such functionality at the UX (and possibly across platforms), then we can enable this at the API level. So, my request is to remove this for now and we can consider including it at a later point.
container/container.go
Outdated
There was a problem hiding this comment.
comment above is applicable here as well.
There was a problem hiding this comment.
@mavenugo if I remove epConfig.DNS then we can't support daemon.configStore.DNS without a change in the public API or overwriting container.HostConfig.DNS. What option do you think I should take? Should we drop the support for daemon.configStore.DNS altogether?
There was a problem hiding this comment.
Why is that ? Please take a look at buildSandboxOptions and it is exactly the same logic I prefer here.
It will be great if we can not replicate the same code in 2 places. Infact this is the reason for my comment in libnetwork to avoid adding the new endpoint specific option for DNS. But since Sandbox is created after endpoint create, we didnt have a choice. Anyways, that is not a big deal. we can use the same logic as buildSandboxOptions and that should work.
if len(container.HostConfig.DNS) > 0 {
dns = container.HostConfig.DNS
} else if len(daemon.configStore.DNS) > 0 {
dns = daemon.configStore.DNS
}
for _, d := range dns {
sboxOptions = append(sboxOptions, libnetwork.OptionDNS(d))
}
There was a problem hiding this comment.
daemon is not available in container.go. I would have to pass it if I have to do that which will require changing the public function BuildCreateEndpointOptions. If that is alright I would do that
container/container_windows.go
Outdated
There was a problem hiding this comment.
I was originally thinking of not supporting this. But the only reason why we dont support this in Linux today is for backward compatibility reasons. With this being the first iteration of native docker platform on windows, I think it is appropriate to allow it. 👍
daemon/container_operations.go
Outdated
There was a problem hiding this comment.
am not sure why we need this ! I think we are mixing SD with --ip ?
There was a problem hiding this comment.
wanted to add short id in the default network aswell. But that is not required I guess. Removing
There was a problem hiding this comment.
I have moved this to the next line otherwise compose complains to bring up containers in the default nat network in windows.
There was a problem hiding this comment.
this however disables lookup by shortid in default nat network
|
ping @mavenugo is "design" ok with you? ok to move to code review? |
mavenugo
left a comment
There was a problem hiding this comment.
@msabansal just 1 additional comment from my side. I will request @jhowardmsft to review the AllowUnqualifiedDNSQuery related changes under oci_windows and libcontainerd changes.
container/container.go
Outdated
There was a problem hiding this comment.
It would be good to honor container.NetworkSettings.IsAnonymousEndpoint regardless if windows supports SD on default network. That will make it consistent with all platforms for all networks.
|
@msabansal also pls rebase to resolve the conflicts. |
|
@mavenugo Working on it. |
Signed-off-by: msabansal <[email protected]>
Signed-off-by: msabansal <[email protected]>
|
LGTM ping @jhowardmsft |
|
Changes on docker/docker are very limited, so if it's good for Madhu it's good for me: LGTM! Leaving it to @jhowardmsft to give it a final eye and merge 👍 |
|
Since this PR is blocking other PRs (#26844) which closes a bunch of issue, am merging it. Also the libcontainerd changes seems correct to me. |
|
Yup LGTM too |
Something I am missing? Trying nslookup test inside the container returns the correct address. |
|
@drnybble What does the following commands show in container? ipconfig /all |
|
C:>ping test C:>nslookup test Non-authoritative answer: C:>ipconfig /all Windows IP Configuration Host Name . . . . . . . . . . . . : 024743456d0f Ethernet adapter vEthernet (Container NIC afa9cae1): Connection-specific DNS Suffix . : ottriv.can.ibm.com C:>reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Dnscache\Parameters /s HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Dnscache\Parameters HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Dnscache\Parameters\Probe C:>reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Adapters PS C:\Users\Administrator> docker version Server: |
|
@drnybble All this information looks good. One more question. What does ping test. give in the container (there is a . appended to the query) Can you please open an issue with this info and ping me on it |
|
Yes "ping test." works while "ping test" does not. Logged a new issue, see #31093 |
- What I did
These changes are required to enable service discovery in Windows.
- How I did it
Enabling service discovery requires the following changes:
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)
- Libnetwork vendoring:
Fixes #25848
Fixes #25608
Fixes #26075