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

digitalocean: increase API page size #1611

Merged

Conversation

tdyas
Copy link
Contributor

@tdyas tdyas commented May 31, 2020

The default API page size for the DigitalOcean API is 20 objects. Increase to 200 to reduce the number of API calls required to enumerate domains and records. Should fix #1429.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 31, 2020
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 31, 2020
@tdyas
Copy link
Contributor Author

tdyas commented May 31, 2020

/assign @njuettner

@Raffo
Copy link
Contributor

Raffo commented Jun 1, 2020

@tdyas thank you for your PR! Would you be able to tell me what are the consequences in terms of usage of the API or performance to increase such value? Wouldn't it be better to make it configurable via a flag or is it generally safe to have 200 as default?

@tdyas
Copy link
Contributor Author

tdyas commented Jun 3, 2020

I used 200 mainly because it is used in the DigitalOcean Terraform provider (see https://github.com/terraform-providers/terraform-provider-digitalocean/blob/fd9e7b8b8156599799c7b2e636f68a529929b3bf/digitalocean/datasource_digitalocean_sizes.go#L88 for an example), and is one order of magnitude up from the default of 20.

I'd be fine with making it configurable though. My external-dns deployment is not at the scale where I would be able to see it make it difference or not. Thus making it configurable would allow people with deployments at that scale to tune it to their needs.

@njuettner
Copy link
Member

@tdyas as Raffo said please make it configurable 🙂. People like to like at the options of their preferred provider. The less hardcoded stuff we have the better it is for us to maintain it.

@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 Jun 6, 2020
@tdyas tdyas force-pushed the digitalocean_increase_per_page branch from 6e1e5cb to 51fd8a9 Compare June 6, 2020 04:23
@tdyas
Copy link
Contributor Author

tdyas commented Jun 6, 2020

@tdyas as Raffo said please make it configurable slightly_smiling_face. People like to like at the options of their preferred provider. The less hardcoded stuff we have the better it is for us to maintain it.

Makes sense. The latest commits make it configurable via --digitalocean-api-page-size. It also sets the default at 50 instead of 200. (The godo DigitalOcean API library uses a default of 20.)

@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 Jun 6, 2020
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
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Jun 9, 2020
@k8s-ci-robot k8s-ci-robot merged commit 4285483 into kubernetes-sigs:master Jun 9, 2020
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DigitalOcean rate limits avoidance
4 participants