-
Notifications
You must be signed in to change notification settings - Fork 25
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
global context proposal #47
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
I can't find the resource cache proposal in the KDP. |
Oops...forgot to add the file! As they say, good design is invisible :-) Added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like it may also be a good idea to register a new metric which indicates how many total cache informers exist at a given time to assist users (and maintainers) in troubleshooting.
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
Ooops, I missed that, will look at it next week ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will happen if a resourceCache context variable is declared yet there are no corresponding resources in the cache? Does the context var fail to be evaluated, does it evaluate automatically to []
, something else?
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
proposals/resource_cache.md
Outdated
|
||
### Metrics | ||
|
||
It would be useful to add cache metrics for observability and troubleshooting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Especially cache size would be very important. With this current proposal I see the risk of Kyverno Policies being created which have a large influence on overall cache size.
proposals/resource_cache.md
Outdated
API calls do not leverage caching by default. | ||
|
||
If needed, we can add a separate caching mechanism for API calls in the future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating drawbacks of this approach
API calls do not leverage caching by default. | |
If needed, we can add a separate caching mechanism for API calls in the future. | |
1. API calls do not leverage caching by default. If needed, we can add a separate caching mechanism for API calls in the future. | |
2. Using `cache.kyverno.io/enabled: "true"` can cause issues when users forgets to add them to the resource. | |
1. It is easy to miss a resource when adding the label. `apiCall` will return all the resources of the given type while `resourceCache` will return only those resources that have the label. In case of 1-10k resources. | |
2. Users might not want to have a kyverno specific label in all their resources across all namespaces. | |
3. For the usecase mentioned in [motivation](#motivation), we need to add resource to the cache when the policies is applied, otherwise, when the resource is applied for the first time, it will fail because of the timeout like it currently does. This will take away the abilities to have substitutions in `resourceCache` (e.g. `namespace: "{{request.namespace}}"`) and the `resourceCache` field will have to be static. |
Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Signed-off-by: shuting <shuting@nirmata.com>
Signed-off-by: shuting <shuting@nirmata.com>
Signed-off-by: shuting <shuting@nirmata.com>
Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
feat: update resource-cache KDP
Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com> Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com> Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com> Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com> Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: Jim Bugwadia <jim@nirmata.com> Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: Jim Bugwadia <jim@nirmata.com> Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: Jim Bugwadia <jim@nirmata.com> Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
fix: update resource cache proposal to global context
|
||
Users can manage which resources to cache by creating a new custom resource called `GlobalContextEntry` provided by Kyverno. This will decouple the creation and usage of a global entry. | ||
|
||
A `GlobalContextEntry` will can be either of the following types: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A `GlobalContextEntry` will can be either of the following types: | |
A `GlobalContextEntry` can be either of the following types: |
The two things I, as a user, really need answered here are:
|
|
|
We could edit the response of the APICall. But it would be hacky as sometimes it will be a list sometimes not. Depending on the query. |
No description provided.