Repository navigation
Conversation
Resolve the effective image UID/GID before reconciling Doris workloads and preserve root images. Migrate dedicated root-owned PVCs with a limited, non-privileged root initializer before switching to non-root. Keep migration state across retries and explicitly clear it through StatefulSet metadata merges on a subsequent same-user image upgrade. Add enablePrivilegedHelper, default false, to DCR and DDC. Delegate a BE-owned threaded CPU cgroup through a privileged native sidecar without elevating the Doris container or changing parent limits. Include process-generation checks, restart handling, volume checks, CRD/RBAC updates, and operator documentation. Validation: Go tests including envtest pass. On k3s, fresh non-root, root-to-root, legacy Operator root-to-non-root adoption, and non-root image updates preserve data. Real WG loads enforce 20/60 percent CPU quotas; helper and BE restarts and helper removal pass. Threaded cgroups expose an existing Doris memory-detection bug; enabling the helper requires the companion Doris fix.
Delegate the container domain through the Doris query path so existing BE images retain memory accounting while WG worker threads use CPU cgroups. Derive the default core count from container quota and affinity, preserve root system initialization behind the helper switch, and handle nodes with no active swap. Validated with full Go tests and hs runs of unmodified PR 70821 FE/BE: memory limits, real WG CPU quotas, helper/main restarts, and non-root identity. Document storage migration and node prerequisites.
Share the system init policy between BE, CN, Compute and Preflight. Keep legacy startup behavior and allow supported identities to use prepared nodes without skipping startup checks. Align the soft nofile check with the Doris 4.1.5 startup script and verify that selecting prepared nodes removes the old default init from the StatefulSet.
Integrate PR apache#568 with apache#560 while preserving legacy StatefulSet adoption and root workload groups. Resolve source and target identities independently and retain the verified migration image across retries.
Contributor
|
I pushed
|
added 7 commits
December 4, 2026 20:28
Limit ownership repair to verified dedicated PVCs, persist per-ordinal progress, and support externally prepared migrations and rollback with VerifyOnly.
Check restartable init admission before rollout, preserve the container memory domain, and derive default core counts from affinity and inherited CPU quotas. Keep legacy root workloads on their existing startup path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Switching an existing root Doris image to a non-root image can leave the new process unable to read or write its existing PVC. Workload-group CPU control also currently relies on making the BE container itself privileged.
This PR supports image-defined runtime identities, staged Operator adoption, and PVC permission migration. It also adds optional CPU cgroup delegation for non-root workloads.
Related PRs: #568 (node initialization and Preflight baseline), apache/doris#70821 (non-root runtime images).
Implementation
systemInitModeafter resolving the component identity. Non-root workloads default toNodePreparedwith BE startup checks enabled. The cluster-levelspec.enablePrivilegedHelperdefaults tofalseand controls CPU delegation independently. Root workloads retain their existingenableWorkloadGroupbehavior.volumePermissionMigrationto selectAutoorVerifyOnly. Automatic root-to-non-root repair is scoped to verified dedicated writable PVCs.VerifyOnlychecks storage as the target user after external preparation and supports an explicit, verified reverse direction. Shared and external PVCs receive verification only.num_coresfrom affinity and the applicable CPU quotas. Keep explicit positive values.Release note
Support staged migration to non-root Doris images. Upgrade the Operator, CRDs, and RBAC first, then switch images during a planned migration window. The Operator can repair eligible dedicated PVCs or verify externally prepared storage. The optional CPU helper requires restartable init sidecars, Linux cgroup v2, a supported systemd/containerd layout, and namespace admission that allows its privileges.
Validation at the current head
go test ./...passed on51e7638with Go 1.23.6 and Kubernetes 1.26.1 envtest assets. Local coverage includes migration cancellation and rollback, helper startup and restart logic, and final Preflight templates.Check List (For Author)
docs/non-root-runtime.mdanddoc/non-root-k8s-preflight.md.Earlier validation
go test ./...passed with Kubernetes 1.31.0 envtest assets; generated CRDs/deepcopy andgit diff --checkverified.bb46752e8df051f7cfa7e6ba45166dd4945e322f.cpu.max/memory.max. Actual concurrent queries with 20%/60% WG CPU quotas consume approximately 0.395/1.185 cores under a 2-core parent quota.Current-source FE/BE were built from the related PR without additional BE changes (ASAN build). Full cluster deployment tests cover DCR FE/BE; DDC/CN/Broker integration is covered by code and unit tests.
Root compatibility retest at
de7349e(Linux amd64, single-node K3s, cgroup v2):Check List (For Reviewerwho merge this PR)