Skip to content

Commit eaf2129

Browse files
feat(go/v4): add namespace-scoped manager support
Add --namespaced flag to scaffold managers that watch only specific namespace(s), enabling least-privilege deployments and multi-tenant architectures. Changes: - Add --namespaced flag to init and edit commands - Scaffold Role/RoleBinding instead of ClusterRole/ClusterRoleBinding - Add WATCH_NAMESPACE environment variable to manager deployment - Add helper functions in cmd/main.go (getWatchNamespace, setupCacheNamespaces) - Controllers automatically get namespace parameter in RBAC markers - Support converting existing projects with 'kubebuilder edit --namespaced=true' - Add comprehensive migration guide and reference documentation - Add e2e test validating namespace isolation behavior - Add integration test validating scaffolding correctness - Update testdata project to demonstrate namespace-scoped configuration Assisted-by: Cursor/Claude
1 parent 899cfec commit eaf2129

File tree

66 files changed

+1970
-265
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1970
-265
lines changed

docs/book/src/SUMMARY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
- [Step 2: Discovery Commands](./migration/discovery-commands.md)
5454
- [Step 3: Port Code](./migration/port-code.md)
5555
- [Single Group to Multi-Group](./migration/multi-group.md)
56+
- [Cluster-Scoped to Namespace-Scoped](./migration/namespace-scoped.md)
5657

5758
- [Alpha Commands](./reference/alpha_commands.md)
5859

@@ -92,6 +93,8 @@
9293
- [Monitoring with Pprof](./reference/pprof-tutorial.md)
9394

9495
- [Manager and CRDs Scope](./reference/scopes.md)
96+
- [Manager Scope](./reference/manager-scope.md)
97+
- [CRD Scope](./reference/crd-scope.md)
9598

9699
- [Sub-Module Layouts](./reference/submodule-layouts.md)
97100
- [Using an external Resource / API](./reference/using_an_external_resource.md)

0 commit comments

Comments
 (0)