-
Notifications
You must be signed in to change notification settings - Fork 505
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
kubelet.service: Wait for network-online.target #1249
Conversation
Whenever kubeadm detects a system that has systemd-resolved running, it would provision the kubelet on the local node with a resolv.conf overwrite - /run/systemd/resolve/resolv.conf. However, some kubeadm users have discovered an issue during system boot. The kubelet can end up in a race with the systemd-resolved service and actually startup loads with empty or incorrect resolve.conf files. The race is caused by the fact that the kubelet.service file does not indicate dependence on the network-online.target. To fix this we add network-online.target as a dependency and wait for its initialization to complete before starting the kubelet. Signed-off-by: Rostislav M. Georgiev <[email protected]>
/lgtm |
cc @detiber |
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.
/lgtm
But I'm wondering if this fixes the real issue since it seemed related to kubeadm.
@saschagrunert there are a couple of problems in the original kubeadm issue:
|
cc @akutz |
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.
/lgtm
👍
@rosti I think this is a useful change and does close at least one timing hole. |
Thanks for the fix! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: justaugustus, neolit123, rosti, saschagrunert, SataQiu 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 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Whenever kubeadm detects a system that has systemd-resolved running, it would
provision the kubelet on the local node with a resolv.conf overwrite -
/run/systemd/resolve/resolv.conf
.However, some kubeadm users have discovered an issue during system boot.
The kubelet can end up in a race with the systemd-resolved service and actually
startup loads with empty or incorrect resolve.conf files.
The race is caused by the fact that the kubelet.service file does not indicate
dependence on the network-online.target.
To fix this we add network-online.target as a dependency and wait for its
initialization to complete before starting the kubelet.
Which issue(s) this PR fixes:
Refs #1248, kubernetes/kubeadm#2111
Special notes for your reviewer:
/cc @neolit123
/cc @kubernetes/release-engineering
/cc @kubernetes/sig-node-bugs
/assign @justaugustus @tpepper
/priority important-longterm
Does this PR introduce a user-facing change?