Repository navigation
feat(kubernetes): configure per-pool user namespaces - #4650
MichelJansen91 wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Expose the Talos setting api/apps/v1alpha1/kubernetesnodes/types.go, packages/apps/kubernetes-nodes/values.yaml, packages/apps/kubernetes-nodes/values.schema.json, packages/system/kubernetes-nodes-rd/cozyrds/kubernetes-nodes.yaml, packages/apps/kubernetes-nodes/README.md |
Adds talos.userNamespacesLimit with a default of zero to the Talos type and chart values. Exposes the setting in the application schema and dashboard ordering, and documents its behavior. |
Render and validate the limit packages/apps/kubernetes-nodes/templates/_talosconfigtemplate.tpl, packages/apps/kubernetes-nodes/tests/user_namespaces_test.yaml, hack/check-talosconfigtemplate-name-agreement.bats |
Rejects negative values and emits the sysctl only when the limit is positive. Tests check default and zero omission, positive-value rendering, validation, and TalosConfigTemplate reference changes. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Feature
Merge Risk: 
Minimal · up to bc639
-
The feature is internally consistent and introduces no established merge-blocking risk.
Pre-merge checks: 
5
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
|
MichelJansen91 this is a feature against release-1.6, and release branches only take backports. If you still want per-pool user namespaces, please retarget it to main. If there is no activity in the next two weeks, the stale bot will close it; reopening later is always fine. |
99be0f0 to
22a9329
Compare
|
Aleksei Sviridkin (@lexfrei) Thanks for pointing this out! The PR now targets main and the setting moved to KubernetesNodes. Tested the chart-generated setting on Talos 1.14.4: gVisor failed with the default limit, worked after enabling it, and failed again after removing it. Couldn’t test the worker rollout locally unfortunately. It seems that the emulated x86 setup on my Mac was too slow to get the test cluster running reliably. Would this scope make sense? |
The official Talos gVisor extension needs user namespaces enabled in the worker guest. Keep that hardening trade-off opt-in and scoped to one pool. Assisted-by: LLM Signed-off-by: Michel Jansen <[email protected]>
An unconfigured pool must retain its existing bootstrap config and hash. Render only a positive opt-in into the shared Talos template so CAPI and the reconciliation Job agree on the pool configuration. Assisted-by: LLM Signed-off-by: Michel Jansen <[email protected]>
Changing only a bootstrap template body does not roll existing Machines. Guard the changed MachineDeployment reference and matching Job permissions, including restoration of the default reference when the opt-in is removed. Assisted-by: LLM Signed-off-by: Michel Jansen <[email protected]>
22a9329 to
bc6390a
Compare
|
Fixed merge conflicts again |
|
MichelJansen91 I'd prefer universal Keys and values need render-time validation (or escaping like It is just my idea, I aim for scalable solution and other maintainers may see blockers for it. If you want to try, you can do it as a new PR replacing this one. |
Aleksei Sviridkin (lexfrei)
left a comment
There was a problem hiding this comment.
MichelJansen91 #5254 replaces this one: talos.sysctls covers user.max_user_namespaces and any later sysctl, and its description says so. Please close this PR so the two don't both get reviewed and merged. Both add a field to the same Talos type and the same TalosConfigTemplate block.
|
Closing with #5254 as replacement |
What this PR does
Adds the optional
KubernetesNodes.spec.talos.userNamespacesLimitsetting for a single worker pool. The official Talos gVisor extension requires user namespaces, which Talos disables by default as a KSPP hardening measure. This exposes only that prerequisite, not arbitrary sysctls or machine configuration.This branch is now based on
main. Worker pools on main are separate KubernetesNodes applications, so the feature lives inpackages/apps/kubernetes-nodes, rather than the release-1.6 Kubernetes nodeGroups API.machine.sysctls.user.max_user_namespacesinside this pool’s worker VMs. Negative values fail rendering.Validation
helm unittest packages/apps/kubernetes-nodes: 38 suites, 227 tests, 12 existing snapshots passed without updating snapshots.COZYTEST_TRACE=0 sh hack/cozytest.sh hack/check-talosconfigtemplate-name-agreement.bats: all 5 tests passed, including the new opt-in/zero test for matching Job, RBAC and MachineDeployment template names and changed/restored bootstrap references.make generatewith the CI-pinned cozyvalues-gen v1.7.0: generated schema, README, Go types and ApplicationDefinition; a repeated run left no diff.make generateandmake manifestscompleted without unrelated tracked changes.go test ./kubernetesnodesandgo vet ./kubernetesnodesin api/apps/v1alpha1 completed; this generated API package has no test files.No live-cluster rollout or gVisor execution was tested. Standalone
helm lintis blocked by the chart’s existing relative icon URL and cluster-dependent/default-release assumptions; the chart rendering is exercised by the tests above. gopls is unavailable locally, so Go validation used the compiler and vet instead.Downstream rollout
The downstream deployment is tracked in wherobv/whero-gitops#131. It must remain gated until a package containing this feature is installed, and must be adapted to the KubernetesNodes API before use on main. A release-1.6 backport would require a separate adaptation; this PR does not claim drop-in compatibility with the old nodeGroups path. Actual worker replacement and rollback still require staging-cluster validation.
Screenshots
Not applicable; no UI changes.
Downstream repositories
The remaining trigger-map entries are unaffected: no host prerequisites, package names, controller contracts, tooling or release conventions change.
Release note
Summary by CodeRabbit
0preserves Talos defaults.[]disables modules.