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

baremetal: ipv6, switch to NM dispatcher for DNS VIP prepending #1396

Merged
merged 2 commits into from Jan 23, 2020

Conversation

hardys
Copy link
Contributor

@hardys hardys commented Jan 21, 2020

The prepend via dhclient doesn't work via ipv6, so switch to a
NetworkManager dispatcher that runs after dhclient instead as a
workaround.

- What I did

Reworked the prepender implementation (with help from @celebdor) to avoid using the prepend domain-name-servers option in dhclient.conf - it seems this option only works for ipv4[1] and the suggested alternative of prepend dhcp6.name-servers also doesn't seem to work when the resolv.conf is managed by NetworkManager.

Instead we configure NetworkManager to no longer manage the resolv.conf directly, and rely on a dispatcher script which injects the necessary IP on master/worker nodes to correctly reference coredns for the baremetal platform.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=643890

- How to verify it

Deploy with ipv4 and ipv6, confirm that on the masters the DNS VIP is prepended to the resolv.conf, and on the workers the local nic IP for the controlplane network (not the DNS VIP) is configured.

Also check sudo journalctl -b | grep prepender to see the log output from the dispatcher scripts.

- Description for the changelog

For the baremetal platform management of the resolv.conf is now handled via a NetworkManager dispatcher script, so that the necessary DNS server can be prepended for both ipv4 and ipv6 environments.

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 21, 2020
@celebdor
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 21, 2020
@celebdor
Copy link
Contributor

/assign yboaron

@celebdor
Copy link
Contributor

/assign @rgolangh
/assign @Fedosin

You may want to copy the approach (specially looking to IPv6 support).

Copy link
Contributor

@rgolangh rgolangh left a comment

Choose a reason for hiding this comment

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

This looks good and will address the prepend issues that I saw #1313 - I'm going to add this to oVirt.

@runcom
Copy link
Member

runcom commented Jan 22, 2020

/retest

Steven Hardy and others added 2 commits January 22, 2020 10:28
The prepend via dhclient doesn't work via ipv6, so switch to a
NetworkManager dispatcher that runs after dhclient instead as a
workaround.

Co-Authored-By: Antoni Segura Puimedon <apuimedo@redhat.com>
Make it clear that we're writing /etc/resolv.conf but also
reading the /var/run/NetworkManager/resolv.conf
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 22, 2020
@hardys
Copy link
Contributor Author

hardys commented Jan 22, 2020

/retest

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 22, 2020

@hardys: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-aws-scaleup-rhel7 33df2e0 link /test e2e-aws-scaleup-rhel7

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@runcom
Copy link
Member

runcom commented Jan 22, 2020

/skip

@runcom
Copy link
Member

runcom commented Jan 22, 2020

/retest

@kikisdeliveryservice
Copy link
Contributor

This is passing tests can we get a review @bcrochet / @celebdor ?

@hardys
Copy link
Contributor Author

hardys commented Jan 23, 2020

This is passing tests can we get a review @bcrochet / @celebdor ?

Also cc @russellb @derekhiggins who have tested this and found it to work OK - I've also re-tested it in a regular ipv4 environment.

@bcrochet
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 23, 2020
@celebdor
Copy link
Contributor

/lgtm

@hardys
Copy link
Contributor Author

hardys commented Jan 23, 2020

@celebdor @bcrochet @russellb I think we may have to make this also apply to the bootstrap VM, particularly because the NM conf where we set rc-manager=unmanaged in this PR is common?

Also we set the prepend dhclient.conf option in the installer here:

https://github.com/openshift/installer/blob/master/data/data/bootstrap/baremetal/files/etc/dhcp/dhclient.conf#L7

So I think we need to remove that and ensure the prepender gets added for all nodes including bootstrap?

There are only common, master and worker templates directories, how does the precedence work, e.g can we have a common template (which will be for the bootstrap, or perhaps bootstrap and masters if we switch to using the DNS VIP on the bootstrap VM), then override it in the worker directory with a file of the same name?

@russellb
Copy link
Member

@celebdor @bcrochet @russellb I think we may have to make this also apply to the bootstrap VM, particularly because the NM conf where we set rc-manager=unmanaged in this PR is common?

Also we set the prepend dhclient.conf option in the installer here:

https://github.com/openshift/installer/blob/master/data/data/bootstrap/baremetal/files/etc/dhcp/dhclient.conf#L7

So I think we need to remove that and ensure the prepender gets added for all nodes including bootstrap?

There are only common, master and worker templates directories, how does the precedence work, e.g can we have a common template (which will be for the bootstrap, or perhaps bootstrap and masters if we switch to using the DNS VIP on the bootstrap VM), then override it in the worker directory with a file of the same name?

It looks like the MCO templates don't apply to the bootstrap VM. I think we need to add what's needed to the installer.

@kikisdeliveryservice
Copy link
Contributor

@hardys @russellb
Just double check I can approve this for merge though right??

@russellb
Copy link
Member

@hardys @russellb
Just double check I can approve this for merge though right??

Yes. There's a related change still needed, but for the bootstrap VM, and that'll be in the installer. This PR is still ready to go.

Copy link
Contributor

@kikisdeliveryservice kikisdeliveryservice left a comment

Choose a reason for hiding this comment

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

Thanks for the update @russellb !

@kikisdeliveryservice
Copy link
Contributor

/cherrypick release-4.3

@openshift-cherrypick-robot

@kikisdeliveryservice: once the present PR merges, I will cherry-pick it on top of release-4.3 in a new PR and assign it to you.

In response to this:

/cherrypick release-4.3

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bcrochet, celebdor, hardys, kikisdeliveryservice

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:
  • OWNERS [kikisdeliveryservice]

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 23, 2020
@openshift-merge-robot openshift-merge-robot merged commit 1cb73f2 into openshift:master Jan 23, 2020
@openshift-cherrypick-robot

@kikisdeliveryservice: new pull request created: #1406

In response to this:

/cherrypick release-4.3

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

russellb added a commit to openshift-kni/installer that referenced this pull request Jan 23, 2020
This was previously done with an option to dhclient, but this doesn't
work when doing DHCPv6.  Switch to a script run by NetworkManager to do
the same thing.

This matches the same approach moved to by the MCO in this PR:

openshift/machine-config-operator#1396
russellb added a commit to russellb/installer that referenced this pull request Jan 24, 2020
This was previously done with an option to dhclient, but this doesn't
work when doing DHCPv6.  Switch to a script run by NetworkManager to do
the same thing.

This matches the same approach moved to by the MCO in this PR:

openshift/machine-config-operator#1396
russellb added a commit to russellb/installer that referenced this pull request Jan 24, 2020
This was previously done with an option to dhclient, but this doesn't
work when doing DHCPv6.  Switch to a script run by NetworkManager to do
the same thing.

This matches the same approach moved to by the MCO in this PR:

openshift/machine-config-operator#1396
stbenjam pushed a commit to stbenjam/installer that referenced this pull request Feb 5, 2020
This was previously done with an option to dhclient, but this doesn't
work when doing DHCPv6.  Switch to a script run by NetworkManager to do
the same thing.

This matches the same approach moved to by the MCO in this PR:

openshift/machine-config-operator#1396
stbenjam pushed a commit to stbenjam/installer that referenced this pull request Feb 5, 2020
This was previously done with an option to dhclient, but this doesn't
work when doing DHCPv6.  Switch to a script run by NetworkManager to do
the same thing.

This matches the same approach moved to by the MCO in this PR:

openshift/machine-config-operator#1396
honza pushed a commit to honza/installer that referenced this pull request Feb 5, 2020
This was previously done with an option to dhclient, but this doesn't
work when doing DHCPv6.  Switch to a script run by NetworkManager to do
the same thing.

This matches the same approach moved to by the MCO in this PR:

openshift/machine-config-operator#1396
russellb added a commit to openshift-kni/installer that referenced this pull request Feb 6, 2020
This was previously done with an option to dhclient, but this doesn't
work when doing DHCPv6.  Switch to a script run by NetworkManager to do
the same thing.

This matches the same approach moved to by the MCO in this PR:

openshift/machine-config-operator#1396
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/installer that referenced this pull request Feb 11, 2020
This was previously done with an option to dhclient, but this doesn't
work when doing DHCPv6.  Switch to a script run by NetworkManager to do
the same thing.

This matches the same approach moved to by the MCO in this PR:

openshift/machine-config-operator#1396
russellb added a commit to openshift-kni/installer that referenced this pull request Feb 11, 2020
This was previously done with an option to dhclient, but this doesn't
work when doing DHCPv6.  Switch to a script run by NetworkManager to do
the same thing.

This matches the same approach moved to by the MCO in this PR:

openshift/machine-config-operator#1396
mandre added a commit to mandre/machine-config-operator that referenced this pull request Feb 18, 2020
The prepend via dhclient doesn't work via ipv6, so switch to
a NetworkManager dispatcher that runs after dhclient instead as
a workaround.

This ports the BM fix from
openshift#1396 to
OpenStack platform.
vrutkovs pushed a commit to vrutkovs/machine-config-operator that referenced this pull request Mar 1, 2020
The prepend via dhclient doesn't work via ipv6, so switch to
a NetworkManager dispatcher that runs after dhclient instead as
a workaround.

This ports the BM fix from
openshift#1396 to
OpenStack platform.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet