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

rfc2136: add batch size support #2127

Merged
merged 3 commits into from
Jul 3, 2021
Merged

rfc2136: add batch size support #2127

merged 3 commits into from
Jul 3, 2021

Conversation

knackaron
Copy link
Contributor

Description

This PR adds a new --rfc2136-batch-change-size option, which follows the AWS and Google providers, which already support controlling the batch size. I defaulted the batch size to 50, which seems like a sane default to prevent large updates, while at the same time keeping most transactions atomic, as was the intent with the batching support in the first place.

Savvy users who want to revert to the 0.5 behavior without batching support can set their batch size to 1 with this patch to achieve that, which would help address #1517.

When the rfc2136 provider gained batching support (#1164), it introduced a couple of regressions for us in behavior compared to the 0.5 series.

  1. Large updates, even with TCP, can exceed what the DNS server allows which can still result in warn in dns.Client.Exchange: dns: message too large errors. We have observed this in production environments in normal operation when our ingress controllers changed their load balancer external IPs during a migration, requiring DNS updates to hundreds of records at once. For the purpose of developing this patch, I was able to reproduce the behavior with by creating a large number (500) of new ingresses at once.

  2. If any update in the batch fails to apply, the whole transaction fails, which leads to one bad resource in the cluster (e.g., a tenant's Ingress) being able to DoS external-dns for the whole cluster. This has also been observed in production environments for us, whereas when batching was not in use, only the bad update failed and others went through. This regression is already noted in One invalid record in ChangeBatch stops all others from updating #1517.

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jun 16, 2021
@k8s-ci-robot
Copy link
Contributor

Welcome @knackaron!

It looks like this is your first PR to kubernetes-sigs/external-dns 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/external-dns has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 16, 2021
@knackaron
Copy link
Contributor Author

I signed it.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 16, 2021
Copy link
Member

@njuettner njuettner left a comment

Choose a reason for hiding this comment

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

Hey @knackaron 👋🏻 , thank you for your contribution. Do you mind adding unit tests for you changes? Let me know if you need help.

@knackaron
Copy link
Contributor Author

Hey @knackaron 👋🏻 , thank you for your contribution. Do you mind adding unit tests for you changes? Let me know if you need help.

Will do. Have @knackjeff working on adding them now. Will update one we push another commit with passing unit tests for the new functionality.

@knackjeff
Copy link
Contributor

I signed it

@k8s-ci-robot k8s-ci-robot removed the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 23, 2021
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 23, 2021
@knackjeff
Copy link
Contributor

I signed it

@njuettner
Copy link
Member

@knackjeff it seems linter is complaining

golangci-lint run --timeout=15m ./...
provider/rfc2136/rfc2136.go:292: unnecessary trailing newline (whitespace)

@knackjeff
Copy link
Contributor

@njuettner sorry about that. I pulled down the golangci-linter package and have at least verified the code we've modified in this PR is linted!

Copy link
Member

@njuettner njuettner left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 1, 2021
@njuettner njuettner removed approved Indicates a PR has been approved by an approver from all required OWNERS files. tests-missing labels Jul 1, 2021
@njuettner
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: knackaron, njuettner

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 Jul 3, 2021
@k8s-ci-robot k8s-ci-robot merged commit ababc7b into kubernetes-sigs:master Jul 3, 2021
@knackaron knackaron deleted the rfc2136-batch-size branch July 5, 2021 16:57
kumy added a commit to boris-lenzinger/external-dns that referenced this pull request Sep 14, 2021
When facing large messages, one can have its dns refusing the update due
to "too large message" error.
The DNS library used propose to compress the message that is sent.

This commit exposes this feature. It adds a new command line option
named --enable-compression and adds a new field to the configuration.
The default value of the field is set to false to not change the current
behavior of external-dns.

We had this change pending locally on our side since a long time. As of
today, an alternative would be to use the rencent `batchChangeSize`
option from kubernetes-sigs#2127 to overcome the same issue.
kumy added a commit to boris-lenzinger/external-dns that referenced this pull request Sep 14, 2021
When facing large messages, one can have its dns refusing the update due
to "too large message" error.
The DNS library used propose to compress the message that is sent.

This commit exposes this feature. It adds a new command line option
named --enable-compression and adds a new field to the configuration.
The default value of the field is set to false to not change the current
behavior of external-dns.

We had this change pending locally on our side since a long time. As of
today, an alternative would be to use the rencent `batchChangeSize`
option from kubernetes-sigs#2127 to overcome the same issue.
kumy added a commit to boris-lenzinger/external-dns that referenced this pull request Sep 14, 2021
When facing large messages, one can have its dns refusing the update due
to "too large message" error.
The DNS library used propose to compress the message that is sent.

This commit exposes this feature. It adds a new command line option
named --enable-compression and adds a new field to the configuration.
The default value of the field is set to false to not change the current
behavior of external-dns.

We had this change pending locally on our side since a long time. As of
today, an alternative would be to use the rencent `batchChangeSize`
option from kubernetes-sigs#2127 to overcome the same issue.
@kumy kumy mentioned this pull request Sep 14, 2021
2 tasks
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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants