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

Replaced internal services with pod watching. #39

Merged
merged 3 commits into from
Jul 31, 2023
Merged

Replaced internal services with pod watching. #39

merged 3 commits into from
Jul 31, 2023

Conversation

mwhittaker
Copy link
Member

Before this PR, weavelets communicated with one another via a Kubernetes service. This had two problems. First, a weavelet would try to contact the service before any backing pods started, which led to crashes. Second, a weavelet would contact the service to get an IP address and then use this IP address for all future calls, effectively bypassing our load balancing entirely.

This PR fixes the issues by directly watching pods and getting their IP addresses rather than using a service. I believe the internal services we generate are now not needed, but I need to double check and will delete it in a future PR.

Before this PR, weavelets communicated with one another via a Kubernetes
service. This had two problems. First, a weavelet would try to contact
the service before any backing pods started, which led to crashes.
Second, a weavelet would contact the service to get an IP address and
then use this IP address for all future calls, effectively bypassing our
load balancing entirely.

This PR fixes the issues by directly watching pods and getting their IP
addresses rather than using a service. I believe the internal services
we generate are now not needed, but I need to double check and will
delete it in a future PR.
@mwhittaker mwhittaker requested a review from rgrandl July 29, 2023 00:05
@mwhittaker mwhittaker self-assigned this Jul 29, 2023
Copy link
Contributor

@spetrovic77 spetrovic77 left a comment

Choose a reason for hiding this comment

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

Looks great. Will let Robert review.

internal/impl/babysitter.go Show resolved Hide resolved
internal/impl/kube.go Show resolved Hide resolved
I also fixed a small bug when detecting if a change happened when a pod
is deleted, and I merged two goroutines into one.
Copy link
Member Author

@mwhittaker mwhittaker left a comment

Choose a reason for hiding this comment

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

Thanks Srdjan!

internal/impl/kube.go Show resolved Hide resolved
internal/impl/babysitter.go Show resolved Hide resolved
Copy link
Collaborator

@rgrandl rgrandl left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks Michael.

internal/impl/babysitter.go Show resolved Hide resolved
Copy link
Member Author

@mwhittaker mwhittaker left a comment

Choose a reason for hiding this comment

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

Thanks Robert!

internal/impl/babysitter.go Show resolved Hide resolved
@mwhittaker mwhittaker merged commit 97b40ec into main Jul 31, 2023
8 of 9 checks passed
@mwhittaker mwhittaker deleted the routing branch July 31, 2023 17:48
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