liqo
liqo copied to clipboard
Liqo Controller Manager: ShadowPod validating webhook
Description
In a "two-cluster" peering scenario, where one Cluster plays the role of "Customer" and the other one of "Cloud Provider", it is important for the two entities that the Resource plan agreed is as much as possible guaranteed and controlled.
- The Cloud Provider has the need to control what happen in own cluster, that resource usage limits agreed are respected (also with a toleration) and that nothing exceeds the Offer provided
in the other hand
- The Customer wants that the ResourceOffer Plan "buyed" is always guaranteed (also with a toleration) respecting what has been agreed at the beginning, it has the need to be protected about what is defined in kind of "resource contract"
The goal of a Resource Validator system is to manage all this requirements, defining a new optional way of peering between clusters
What's needed
This PR introduces some new elements to allow the management of "Customer" offloaded resources on host cluster (that ideally represents a Cloud Provider)
- [x] Validating Webhook for incoming ShadowPods based on existing ResourceOffer
- [x] Used/Free resources calculator after each Offloading Request / Deletion
- [x] Cached information to decrease the overhead generated by each validation check after an Offloading Request
- [x] Cache mutex for concurrent access
- [x] Scheduled cache consistency refresh
TODO
- [x] improve cache data structure
- [x] Improve logging using klog
Hi @cannarelladev. Thanks for your PR!
I am @adamjensenbot. You can interact with me issuing a slash command in the first line of a comment. Currently, I understand the following commands:
-
/rebase
: Rebase this PR onto the master branch (You can add the optiontest=true
to launch the tests when the rebase operation is completed) -
/merge
: Merge this PR into the master branch -
/build
Build Liqo components -
/test
Launch the E2E and Unit tests -
/doc-build
Trigger the build of the Liqo documentation
Make sure this PR appears in the liqo changelog, adding one of the following labels:
-
kind/breaking
: :boom: Breaking Change -
kind/feature
: :rocket: New Feature -
kind/bug
: :bug: Bug Fix -
kind/cleanup
: :broom: Code Refactoring -
kind/docs
: :memo: Documentation
/build
/build
/build
/build
/build
/build
/build
/build
/build
@giorio94 when you are available i leaved 3 question on your review comments
waiting for another pipe of comments 😄 @giorio94 . The new challenge is to stay behind 1000 adding code lines
/build
/build
/build
/build
PTAL @giorio94
/build
/test
/test
/test
/test
/test
/test
/test
/test
/test
/test