Skip to content

Add RustFS as an alternative in-cluster storage backend#1054

Open
cypres wants to merge 2 commits into
mainfrom
harnholm/rustfs
Open

Add RustFS as an alternative in-cluster storage backend#1054
cypres wants to merge 2 commits into
mainfrom
harnholm/rustfs

Conversation

@cypres

@cypres cypres commented May 30, 2026

Copy link
Copy Markdown
Member

Description

Adds --storage-backend rustfs: an in-cluster, S3-compatible object store (rustfs.com) as a drop-in alternative to MinIO, installed via the official Helm chart (https://charts.rustfs.com).

  • install-rustfs.sh: standalone-mode helm install. Always sets the perf-critical RUSTFS_OBS_ENVIRONMENT=production and RUSTFS_OBS_LOGGER_LEVEL=warn (chart's config.rustfs.obs_environment / log_level), and runs with no resource limits (resources: {}). Generates non-default credentials (the chart rejects the well-known rustfsadmin default).
  • storage/rustfs.sh: credential discovery + bucket bootstrap + workflow-cred Secrets + Helm values fragment, mirroring storage/minio.sh. Bucket creation uses the vendor-neutral AWS CLI (Apache-2.0) hitting the S3 API directly, not MinIO's mc (AGPLv3); path-style addressing, idempotent via head-bucket.
  • MinIO exclusivity: RustFS and MinIO are mutually exclusive. RustFS never installs or adds MinIO (microk8s/install.sh gates the minio addon on the minio/auto backends only); an already-installed MinIO is left untouched.
  • configure-storage.sh / deploy-osmo-minimal.sh: backend wiring, help text, and workload-identity rejection for rustfs.
  • README: storage matrix, install-helper table, phases, and flags.

Also lands the storage/ Bazel test scaffolding (BUILD + minio/rustfs addressing-style sh_tests), which was previously untracked.

Validated: chart renders via helm template; bucket create/idempotency and object round-trip verified against a live RustFS container using aws-cli.
Issue #None

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Summary by CodeRabbit

  • New Features

    • Added RustFS as an in-cluster S3-compatible storage backend option, including an installer and conditional MicroK8s addon behavior.
  • Documentation

    • Updated deployment guides and CLI help to document RustFS, update backend selection flags, deployment matrix, and tested configurations.
  • Bug Fixes / Validation

    • CLI now rejects workload-identity for MinIO and RustFS backends and clarifies mutually-exclusive storage choices.
  • Tests

    • Added addressing-style tests for both MinIO and RustFS.

Review Change Stack

Adds `--storage-backend rustfs`: an in-cluster, S3-compatible object store
(rustfs.com) as a drop-in alternative to MinIO, installed via the official
Helm chart (https://charts.rustfs.com).

- install-rustfs.sh: standalone-mode helm install. Always sets the
  perf-critical RUSTFS_OBS_ENVIRONMENT=production and RUSTFS_OBS_LOGGER_LEVEL=warn
  (chart's config.rustfs.obs_environment / log_level), and runs with no
  resource limits (resources: {}). Generates non-default credentials (the
  chart rejects the well-known rustfsadmin default).
- storage/rustfs.sh: credential discovery + bucket bootstrap + workflow-cred
  Secrets + Helm values fragment, mirroring storage/minio.sh. Bucket creation
  uses the vendor-neutral AWS CLI (Apache-2.0) hitting the S3 API directly,
  not MinIO's mc (AGPLv3); path-style addressing, idempotent via head-bucket.
- MinIO exclusivity: RustFS and MinIO are mutually exclusive. RustFS never
  installs or adds MinIO (microk8s/install.sh gates the minio addon on the
  minio/auto backends only); an already-installed MinIO is left untouched.
- configure-storage.sh / deploy-osmo-minimal.sh: backend wiring, help text,
  and workload-identity rejection for rustfs.
- README: storage matrix, install-helper table, phases, and flags.

Also lands the storage/ Bazel test scaffolding (BUILD + minio/rustfs
addressing-style sh_tests), which was previously untracked.

Validated: chart renders via `helm template`; bucket create/idempotency and
object round-trip verified against a live RustFS container using aws-cli.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Hans Arnholm <harnholm@nvidia.com>
@cypres cypres requested a review from a team as a code owner May 30, 2026 04:33
@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 33a11f21-5da1-403a-8062-d41f1d9fee6b

📥 Commits

Reviewing files that changed from the base of the PR and between 3d32092 and c146e8b.

📒 Files selected for processing (5)
  • deployments/scripts/configure-storage.sh
  • deployments/scripts/deploy-osmo-minimal.sh
  • deployments/scripts/storage/rustfs.sh
  • deployments/scripts/storage/tests/minio_addressing_style_test.sh
  • deployments/scripts/storage/tests/rustfs_addressing_style_test.sh
🚧 Files skipped from review as they are similar to previous changes (2)
  • deployments/scripts/configure-storage.sh
  • deployments/scripts/deploy-osmo-minimal.sh

📝 Walkthrough

Walkthrough

This PR adds RustFS as a first-class in-cluster S3-compatible storage backend alternative to MinIO in OSMO minimal deployments. Changes include docs and flag updates, a Helm-based RustFS installer, rustfs storage wiring, deployment orchestration to conditionally enable MinIO, and tests for addressing-style handling.

Changes

RustFS Storage Backend Integration

Layer / File(s) Summary
Documentation and configuration option descriptions
deployments/scripts/README.md, deployments/scripts/configure-storage.sh, deployments/scripts/deploy-osmo-minimal.sh
Deployment overview, help text, and option descriptions introduce rustfs with notes about mutual exclusivity with MinIO and auth-method constraints.
RustFS Helm installation script
deployments/scripts/install-rustfs.sh
New installer adds Helm-based standalone RustFS installation, secret-key generation, StorageClass resolution, values file generation, and helm upgrade --install usage with timeout/--wait.
RustFS storage backend configuration
deployments/scripts/storage/rustfs.sh
New script discovers credentials (env or Helm secret), builds endpoint, bootstraps bucket via ephemeral AWS CLI pod, creates workflow credential Secrets, and emits a Helm values fragment.
Deployment flow integration and backend selection
deployments/scripts/deploy-osmo-minimal.sh, deployments/scripts/microk8s/install.sh, deployments/scripts/configure-storage.sh
Passes STORAGE_BACKEND through bootstrap, conditionally enables MicroK8s MinIO addon only for MinIO/auto, skips MinIO for RustFS, rejects workload-identity for MinIO and RustFS, and triggers install-rustfs.sh when selected.
Bazel test infrastructure and addressing style tests
deployments/scripts/storage/BUILD, deployments/scripts/storage/tests/minio_addressing_style_test.sh, deployments/scripts/storage/tests/rustfs_addressing_style_test.sh
Adds BUILD targets and shell tests that stub kubectl/timeout to assert correct --from-literal=addressing_style=... handling when creating secrets for MinIO and RustFS.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Suggested reviewers

  • RyaliNvidia
  • vvnpn-nv

Poem

🐰 A rabbit hops where charts are spun,

rustfs rising with the sun.
MinIO nods, gives space to roam,
Helm and buckets find a home.
Hooray — deployments hum along!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely summarizes the main change: adding RustFS as an alternative in-cluster storage backend alongside MinIO, which is the primary focus of all the changes across multiple files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch harnholm/rustfs

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
deployments/scripts/deploy-osmo-minimal.sh (1)

139-147: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update auth help text to include rustfs as unsupported for workload identity.

Current help says workload identity is not valid for minio only, but runtime behavior rejects rustfs too.

Proposed fix
-                         Not valid for --storage-backend minio.
+                         Not valid for --storage-backend minio|rustfs.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deployments/scripts/deploy-osmo-minimal.sh` around lines 139 - 147, Update
the help text for the --auth-method flag to state that workload-identity is not
valid for both minio and rustfs (in addition to existing note about minio);
modify the description near the --auth-method and --storage-backend help block
so it explicitly lists "not valid for --storage-backend minio or rustfs"
(referencing the --auth-method flag and --storage-backend option in
deploy-osmo-minimal.sh) to match runtime behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@deployments/scripts/configure-storage.sh`:
- Line 33: Update the usage/help string that documents the --backend options so
it includes "s3" again; specifically modify the line that currently reads "#  
--backend {auto|minio|rustfs|azure-blob|byo|none} Backend (default: auto)" to
include "s3" in the brace list (e.g.,
"{auto|s3|minio|rustfs|azure-blob|byo|none}") so the usage matches the script
behavior and other help output.

In `@deployments/scripts/storage/rustfs.sh`:
- Line 88: The AWS_CLI_IMAGE default uses the floating tag
amazon/aws-cli:latest; update the AWS_CLI_IMAGE variable in the rustfs.sh script
to a pinned image (preferably an immutable digest) instead of :latest, and
ensure the kubectl run/invocation that references AWS_CLI_IMAGE uses that pinned
value; locate the AWS_CLI_IMAGE assignment and the kubectl run command in
rustfs.sh and replace the default value with a specific tag or digest (e.g.,
amazon/aws-cli@sha256:...) so the bootstrap uses a fixed, non-floating image.
- Around line 91-106: The bucket-setup pod currently interpolates sensitive
values directly into the /bin/sh -c string (export
AWS_ACCESS_KEY_ID='$RUSTFS_USER' ... and unquoted
$RUSTFS_ENDPOINT_URL/$RUSTFS_BUCKET) and leaves $KUBECTL unquoted; instead, stop
inline shell interpolation by passing credentials and values via kubectl run's
environment flags or mounting the secret—add --env
AWS_ACCESS_KEY_ID="$RUSTFS_USER" --env AWS_SECRET_ACCESS_KEY="$RUSTFS_PASS"
--env AWS_DEFAULT_REGION=us-east-1 --env
RUSTFS_ENDPOINT_URL="$RUSTFS_ENDPOINT_URL" --env RUSTFS_BUCKET="$RUSTFS_BUCKET"
(or mount the secret) and update the pod command to reference those env vars
without injecting values into the command string, and ensure the $KUBECTL
variable is quoted in the timeout invocation so the timeout
"$BUCKET_SETUP_TIMEOUT" "$KUBECTL" run ... call is safe.

In `@deployments/scripts/storage/tests/minio_addressing_style_test.sh`:
- Around line 65-73: The test's env block can leak a runner-level
MINIO_ADDRESSING_STYLE into the default-case run; update the environment passed
to bash "$MINIO_SCRIPT" in the test so MINIO_ADDRESSING_STYLE is explicitly
isolated (e.g., set MINIO_ADDRESSING_STYLE= or unset it in the env list) before
invoking MINIO_SCRIPT to ensure the default-path assertion is deterministic;
modify the env invocation that currently sets PATH, KUBECTL, KUBECTL_LOG,
NAMESPACE, OUTPUT_VALUES, MINIO_ROOT_USER and MINIO_ROOT_PASSWORD to also clear
or unset MINIO_ADDRESSING_STYLE.

In `@deployments/scripts/storage/tests/rustfs_addressing_style_test.sh`:
- Around line 65-73: The test can inherit RUSTFS_ADDRESSING_STYLE from the
environment making assertions flaky; modify the env block that calls bash
"$RUSTFS_SCRIPT" to explicitly unset or set RUSTFS_ADDRESSING_STYLE='' (or
RUSTFS_ADDRESSING_STYLE=default) in the invocation so the default path is
deterministic—update the env lines where PATH, KUBECTL, NAMESPACE,
OUTPUT_VALUES, RUSTFS_ACCESS_KEY, RUSTFS_SECRET_KEY are exported alongside
RUSTFS_ADDRESSING_STYLE to ensure the script run via bash "$RUSTFS_SCRIPT" sees
the intended addressing style.

---

Outside diff comments:
In `@deployments/scripts/deploy-osmo-minimal.sh`:
- Around line 139-147: Update the help text for the --auth-method flag to state
that workload-identity is not valid for both minio and rustfs (in addition to
existing note about minio); modify the description near the --auth-method and
--storage-backend help block so it explicitly lists "not valid for
--storage-backend minio or rustfs" (referencing the --auth-method flag and
--storage-backend option in deploy-osmo-minimal.sh) to match runtime behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 8cc92bf9-dac1-414a-9484-62ce3046b5e7

📥 Commits

Reviewing files that changed from the base of the PR and between 8e0d251 and 3d32092.

📒 Files selected for processing (9)
  • deployments/scripts/README.md
  • deployments/scripts/configure-storage.sh
  • deployments/scripts/deploy-osmo-minimal.sh
  • deployments/scripts/install-rustfs.sh
  • deployments/scripts/microk8s/install.sh
  • deployments/scripts/storage/BUILD
  • deployments/scripts/storage/rustfs.sh
  • deployments/scripts/storage/tests/minio_addressing_style_test.sh
  • deployments/scripts/storage/tests/rustfs_addressing_style_test.sh

Comment thread deployments/scripts/configure-storage.sh Outdated
Comment thread deployments/scripts/storage/rustfs.sh Outdated
Comment thread deployments/scripts/storage/rustfs.sh Outdated
Comment thread deployments/scripts/storage/tests/minio_addressing_style_test.sh Outdated
Comment thread deployments/scripts/storage/tests/rustfs_addressing_style_test.sh Outdated
- configure-storage.sh: restore s3 in the --backend usage brace list.
- storage/rustfs.sh: pin the bucket-bootstrap image to an immutable, multi-arch
  manifest-list digest (amazon/aws-cli:2.31.10@sha256:c354...) instead of the
  floating :latest; pass credentials/endpoint/bucket via kubectl run --env so
  no secrets are interpolated into the /bin/sh command string, and quote
  $KUBECTL in the timeout invocation.
- storage tests: clear inherited *_ADDRESSING_STYLE (and the STORAGE_ADDRESSING_STYLE
  fallback) via 'env -u' in the default-path run so the assertion is deterministic
  regardless of the runner environment.
- deploy-osmo-minimal.sh: note workload-identity is invalid for rustfs as well
  as minio in the --auth-method help.

Validated: bash -n clean; both addressing-style tests pass and stay deterministic
under a leaked *_ADDRESSING_STYLE env; env-based bucket command re-verified
end-to-end (create + idempotent re-run) against a live RustFS container.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Hans Arnholm <harnholm@nvidia.com>
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