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

Increase speed sync with k8s #4384

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

v-kamerdinerov
Copy link

@v-kamerdinerov v-kamerdinerov commented Oct 10, 2024

Changes proposed in this PR

  • Increased speed sync between k8s and consul

In addition to registering all services periodically, now sync new services as they appear, allowing to increase the full sync interval and reduce the overall number of catalog register call to Consul servers.
This makes a difference for kube clusters with hundreds of instances without delaying updates.

How I've tested this PR

How I expect reviewers to test this PR

Checklist

Copy link

hashicorp-cla-app bot commented Oct 10, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@blake
Copy link
Member

blake commented Oct 10, 2024

Hi @v-kamerdinerov, the sync speed can be adjusted using the syncCatalog.consulWriteInterval parameter in the Helm chart, or by passing the -consul-write-interval flag to consul-k8s-control-plane sync-catalog, if you happen to be manually starting the control plane process.

Is this suitable for your needs?

@v-kamerdinerov
Copy link
Author

Hi @v-kamerdinerov, the sync speed can be adjusted using the syncCatalog.consulWriteInterval parameter in the Helm chart, or by passing the -consul-write-interval flag to consul-k8s-control-plane sync-catalog, if you happen to be manually starting the control plane process.

Is this suitable for your needs?

Hello @blake

That's something - thank you!

However, my fix also allows synchronization when - registration is new or changed

ConsulSyncPeriod I can reset to default, but my functional seems to be useful too.

@v-kamerdinerov v-kamerdinerov marked this pull request as ready for review October 15, 2024 08:37
@jukie
Copy link
Contributor

jukie commented Oct 18, 2024

However, my fix also allows synchronization when - registration is new or changed

I may be mistaken but I thought thtat syncer already reacts as soon as endpoints are updated by use of the Informer? ConsulSyncPeriod is useful to reconcile drift for example and ensure that periodic syncs happen but what are you looking to achieve with this?

@v-kamerdinerov
Copy link
Author

However, my fix also allows synchronization when - registration is new or changed

I may be mistaken but I though thtat syncer already reacts as soon as endpoints are updated by use of the Informer? ConsulSyncPeriod is useful to reconcile drift for example and ensure that periodic syncs happen but what are you looking to achieve with this?

In addition to registering all services periodically, now sync new services as they appear, allowing to increase the full sync interval and reduce the overall number of catalog register call to Consul servers.
This makes a difference for kube clusters with hundreds of instances without delaying updates.

@v-kamerdinerov
Copy link
Author

Checked latest version - build was successful.

❯ ./control-plane version
consul-k8s-control-plane v1.6.0-dev

@v-kamerdinerov v-kamerdinerov requested a review from a team as a code owner November 17, 2024 10:11
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