Skip to content
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

config,coredns: add support for network scoped dns servers #252

Merged
merged 1 commit into from
Nov 23, 2022

Conversation

flouthoc
Copy link
Collaborator

Aardvark-dns users must be able to specify dns_servers for containers at network level as well, so all the containers must inherit custom dns servers from their network if specified.

What happens if both container's dns server and network's dns server are specified ?

  • In such case priority order is network dns servers and then container's custom dns servers.

By default if nothing is specified resolution will happen from host's resolver

@flouthoc
Copy link
Collaborator Author

flouthoc commented Nov 10, 2022

Don't think failing test is related to this PR, I have restarted the test just to be sure.

Edit: not sure why is this only failing on aarch64 and not on regular integration setup, this passes on my local.

@flouthoc flouthoc marked this pull request as draft November 10, 2022 11:30
@flouthoc
Copy link
Collaborator Author

Don't review this yet intentionally breaking tests to see how config looks in failing aarch64 integration test.

@flouthoc flouthoc marked this pull request as ready for review November 10, 2022 12:15
@flouthoc
Copy link
Collaborator Author

Okay nevermind it was CI glitch this is fixed now and ready for review. We can either merge this or wait for me to implement e2e feature across netavark and podman. @Luap99 @mheon @baude PTAL

@Luap99
Copy link
Member

Luap99 commented Nov 10, 2022

Did we already agreed on doing this now? I don't find anything in my mail or jira.

@mheon
Copy link
Member

mheon commented Nov 10, 2022

Wait, why is priority order network servers and then container servers? that doesn't make any sense.

Container-specified servers should always have priority.

@baude
Copy link
Member

baude commented Nov 10, 2022

Did we already agreed on doing this now? I don't find anything in my mail or jira.

We did not ... no decision has been rendered.

@flouthoc
Copy link
Collaborator Author

flouthoc commented Nov 10, 2022

Container-specified servers should always have priority.

Priority reversed but lets hold this and make consensus on design doc. /hold

flouthoc added a commit to flouthoc/netavark that referenced this pull request Nov 21, 2022
Aardvark and podman supports `network_dns_servers` which allows aardvark
to configure a resolver at network level and all containers attached to
a network honors this resolver.

Needs: containers/aardvark-dns#252

Signed-off-by: Aditya R <[email protected]>
@flouthoc
Copy link
Collaborator Author

PTAL this is needed for containers/netavark#497

src/config/mod.rs Outdated Show resolved Hide resolved
src/test/test.rs Outdated Show resolved Hide resolved
@flouthoc flouthoc requested a review from Luap99 November 22, 2022 06:27
@flouthoc
Copy link
Collaborator Author

@Luap99 PTAL again.

src/config/mod.rs Outdated Show resolved Hide resolved
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 22, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flouthoc, Luap99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

}
}
// Add network scoped resolvers
if let Some(network_dns_servers) = self.backend.get_network_scoped_resolvers(&src_address.ip()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be done if there were container-configured resolvers. We want container-provided resolvers, or network-provided resolvers. Not both.

Copy link
Collaborator Author

@flouthoc flouthoc Nov 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. My idea was to configure both resolvers but give higher priority to the container ones but I agree with you lets keep only one and we can revisit in future if this is needed otherway around.

config.md Outdated
The first line in the config must contain a comma separated list of listening ips for this network, usually the bridge ips.
At least one ip must be given.
**Note**: Optional second coloumn allows users to specifify DNS servers at network level (seperated by comman), all the containers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An optional second column of comma delimited domain name servers can be used at the network level. All containers on that network will inherit all the specified name servers instead of using the host's resolver.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

config.md Show resolved Hide resolved
@mheon
Copy link
Member

mheon commented Nov 22, 2022

LGTM

@flouthoc
Copy link
Collaborator Author

@baude PTAL

@baude
Copy link
Member

baude commented Nov 23, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Nov 23, 2022
@openshift-merge-robot openshift-merge-robot merged commit 8244b30 into containers:main Nov 23, 2022
flouthoc added a commit to flouthoc/netavark that referenced this pull request Nov 23, 2022
Aardvark and podman supports `network_dns_servers` which allows aardvark
to configure a resolver at network level and all containers attached to
a network honors this resolver.

Needs: containers/aardvark-dns#252

Signed-off-by: Aditya R <[email protected]>
flouthoc added a commit to flouthoc/netavark that referenced this pull request Nov 23, 2022
Aardvark and podman supports `network_dns_servers` which allows aardvark
to configure a resolver at network level and all containers attached to
a network honors this resolver.

Needs: containers/aardvark-dns#252

Signed-off-by: Aditya R <[email protected]>
flouthoc added a commit to flouthoc/netavark that referenced this pull request Nov 23, 2022
Aardvark and podman supports `network_dns_servers` which allows aardvark
to configure a resolver at network level and all containers attached to
a network honors this resolver.

Needs: containers/aardvark-dns#252

Signed-off-by: Aditya R <[email protected]>
flouthoc added a commit to flouthoc/podman that referenced this pull request Jan 12, 2023
* Add support for `podman network update <>`

```console
network update

Description:
  update networks for containers and pods

Usage:
  podman network update [options] NAME

Examples:
  podman network update podman1

Options:
      --dns-add stringArray      add network level nameservers
      --dns-drop stringArray   remove network level nameservers
```

* Add support for `--network-dns-server` to `podman network create`

Extends podman to support recently added features in `netavark` and
`aardvark-dns`

* containers/netavark#497
* containers/aardvark-dns#252
* containers/netavark#503

[NO NEW TESTS NEEDED]
[NO TESTS NEEDED]

Signed-off-by: Aditya R <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants