No description
- Go 78.5%
- Smarty 10.3%
- Makefile 7.4%
- Nix 3.8%
| .forgejo/workflows | ||
| api/v1alpha1 | ||
| cmd/rbac-controller | ||
| config | ||
| deploy/charts | ||
| examples | ||
| internal | ||
| .envrc | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .goreleaser.yaml | ||
| Dockerfile.rbac.goreleaser | ||
| flake.nix | ||
| go.mod | ||
| go.sum | ||
| Makefile | ||
| README.md | ||
| renovate.json | ||
rbac-controller-manager
A kcp-native controller that gives edge-connect its own RBAC API surface
(rbac.edge-connect.eu/v1alpha1) and materialises it onto kcp's native RBAC
primitives.
What it does
- ClusterRoleBinding → KCP ClusterRoleBinding. Reconciles cluster-scoped
ClusterRoleBindingCRs across every workspace bound to theclusterrolebindingsAPIExport and materialises each one as a native KCPClusterRoleBinding. Subject names are written in plain form by authors; the controller transparently prepends theoidc:prefix so KCP RBAC sees the identities produced by the workspace authentication configuration.
The ClusterRoles referenced by spec.role (org: owner/read; sub-workspace:
workspace-owner/workspace-contributor/workspace-reader) are precreated
externally and are not managed by this controller.
Layout
| Path | Responsibility |
|---|---|
api/v1alpha1 |
ClusterRoleBinding API types + scheme |
cmd/rbac-controller |
manager entrypoint (apiexport provider + reconciler) |
internal/controller/clusterrolebinding |
ClusterRoleBinding → KCP ClusterRoleBinding reconciler |
internal/subject |
oidc: subject prefixing (pure) |
examples |
sample ClusterRoleBinding and APIBinding manifests |
config/crd, config/kcp |
generated CRD and kcp APIResourceSchema |
deploy/charts/rbac-controller |
workload Deployment + host RBAC |
deploy/charts/rbac-controller-kcp |
APIResourceSchema, APIExport, consumer RBAC |
Development
make all # generate deepcopy + CRD + kcp schemas
make test # unit tests (regenerates code first)
make build # build ./cmd/rbac-controller
make helm-lint
The controller authenticates to the kcp front-proxy with the kubeconfig at
$KCP_KUBECONFIG (mounted by the chart). --endpointslice (default
clusterrolebindings) must match the deployed APIExport name.
Notes / limitations
- Single replica only: leader election is not yet wired up, so
replicaCount > 1is unsupported. - The materialised native
ClusterRoleBindingcarries an owner reference to the cluster-scopedClusterRoleBindingCR, so Kubernetes garbage collection cleans it up automatically on deletion (no finalizer required). - The referenced
ClusterRoles are precreated externally; aspec.rolethat names a missing role still produces a binding (operators own role lifecycle). - Role rules use broad wildcards for the PoC; tightening is deferred.