Skip to content

[fix] Support non-root Doris startup and deployment preflight - #568

Open
morningman wants to merge 4 commits into
apache:masterfrom
morningman:fix/non-root-k8s-preflight
Open

morningman wants to merge 4 commits into
apache:masterfrom
morningman:fix/non-root-k8s-preflight

Conversation

@morningman

@morningman morningman commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Run the Operator-managed BE default init with explicit root credentials, even when it shares a non-root BE image. The initializer raises a low vm.max_map_count and checks for active swap before trying to disable it.
  • Add systemInitMode for BE, CN, and disaggregated Compute. Operator uses the privileged default init and NodePrepared uses administrator-prepared nodes. Both explicit modes keep BE startup checks enabled. The existing skipDefaultSystemInit: true path still removes the init and sets SKIP_CHECK_ULIMIT=true.
  • Add dorisctl preflight with API-server dry-run, optional node and network probes, disposable PVC probes, and JSON output. Probes preserve resource quota inputs, verify runtime identity and storage evidence, and clean up temporary objects using their original UIDs. Unresolved Operator or image capabilities are reported as pending.
  • Render component security contexts and initialization settings in Helm, align the Operator RBAC, package the disaggregated chart, and add standalone CLI archives with SHA-512 checksums.

Upgrade and release impact

This PR establishes the node-init and Preflight baseline for #560. Existing root deployments can keep their startup settings when updating the Operator and CRDs. Kubernetes namespaces that prohibit privileged init containers can use NodePrepared once the node settings and BE startup limits are in place. Existing PVC migration, image-identity-aware template generation, and the optional CPU helper are covered by #560.

Verification

  • Full go test -count=1 ./... passed on bc8f292 with Go 1.23.6 and Kubernetes 1.26.1 envtest assets.
  • On the combined candidate in [Feature] Support non-root Doris images, PVC upgrades and an optional privileged helper #560, verified the final API and RBAC, Helm archives, standalone CLI archives for Linux and macOS on amd64 and arm64, and temporary Pod cleanup after timeout and SIGINT.
  • Real Kubernetes upgrade and storage validation remains part of post-merge release qualification.

morningman added 2 commits December 3, 2026 00:05
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.
@Al-assad

Al-assad commented Dec 4, 2026

Copy link
Copy Markdown
Member

Thanks for working on this PR — especially the systemInitMode (Operator | NodePrepared) design, idempotent default-init, Helm passthrough, and dorisctl preflight.

To keep our CRD surface minimal and avoid overlapping semantics between this PR and #560, here is a proposed coordination plan:

1. Merge order & CRD alignment

Let's merge #568 first, and then I will rebase and refactor #560 on top of it:

  • [fix] Support non-root Doris startup and deployment preflight #568 establishes:
    • Component-level systemInitMode (Operator | NodePrepared, preserving legacy skipDefaultSystemInit compatibility and BE startup checks under NodePrepared) and the idempotent root default-init (vm.max_map_count < 2000000).
    • Helm chart non-root passthrough and the helm-release.yaml packaging fix.
    • The dorisctl preflight baseline.
  • [Feature] Support non-root Doris images, PVC upgrades and an optional privileged helper #560 (after rebasing onto [fix] Support non-root Doris startup and deployment preflight #568) will:
    • Remove spec.enablePrivilegedHelper so we only introduce one new CRD field (systemInitMode) across both PRs, keeping one-off node initialization cleanly decoupled from the long-running WorkloadGroup cgroup sidecar.
    • Reuse the existing component-level enableWorkloadGroup field: root images keep existing privileged BE behavior, while non-root images automatically attach doris-cgroup-helper when enableWorkloadGroup: true.
    • Keep automatic image UID/GID detection, exclusive PVC ownership migration, and non-root securityContext hardening — and run ApplyBESystemInit after image UID detection so non-root images without explicit securityContext also default to NodePrepared.
    • Update dorisctl preflight (and unify the non-root docs) to recognize image UID auto-detection, PVC migration, and non-root enableWorkloadGroup via doris-cgroup-helper (instead of unconditionally reporting BLOCKED).

2. A few items to confirm before merging #568

I noticed a few small issues in dorisctl preflight:

  1. FE/MS identity probes and temporary PVC probe pods still hardcode 10001:10001 instead of using the resolved/configured UID/GID.
  2. Probe pods clear resources, which can cause false BLOCKED results in namespaces enforcing ResourceQuota without a default LimitRange.
  3. The legacy Operator version check only matches 26.0.0 / 26.0.1 and misses older versions (e.g., 25.8.0).
  4. PVC annotations are handled inconsistently between DorisCluster and DorisDisaggregatedCluster.

Let me know if you'd like to fix these in #568 before merging, or if you'd prefer to merge #568 as-is and have me address them together when updating preflight in #560.

(Also a quick note: #563 from the community addresses #562 as well — let's make sure we coordinate or credit it properly when landing #568.)

Does this plan look good to you?

morningman pushed a commit to Al-assad/selectdb-doris-operator that referenced this pull request Dec 4, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants