implement policy + binding policy k8s operator CRDs - #4047
Conversation
Soffi AI SummaryThis PR introduces two new Kubernetes CRD types — Motivation: Platform teams need a Kubernetes-native way to define and bind policies (e.g., OPA/Kyverno-style admission rules) to clusters without manual API calls. By encoding these as CRDs, operators can manage policy lifecycle declaratively in Git and have the controller reconcile them to the Console server via GraphQL — consistent with how other Console resources (e.g., What was added:
Commits
Updated: 2026-08-25 13:25 UTC |
Greptile SummaryAdds cluster-scoped Policy and BindingPolicy Kubernetes API types, generated CRDs, deepcopy support, packaged chart artifacts, and Console client operations.
Confidence Score: 4/5The PR should not merge until Policy and BindingPolicy reconcilers are implemented and registered, because the shipped CRDs currently accept resources that are never processed. Both kinds are installed and registered in the API scheme, but controller startup relies on explicit reconciler factories and watches that this change does not provide, leaving every created resource permanently unsynchronized. Files Needing Attention: go/controller/api/v1alpha1/bindingpolicy_types.go, go/controller/api/v1alpha1/policy_types.go, and go/controller/cmd/register.go
|
| Filename | Overview |
|---|---|
| go/controller/api/v1alpha1/bindingpolicy_types.go | Defines and registers BindingPolicy, but the resource has no reconciler or manager watch to enact its desired state. |
| go/controller/api/v1alpha1/policy_types.go | Defines and registers Policy, but the resource has no reconciler or manager watch to synchronize it with Console. |
| go/controller/internal/client/bindingpolicy.go | Adds the expected BindingPolicy Console client operations, although no controller currently calls them. |
| go/controller/internal/client/policy.go | Adds Policy lookup and mutation wrappers, including Kubernetes-style not-found conversion. |
| charts/controller/crds/deployments.plural.sh_bindingpolicies.yaml | Ships a served BindingPolicy CRD that Kubernetes accepts despite the absence of a controller for it. |
| charts/controller/crds/deployments.plural.sh_policies.yaml | Ships a served Policy CRD that Kubernetes accepts despite the absence of a controller for it. |
Reviews (1): Last reviewed commit: "implement policy + binding policy k8s op..." | Re-trigger Greptile
michaeljguarino
left a comment
There was a problem hiding this comment.
are the controllers not implemented?
| } | ||
|
|
||
| // BindingPolicyMatches defines the criteria used to select targets for a BindingPolicy. | ||
| type BindingPolicyMatches struct { |
There was a problem hiding this comment.
I believe this is missing the stack fields on this structure.
almost ready |

Test Plan
Test environment: https://console.your-env.onplural.sh/
Checklist
Plural Flow: console