Skip to content

Feature request: Bucket lifecycle management via CRD #249

Closed

Description

@optical4eye

Summary

Add bucket lifecycle management (ILM) to the RustFS operator via a dedicated CRD or lifecycle field in spec.buckets.

Use Case

We need automatic lifecycle management for production deployments:

  • Log rotation: delete objects older than 30 days
  • Backup retention: keep daily backups for 7 days, weekly for 4 weeks
  • Temporary artifacts: delete CI/CD artifacts after 14 days
  • Compliance: enforce data retention policies

Current Situation

  • RustFS core supports lifecycle via admin API/CLI
  • RustFS operator does NOT support lifecycle via CRD

Current Workaround

Managing lifecycle via CronJob + CLI script:

  • Breaks GitOps workflow
  • Requires additional maintenance
  • Makes configuration drift likely

Request

Add lifecycle management via one of these approaches:

Option A: Dedicated CRD

Request

Add lifecycle field to spec.buckets in Tenant CRD:

apiVersion: rustfs.com/v1alpha1
kind: Tenant
metadata:
  name: production
spec:
  buckets:
    - name: logs-bucket
      objectLock: false
      lifecycle:
        rules:
          - id: expire-old-logs
            prefix: ""
            status: Enabled
            expiration:
              days: 30
          - id: cleanup-incomplete-uploads
            status: Enabled
            abortIncompleteMultipartUpload:
              daysAfterInitiation: 1

Activity

  1. self-assigned this
    on Sep 12, 2026
  2. GatewayJ commented on Sep 12, 2026

    @GatewayJ
    Member

    Implemented and merged in #250.

    The PR also updates the English and Chinese operator user guides, the Helm deployment README, examples/provisioning-tenant.yaml, and the changelog.

    After installing the updated Tenant CRD and an Operator build from the updated main branch, lifecycle rules can be declared directly under spec.buckets[]:

    apiVersion: rustfs.com/v1alpha1
    kind: Tenant
    metadata:
      name: production
      namespace: storage
    spec:
      # Other Tenant settings are omitted here.
      buckets:
        - name: logs-bucket
          lifecycle:
            state: Present
            rules:
              - id: expire-old-logs
                status: Enabled
                filter:
                  prefix: logs/
                expiration:
                  days: 30
              - id: cleanup-incomplete-uploads
                status: Enabled
                filter:
                  prefix: ""
                abortIncompleteMultipartUpload:
                  daysAfterInitiation: 1

    Current behavior:

    • state: Present requires at least one rule.

    • Every rule requires a unique id, Enabled or Disabled status, and an explicit filter.prefix; prefix: "" selects all objects.

    • A rule must define expiration.days, abortIncompleteMultipartUpload.daysAfterInitiation, or both. Day values must be positive.

    • To explicitly remove an Operator-owned lifecycle configuration, use:

      lifecycle:
        state: Absent
    • Omitting lifecycle performs no Lifecycle API calls and leaves the live bucket configuration untouched.

    • The Operator can adopt an identical live configuration. It reports a conflict instead of overwriting or deleting a different live configuration unless the stored ownership hash matches.

    • Reconciliation state and ownership hashes are exposed under status.provisioning.buckets.

    The implementation and documentation are now available on the main branch and will be included in a subsequent Operator release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions