freepik-company / admitik

A dynamic Kubernetes admission controller that validates or modifies resources based on conditions you define using Helm templates.
Apache License 2.0
10 stars 0 forks source link

Supervise Existing Policies Before Validating New Deployments #2

Open ElMarioVI opened 2 weeks ago

ElMarioVI commented 2 weeks ago

Currently, Admitik validates or modifies Kubernetes resources based on conditions defined through Helm templates. However, we need to extend functionality to ensure policies are audited and supervised on already deployed resources before validating any new deployments.

Requirements:

This enhancement will enable more proactive and comprehensive policy management across both existing and future resources in the cluster.

achetronic commented 1 week ago

Hi there @ElMarioVI !

How are your expectations on this feature? (the expected behavior, etc)

Currently, the ClusterAdmissionPolicy supports two modes: Enforce and Permissive, and for each captured watched resource, it triggers a request against a webserver that process the conditions, and decides if it's accepted or not to enter

During the conditions evaluation, several useful things are injected, such as .object or .oldObject (in case of updates), so this allows you to compare it against even the rest of all the resources of the same kind.

Let's talk about your request. From my POV, if it needs to run in the background periodically or so, we can not inject mentioned objects, as they don't exist. That being said, we could inject the .sources in the same way, so you should iterate on them, and perform actions to have such a report, or similar as an output. May be it should be a different resource, something as ClusterPeriodicReviewPolicy or something similar.

It that what you expect or covering your needs? what is the use case you detected?