Policies

The kinds of policy, the engines they can use, and the pieces they all share.
KindWhat it doesWhen it runs
ClusterValidationPolicyAccepts or rejects an objectAdmission, before the object is stored
ClusterMutationPolicyPatches an objectAdmission, before the object is stored
ClusterGenerationPolicyCreates objectsBackground, after something is watched

The first two answer the API server. The third runs in the background, on the leader. That difference decides what each one can do, and it is the reason they are separate kinds.

Before writing one

The pieces all of them share are under Concepts.

Opting out

With --enable-special-labels, the requests Admitik receives carry a filter that leaves out any object with this label:

metadata:
  labels:
    admitik.dev/ignore-admission: "true"

It is off by default because it lets whoever can write a label skip every policy that intercepts the resource.


Validation

Reject an object with a message, or let it through with a warning.

Mutation

Patch an object before it is stored, and decide whether later policies see the result.

Generation

Write the objects that should exist because something else exists.

Clone

Copy an object into another namespace or another resource. In progress.

Cleanup

Delete objects that should no longer exist. In progress.