-
Notifications
You must be signed in to change notification settings - Fork 2
Admission controller doc #69
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
base: main
Are you sure you want to change the base?
Conversation
| * Utilize **`ValidatingAdmissionPolicy` (CEL)** for *stateless, context-aware* validation that needs access to `oldObject.status` or `request.userInfo`. | ||
| * Provide clear, actionable error messages at admission time. | ||
| * Support multiple certificate management strategies (cert-manager and self-contained). | ||
| * Keep webhook logic in the `data-handler` module. |
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 is the distinction of the data-handler and why here instead of resource-handler?
|
|
||
| * **Pros:** Automatic certificate generation, renewal, and CA bundle injection. Industry standard. | ||
| * **Cons:** Adds a runtime dependency on `cert-manager`. | ||
| * **Implementation:** Ship `Certificate` and `Issuer` manifests in `config/webhook/cert-manager`. |
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.
how would we prevent the webhook from registering before the certs are ready? For example, the api server tries to call the webhook (MultiCluster CREATE/DELETE) before certs are generated
…idation This commit updates the `admission-controller-and-defaults.md` design document to include the specific logic required for the v1alpha1 System Catalog implementation. **Changes:** * **Level 2 (CEL):** Added explicit `XValidation` rules to enforce the v1alpha1 topology constraints (Single-Database `postgres` only) and the Mandatory Default TableGroup rule (`size() == 1`). * **Level 4 (Mutation):** Detailed the "System Catalog Injection" logic within the Mutating Webhook. This ensures that empty `spec.databases` or `tableGroups` lists are automatically hydrated with the mandatory `postgres` and `default` resources before hitting the API server. * **Test Plan:** Updated integration tests to verify that `MultigresCluster` creation correctly injects these system resources when they are omitted from the spec.
Establishes a 4-tier admission control architecture (OpenAPI, Embedded CEL, ValidatingAdmissionPolicy, Webhook) to handle validation and defaulting. Key design points: - Solves "Invisible Defaults" via a Shared Resolver pattern used by both the Webhook (persistence) and Controller (in-memory fallback). - Defines stateful validation rules for Template referential integrity. - Adds backward compatibility strategy for K8s < 1.30: The Webhook will redundantly implement critical ValidatingAdmissionPolicy logic (e.g., Read-Only Child resources) to support older clusters. - Updates drawbacks to reflect the maintenance cost of this temporary logic duplication.
A document detailing defaults, controller logic and where to apply it.