Skip to content

Fix coredns NodeHosts on dual-stack clusters#9584

Merged
brandond merged 1 commit intok3s-io:masterfrom
brandond:fix-dualstack-nodehosts
Mar 1, 2024
Merged

Fix coredns NodeHosts on dual-stack clusters#9584
brandond merged 1 commit intok3s-io:masterfrom
brandond:fix-dualstack-nodehosts

Conversation

@brandond
Copy link
Copy Markdown
Member

Proposed Changes

  • Add both dual-stack addresses to the node hosts file
  • Add hostname to hosts file as alias for node name to ensure consistent resolution

Types of Changes

bugfix

Verification

  • See linked issue
  • On a dual-stack cluster, ensure that both addresses are present in the hosts file:
    kubectl get configmap -n kube-system coredns -o template --template '{{.data.NodeHosts}}'

Testing

Linked Issues

User-Facing Change

Further Comments

* Add both dual-stack addresses to the node hosts file
* Add hostname to hosts file as alias for node name to ensure consistent resolution

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
@brandond brandond requested a review from a team as a code owner February 28, 2024 01:34
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 28, 2024

Codecov Report

Attention: Patch coverage is 0% with 62 lines in your changes are missing coverage. Please review.

Project coverage is 27.75%. Comparing base (86f1021) to head (76ce27e).

Files Patch % Lines
pkg/node/controller.go 0.00% 55 Missing ⚠️
pkg/agent/run.go 0.00% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #9584       +/-   ##
===========================================
- Coverage   49.44%   27.75%   -21.70%     
===========================================
  Files         151      154        +3     
  Lines       13471    13558       +87     
===========================================
- Hits         6661     3763     -2898     
- Misses       5467     9008     +3541     
+ Partials     1343      787      -556     
Flag Coverage Δ
e2etests ?
inttests 22.36% <0.00%> (-17.06%) ⬇️
unittests 15.95% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread pkg/node/controller.go
nodeIPv6 = ""
} else if nodeIPv4 == "" && nodeIPv6 == "" {
logrus.Errorf("No InternalIP addresses found for node " + nodeName)
return nil
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not related to changes here, but shouldn't we return the error instead of just logging it?

Copy link
Copy Markdown
Member Author

@brandond brandond Feb 28, 2024

Choose a reason for hiding this comment

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

no, returning an error from a handler causes wrangler to reenque the handler and run it again, with the expectation that there is an external problem that can be retried. In this case there is nothing to retry - this state cannot be handled, we just need to wait for another update where the node does have IPs set.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ok, thanks for the explanation Brad

Copy link
Copy Markdown
Contributor

@manuelbuil manuelbuil left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants