Skip to content
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

feat: policy optimizer #519

Draft
wants to merge 8 commits into
base: feat-policy-optimizer
Choose a base branch
from

Conversation

flavio
Copy link
Member

@flavio flavio commented Aug 10, 2023

This PR introduces a new cli tool called policy-optimizer. This binary will download the policies and optimize them. The goal is to implement what is described inside of this RFC.

Currently the code doesn't do any download/optimization. It just leverages the Lease primitive declared by Kubernetes to ensure only one process can have write access to the directory where the optimized policies are going to be written.
The actual code similates the download & optimize work with a simple sleep.

The change is pretty invasive as you can see, I don't want to merge it in the main branch yet.

Move policy-server to a sub-crate. This makes possible to handle a rust
project which delivers multiple binaries.

Signed-off-by: Flavio Castelli <[email protected]>
Prepare the repo layout to accomodate for the policy-optimizer binary

Signed-off-by: Flavio Castelli <[email protected]>
Now that we moved to a cargo workspace, the lock file is handled at the
root of the workspace. Meaning `crates/policy-server/Cargo.lock` is
no longer used.

Signed-off-by: Flavio Castelli <[email protected]>
Update the local Dockerfile to add the policy-optimizer binary to it.

Signed-off-by: Flavio Castelli <[email protected]>
Declare the shared dependencies of policy-server and policy-optimizer in
a single place.

Signed-off-by: Flavio Castelli <[email protected]>
Add the initial implementation of policy-optimizer. Right now the code
use the Lease objects to ensure only one policy-optimizer process can
write to the shared storage.

Right now no real work is done, the code just enters a long sleep. This
is enough to test if this approach works as we expect.

Signed-off-by: Flavio Castelli <[email protected]>
@flavio flavio requested a review from a team as a code owner August 10, 2023 15:49
@flavio flavio mentioned this pull request Aug 10, 2023
@flavio flavio changed the title Feat policy optimizer feat: policy optimizer Aug 10, 2023
@flavio flavio marked this pull request as draft August 10, 2023 15:57
Consume latest stable release of kubert, this triggers some other
updates to ensure the same version of k8s-openapi is used

Signed-off-by: Flavio Castelli <[email protected]>
Ensure lint tests are done against the whole workspace

Signed-off-by: Flavio Castelli <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants