Files
alex bezek 3187082b0e RBAC overhaul (#804)
* docs: add RBAC overhaul design spec and requirements

Captures the motivation, constraints, and design decisions for the RBAC
overhaul before the implementation changes land.

* refactor(rbac): remove kubebuilder RBAC markers and disable controller-gen RBAC output

RBAC is now defined explicitly in Helm templates rather than generated
from code annotations. Removes all +kubebuilder:rbac markers from
controllers and drain.go, and drops the rbac output target from
controller-gen so it no longer clobbers the Helm-managed files.

* refactor(rbac): reorganize operator component RBAC into per-component Helm templates

Replaces the monolithic controller-rbac.yaml and per-component rbac.yaml
files with a consistent per-component directory structure (agent/,
api-manager/, bindings-forwarder/). Each component now owns its own
Role, RoleBinding, and optional namespace-scoped variants.

Key changes:
- agent: split rbac.yaml into role.yaml + rolebinding.yaml with
  optional namespaced variants for namespace-scoped installs
- api-manager: moved from templates/rbac/role.yaml into dedicated
  api-manager/ directory alongside its other templates; adds
  leader-election-role.yaml and namespaced role support
- bindings-forwarder: renamed rbac.yaml -> role.yaml for consistency
- Deleted controller-rbac.yaml (replaced by api-manager/role.yaml)
- Renamed controller-{cm,deployment,pdb,serviceaccount}.yaml into
  api-manager/ directory for cohesion
- Renamed service-account.yaml -> serviceaccount.yaml everywhere
- values.yaml/schema: adds crdAccessRoles and per-component RBAC flags

* feat(rbac): add CRD editor/viewer ClusterRoles for ngrok resources

Moves existing editor/viewer roles into a dedicated rbac/crd-access/
subdirectory with consistent naming, and adds new roles for
NgrokTrafficPolicy (previously missing).

These ClusterRoles are for users of the operator — granting cluster
members read or write access to ngrok CRDs — as opposed to the
operator's own service account permissions.

* test(rbac): update Helm unit tests and add chainsaw e2e RBAC verification

Updates all Helm unit tests and snapshots to match the reorganized
template structure (per-component directories, renamed files). Adds
new test suites for api-manager RBAC and crd-access roles.

Also adds a chainsaw e2e test that verifies the operator's service
accounts have exactly the permissions they need — no more, no less.

* chore: update generated artifacts after RBAC overhaul

Regenerates manifest-bundle.yaml and updates the Helm README to
reflect the new values added for per-component RBAC configuration.

* remove plan and chainsaw tests and make bindings not try to use watchNamespace

* break out k8soperator permissions and bindings permissions to separate role

* update requirements and gen manifest bundle

* make agent and api manager only query their release namespace when looking for the kubernetesoperator crd

* make bindings role always be created even if bindings is disabled
2026-05-06 18:42:34 +00:00
..
2026-05-06 18:42:34 +00:00
2026-05-06 18:42:34 +00:00
2026-05-06 18:42:34 +00:00
2026-03-23 16:50:43 +00:00
2026-03-23 16:50:43 +00:00
2026-05-06 18:42:34 +00:00
2026-05-06 18:42:34 +00:00