liqo icon indicating copy to clipboard operation
liqo copied to clipboard

Liqo Controller Manager: ShadowPod validating webhook

Open cannarelladev opened this issue 2 years ago • 21 comments

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

cannarelladev avatar May 03 '22 15:05 cannarelladev

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 option test=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

adamjensenbot avatar May 03 '22 15:05 adamjensenbot

/build

cannarelladev avatar Jun 21 '22 08:06 cannarelladev

/build

cannarelladev avatar Jun 22 '22 09:06 cannarelladev

/build

cannarelladev avatar Jun 25 '22 14:06 cannarelladev

/build

cannarelladev avatar Jul 10 '22 18:07 cannarelladev

/build

cannarelladev avatar Jul 12 '22 10:07 cannarelladev

/build

cannarelladev avatar Jul 12 '22 12:07 cannarelladev

/build

cannarelladev avatar Jul 13 '22 07:07 cannarelladev

/build

cannarelladev avatar Jul 18 '22 10:07 cannarelladev

/build

cannarelladev avatar Jul 18 '22 13:07 cannarelladev

@giorio94 when you are available i leaved 3 question on your review comments

cannarelladev avatar Jul 26 '22 09:07 cannarelladev

waiting for another pipe of comments 😄 @giorio94 . The new challenge is to stay behind 1000 adding code lines

cannarelladev avatar Aug 02 '22 13:08 cannarelladev

/build

cannarelladev avatar Aug 02 '22 13:08 cannarelladev

/build

cannarelladev avatar Aug 12 '22 07:08 cannarelladev

/build

cannarelladev avatar Aug 12 '22 07:08 cannarelladev

/build

cannarelladev avatar Aug 16 '22 08:08 cannarelladev

PTAL @giorio94

cannarelladev avatar Aug 16 '22 16:08 cannarelladev

/build

cannarelladev avatar Aug 16 '22 16:08 cannarelladev

/test

cannarelladev avatar Sep 04 '22 23:09 cannarelladev

/test

cannarelladev avatar Sep 16 '22 07:09 cannarelladev

/test

cannarelladev avatar Sep 16 '22 09:09 cannarelladev

/test

cannarelladev avatar Sep 29 '22 07:09 cannarelladev

/test

cannarelladev avatar Sep 30 '22 07:09 cannarelladev

/test

cannarelladev avatar Sep 30 '22 08:09 cannarelladev

/test

cannarelladev avatar Sep 30 '22 12:09 cannarelladev

/test

cannarelladev avatar Sep 30 '22 13:09 cannarelladev

/test

cannarelladev avatar Oct 01 '22 14:10 cannarelladev

/test

cannarelladev avatar Oct 01 '22 14:10 cannarelladev