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

Discontinue use of a single DNS query to validate an endpoint name #4671

Merged
merged 1 commit into from
Oct 13, 2019

Conversation

jacksontj
Copy link
Contributor

@jacksontj jacksontj commented Oct 12, 2019

What this PR does / why we need it:

This resolves issue #4670 by not using a single DNS query to determine the validity of a configured DNS name.

Fixes #4670

Special notes for your reviewer: I have created a test build of this (https://quay.io/repository/jacksontj/ingress-nginx?namespace=jacksontj) and am running it without issue, and can confirm the fix. With this fix it does leave those "broken" services spamming the logs, which is why I have included an addition to the lua log lines to clarify the situation.

@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 12, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @jacksontj. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 12, 2019
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 12, 2019
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 12, 2019
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 12, 2019
@ElvinEfendi
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 13, 2019
@jacksontj jacksontj force-pushed the issue_4670 branch 2 times, most recently from d8926ef to 5240b59 Compare October 13, 2019 02:56
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 13, 2019
@codecov-io
Copy link

codecov-io commented Oct 13, 2019

Codecov Report

Merging #4671 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4671      +/-   ##
==========================================
- Coverage   58.69%   58.66%   -0.03%     
==========================================
  Files          88       88              
  Lines        6762     6762              
==========================================
- Hits         3969     3967       -2     
- Misses       2355     2356       +1     
- Partials      438      439       +1
Impacted Files Coverage Δ
internal/ingress/controller/endpoints.go 93.75% <100%> (ø) ⬆️
internal/ingress/metric/collectors/process.go 88.29% <0%> (-2.13%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1a2950...500b043. Read the comment docs.

@jacksontj
Copy link
Contributor Author

@ElvinEfendi After those test runs I see that a few places test specifically for this behavior, so I have changed the controller to validate the DNS name (the k8s library for this is already a dependency). If you'd prefer to keep that out I can definitely remove it again :)

@jacksontj
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 13, 2019
@jacksontj
Copy link
Contributor Author

The lua test stuff was giving me some trouble, so I've split that out into another PR -- #4673

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 13, 2019
@jacksontj jacksontj force-pushed the issue_4670 branch 8 times, most recently from 8ec83b9 to c352850 Compare October 13, 2019 20:05
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 13, 2019
As the controller stands today this "validation" is done once per config load, which means if the DNS query fails for any reason the endpoint will remain dead until both (1) a change happens to the ingress and (2) the DNS resolution works. If the user configured the name we should just pass it through, this way the lua dns can attempt to re-query it at its leisure.
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 13, 2019
@jacksontj
Copy link
Contributor Author

/assign @ElvinEfendi

@jacksontj
Copy link
Contributor Author

@ElvinEfendi tests are passing, so this PR should be ready to merge :)

@aledbf
Copy link
Member

aledbf commented Oct 13, 2019

@jacksontj please don't assign PRs manually. Thanks

@aledbf
Copy link
Member

aledbf commented Oct 13, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 13, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aledbf, jacksontj

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 13, 2019
@k8s-ci-robot k8s-ci-robot merged commit decc134 into kubernetes:master Oct 13, 2019
@jacksontj jacksontj deleted the issue_4670 branch October 14, 2019 14:59
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ExternalServices get stuck 503-ing if DNS resolution fails
5 participants