-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
source node: Skip unschedulable nodes #4761
Conversation
|
Welcome @n-Arno! |
Hi @n-Arno. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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-sigs/prow repository. |
Added Unit test and comment in |
/ok-to-test |
Thanks 👍, this make sense. |
missing gofmt done + rebase in a single commit 😄 |
/lgtm |
@@ -7,6 +7,9 @@ The node source adds an `A` record per each node `externalIP` (if not found, any | |||
It also adds an `AAAA` record per each node IPv6 `internalIP`. | |||
The TTL of the records can be set with the `external-dns.alpha.kubernetes.io/ttl` node annotation. | |||
|
|||
Nodes marked as **Unschedulable** as per [core/v1/NodeSpec](https://pkg.go.dev/k8s.io/api@v0.31.1/core/v1#NodeSpec) are excluded. | |||
This avoid exposing Unhealthy, NotReady or SchedulingDisabled (cordon) nodes. |
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.
the referenced doc is more clear, citing also the default seems to be important:
// Unschedulable controls node schedulability of new pods. By default, node is schedulable.
// More info: https://kubernetes.io/docs/concepts/nodes/node/#manual-node-administration
// +optional
Unschedulable [bool](https://pkg.go.dev/builtin#bool) `json:"unschedulable,omitempty" protobuf:"varint,4,opt,name=unschedulable"`
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.
Thanks for the info, i'll add this 😄
@@ -102,6 +102,11 @@ func (ns *nodeSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, erro | |||
continue | |||
} | |||
|
|||
if node.Spec.Unschedulable { | |||
log.Debugf("Skipping node %s because it is unschedulable", node.Name) |
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.
I wonder if this should not be more prominent than debug, maybe info?
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.
I initially went for Debug since the other "skip" step also does it in Debug:
Line 100 in 45257fb
log.Debugf("Skipping node %s because controller value does not match, found: %s, required: %s", |
If Info is better, i'll go for this.
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.
Let's have it like this
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: szuecs 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 |
Skip unschedulable nodes to avoid adding nodes to a DNS round robin entry.
Added in source/node.go a simple test regarding Node.Spec.Unschedulable.
Fixes #ISSUE
Checklist