Skip to content

feat(openshift): add SCC-managed deployment profile - #216

Merged
GatewayJ merged 1 commit into
rustfs:mainfrom
GatewayJ:feat/openshift-platform-delivery
Aug 5, 2026
Merged

feat(openshift): add SCC-managed deployment profile#216
GatewayJ merged 1 commit into
rustfs:mainfrom
GatewayJ:feat/openshift-platform-delivery

Conversation

@GatewayJ

@GatewayJ GatewayJ commented Aug 2, 2026

Copy link
Copy Markdown
Member

Type of Change

  • New Feature
  • Bug Fix
  • Documentation
  • Performance Improvement
  • Test/CI
  • Refactor
  • Other:

Related Issues

Part of #206. Depends on #215 for Tenant workload delegation. The RBAC repair is split into #214.

Summary of Changes

  • add an opt-in openshift.enabled Helm value, defaulting to false
  • omit chart-managed Pod and container security contexts from Operator, Console, and optional split frontend Deployments when enabled, allowing SCC to assign runtime identities
  • add a MinIO-style Tenant example using the paired empty security-context contract
  • document restricted-v2 scope, arbitrary-UID image requirements, upgrade ordering, preflight inventory, rollout behavior, storage risks, and rollback constraints in English and Chinese
  • add values-schema and manifest contract tests

Checklist

  • I have read and followed the CONTRIBUTING.md guidelines
  • Passed make pre-commit (fmt-check + clippy + test + console-lint + console-fmt-check)
  • Added/updated necessary tests
  • Documentation updated (if needed)
  • CHANGELOG.md updated under [Unreleased] (if user-visible change) — N/A; this repository does not currently contain CHANGELOG.md
  • CI/CD passed (if applicable)

Impact

  • Breaking change (CRD/API compatibility)
  • Requires doc/config/deployment update
  • Other impact: default-off OpenShift installation profile; enabling it rolls control-plane Deployments

Update impact

  • Default behavior is unchanged. Existing installations and upgrades with openshift.enabled=false render the current fixed Operator/Console security contexts.
  • Enabling the profile changes the Pod templates and rolls the Operator and Console Deployments. It does not directly rewrite Tenant or PVC API objects.
  • The optional split frontend also omits its container security context when enabled, but the stock nginx image has not been verified for arbitrary UID, writable runtime paths, and unprivileged port binding. Keep it disabled until a compatible image is supplied and tested.
  • Tenant workload delegation requires feat(operator): delegate paired empty security contexts #215. Applying the example before a controller containing feat(operator): delegate paired empty security contexts #215 leaves the old 10001 behavior in place.
  • After feat(operator): delegate paired empty security contexts #215, converting an existing Tenant/Pool to the paired {}/{} form rolls the affected StatefulSet. A changed SCC-assigned FSGroup can trigger first-mount ownership work; large volumes can start slowly, and incompatible CSI/root-squash permissions can fail.
  • The upgrade order is: inventory existing paired empty objects, apply the CRDs, upgrade the Chart with openshift.enabled=true, wait for Operator/Console rollout, validate SCC/image/storage prerequisites, then migrate Tenant manifests in a maintenance window.
  • Disabling the profile or rolling back reintroduces fixed Operator/Console identities and rolls those Deployments. Do so only when the namespace SCC permits the fixed IDs.

OpenShift release blockers and support boundary

  • This is SCC-compatible manifest delivery, not an OpenShift certification claim.
  • Current support is limited to restricted-v2; restricted-v3 spec.hostUsers: false is not implemented.
  • Current RustFS server images use /data and /logs ownership 10001:10001 with mode 0750. A separate arbitrary-UID image fix and real OpenShift data read/write, existing-PVC, rollout, and rollback validation are required before end-to-end support can be declared.
  • The local environment did not provide Helm, so Helm-dependent assertions were skipped locally by the test harness. CI must run them with Helm installed before merge.

Verification

make pre-commit
cargo test --manifest-path e2e/Cargo.toml --test openshift_manifest --test sts_manifest
cargo clippy --manifest-path e2e/Cargo.toml --all-targets -- -D warnings

Additional Notes

This PR intentionally avoids adding a Console Tenant mode button. The current Console API is Tenant-scoped while the MinIO contract is Pool-aware; YAML remains the lossless configuration path until a Pool-aware API can preserve advanced security fields.


Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md) and sign the CLA if this is your first contribution.

@GatewayJ
GatewayJ marked this pull request as ready for review August 5, 2026 01:25
@GatewayJ

GatewayJ commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

@codex

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2fcf2b7efc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +41 to +42
securityContext: {}
containerSecurityContext: {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Make empty Tenant contexts actually delegate to SCC

With this example, OpenShift Tenant pods still get the operator's fixed defaults instead of SCC-assigned IDs: the reconciler treats {} as an empty override, starts from the 10001 UID/GID/FSGroup defaults in effective_workload_security_context(), and new_statefulset_with_tls_plan_and_cluster_domain() always writes those Pod and container security contexts. In a restricted-v2 namespace where UID 10001 is outside the allowed range, applying this advertised OpenShift manifest will still produce rejected Tenant pods unless the controller also omits the generated contexts for the paired empty objects.

Useful? React with 👍 / 👎.

# image-layer directories such as /data and /logs must be owned by group 0
# and grant the group the same permissions as the owner. Do not deploy this
# example until such a RustFS image is available in your registry.
image: registry.example.com/rustfs/rustfs:openshift-compatible

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include the image acknowledgement for custom OpenShift images

When users follow this example with an arbitrary-UID-compatible image from their own registry, the reconciler classifies that custom repository as unverifiable under the default RuntimeDefault profile and requires operator.rustfs.com/runtime-default-image-ack to exactly match the image. Because the example lacks that annotation, it is rejected with WorkloadSecurityIncompatible before any OpenShift SCC behavior is exercised; include the acknowledgement or use a known-compatible official tag.

Useful? React with 👍 / 👎.

@GatewayJ
GatewayJ force-pushed the feat/openshift-platform-delivery branch from 2fcf2b7 to a6772be Compare August 5, 2026 10:23
@GatewayJ
GatewayJ added this pull request to the merge queue Aug 5, 2026
Merged via the queue into rustfs:main with commit cf744be Aug 5, 2026
3 checks passed
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.

1 participant