-
Notifications
You must be signed in to change notification settings - Fork 12
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
Watch number of pods backing a service #38
Draft
asimpleidea
wants to merge
15
commits into
CloudNativeSDWAN:master
Choose a base branch
from
asimpleidea:watch-endpoints-length
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Watch number of pods backing a service #38
asimpleidea
wants to merge
15
commits into
CloudNativeSDWAN:master
from
asimpleidea:watch-endpoints-length
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Utils contains options to define the behavior of the controllers and functions used by the controllers. Signed-off-by: Elis Lulja <[email protected]>
The namespace controller is now defined with a series of predicates that will dicatate whether the event should be passed to the namespace controller or be ignored. Signed-off-by: Elis Lulja <[email protected]>
The namespace controller reconcile function is updated to reflect changes in the predicates. As a result, it becomes much slimmer and simpler. Signed-off-by: Elis Lulja <[email protected]>
This commit adds predicates to the service controller in the same fashion as what was done for the namespace controller. Unit tests included. Signed-off-by: Elis Lulja <[email protected]>
The service controller's reconcile function has been updated to reflect the addition of predicates. As a consequence, the reconcile function is shorter, readable and intuitive, as it now is invoked *only* when there is actually a need for reconciliation, i.e. no additional parsing is needed. Signed-off-by: Elis Lulja <[email protected]>
This commit updates main.go to reflect the changes in the controller. More precisely, main starts controller utils and sets it up in the namespace and service controllers. Signed-off-by: Elis Lulja <[email protected]>
This commit adds the ability to enable the pods counting feature and choose the annotation key that will be registered in the service's metadata. Signed-off-by: Elis Lulja <[email protected]>
baseReconciler is meant to replace controller utils as it includes common functions and structures and serves as the basis for all other controllers. Signed-off-by: Elis Lulja <[email protected]>
The existing reconcilers, Namespace and Service, now inherit methods and variables from BaseReconcilers. Main has been updated to reflect such change. Signed-off-by: Elis Lulja <[email protected]>
This commit adds the EndpointSliceReconciler and makes it inherit the BaseReconciler. Signed-off-by: Elis Lulja <[email protected]>
This commit updates the roles with proper permissions to perform operations on endpointslices on Kubernetes. Signed-off-by: Elis Lulja <[email protected]>
In this commit the Reconcile function of the endpointslice controller is implemented and calculates the total number of endpoints for a service. Signed-off-by: Elis Lulja <[email protected]>
This commit prevents the endpointsliceReconciler from being started (actually, inited) if the user didn't enable the feature on settings. Also, it adds the annotation key in the base reconciler. Signed-off-by: Elis Lulja <[email protected]>
This commit updates all reconciler' Reconcile function to get and update the number of pods backing the service on the service registry. Signed-off-by: Elis Lulja <[email protected]>
A window is implemented, where values are inserted and kept in memory for a short time before updating service directory values. Signed-off-by: Elis Lulja <[email protected]>
c6578e3
to
f4933a3
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces the feature to watch for the number of pods backing a service by counting the number of
Endpoints
contained inside a service'sEndpointSlice
s.Whenever a change is detected, the operator registers the number of pods as a value in the service's metadata to the service registry. The key is configurable.
This depends from #37 and will be rebased once that is merged.
NOTE: This is a work in progress.