Watch number of pods backing a service#38
Draft
asimpleidea wants to merge 15 commits intoCloudNativeSDWAN:masterfrom
Draft
Watch number of pods backing a service#38asimpleidea wants to merge 15 commits intoCloudNativeSDWAN:masterfrom
asimpleidea wants to merge 15 commits intoCloudNativeSDWAN:masterfrom
Conversation
Utils contains options to define the behavior of the controllers and functions used by the controllers. Signed-off-by: Elis Lulja <elulja@cisco.com>
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 <elulja@cisco.com>
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 <elulja@cisco.com>
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 <elulja@cisco.com>
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 <elulja@cisco.com>
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 <elulja@cisco.com>
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 <elulja@cisco.com>
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 <elulja@cisco.com>
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 <elulja@cisco.com>
This commit adds the EndpointSliceReconciler and makes it inherit the BaseReconciler. Signed-off-by: Elis Lulja <elulja@cisco.com>
This commit updates the roles with proper permissions to perform operations on endpointslices on Kubernetes. Signed-off-by: Elis Lulja <elulja@cisco.com>
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 <elulja@cisco.com>
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 <elulja@cisco.com>
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 <elulja@cisco.com>
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 <elulja@cisco.com>
c6578e3 to
f4933a3
Compare
This file contains hidden or 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
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
Endpointscontained inside a service'sEndpointSlices.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.