diff --git a/.github/workflows/helm-package.yml b/.github/workflows/helm-package.yml index 6c75a64b..66175f5f 100644 --- a/.github/workflows/helm-package.yml +++ b/.github/workflows/helm-package.yml @@ -23,7 +23,6 @@ on: version: description: "Release version to publish, e.g. 1.0.0 or v1.0.0" required: true - default: "0.0.4" type: string permissions: @@ -45,21 +44,15 @@ jobs: chart_version: ${{ steps.version.outputs.chart_version }} steps: - - name: Checkout helm chart repo - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - - name: Normalize release version id: version + env: + RELEASE_TAG: ${{ inputs.version || github.event.workflow_run.head_branch }} run: | set -euo pipefail - if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then - RAW="${{ github.event.inputs.version }}" - else - RAW="${{ github.event.workflow_run.head_branch }}" - fi - - RAW_TAG="${RAW#refs/tags/}" + RAW_TAG="${RELEASE_TAG#refs/tags/}" + git check-ref-format "refs/tags/$RAW_TAG" CHART_VERSION="${RAW_TAG#v}" if [ -z "$CHART_VERSION" ]; then @@ -71,25 +64,26 @@ jobs: echo "chart_version=$CHART_VERSION" } >> "$GITHUB_OUTPUT" - - - name: Replace chart version and app version - run: | - set -eux - sed -i -E 's/^version:.*/version: "${{ steps.version.outputs.chart_version }}"/' deploy/rustfs-operator/Chart.yaml + - name: Check out the release source + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + ref: ${{ github.event.workflow_run.head_sha || format('refs/tags/{0}', steps.version.outputs.raw_tag) }} - name: Set up Helm uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1 - name: Package Helm Chart + env: + CHART_VERSION: ${{ steps.version.outputs.chart_version }} run: | set -eux helm package ./deploy/rustfs-operator \ --destination helm-packages/ \ - --version "${{ steps.version.outputs.chart_version }}" \ - --app-version "${{ steps.version.outputs.chart_version }}" + --version "$CHART_VERSION" \ + --app-version "$CHART_VERSION" helm package ./deploy/rustfs-tenant \ --destination helm-packages/ \ - --version "${{ steps.version.outputs.chart_version }}" + --version "$CHART_VERSION" - name: Upload helm package as artifact uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 @@ -123,10 +117,12 @@ jobs: run: helm repo index . --url https://operator.rustfs.com - name: Push helm package and index file + env: + CHART_VERSION: ${{ needs.build-helm-package.outputs.chart_version }} run: | set -eux git config --global user.name "${{ secrets.USERNAME }}" git config --global user.email "${{ secrets.EMAIL_ADDRESS }}" git add . - git commit -m "Update rustfs operator helm package with ${{ needs.build-helm-package.outputs.chart_version }}." || echo "No changes to commit" + git commit -m "Update rustfs operator helm package with $CHART_VERSION." || echo "No changes to commit" git push origin main diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eb7d4fe..2b0b8eb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,14 +22,39 @@ All notable changes to RustFS Operator are documented in this file. The format i ## [Unreleased] +## [0.0.9] + +### Added + +- Tenant `spec.tiers` registers S3, RustFS, and MinIO remote tiers and rotates credentials when their Secret changes. Bucket lifecycle rules can move current and noncurrent object versions to a tier once it is ready. +- Buckets support declarative default encryption for new objects with SSE-S3 or SSE-KMS. The Operator validates the key configuration and reports conflicts when an externally modified setting would be overwritten. +- Tenant `spec.tls.caTrust.clientCaSecretRef` enables mutual TLS for client and peer connections with cert-manager. Operator admin and STS requests use a client certificate. +- Tenant `spec.readinessProbe` configures the initial delay, timeout, period, and success and failure thresholds for each Pool. +- The Operator manages a PodDisruptionBudget for each eligible Pool, using drive placement and online drive counts to preserve the write quorum for the `STANDARD` storage class during node drains. +- The [Helm installation guide](deploy/rustfs-operator/README.md#installing-the-chart) includes versioned installation commands and an Argo CD Application for the public chart repository. + +### Fixed + +- Tenant provisioning checks existing buckets with `HeadBucket` before attempting creation. Busy buckets can reach `Ready` even when repeated creation requests would time out. COSI retains its ownership check for same-name buckets. +- The PodDisruptionBudget calculation treats path-only drive endpoints on a single-node deployment as belonging to one server. +- Helm defaults to `docker.io/rustfs/operator` for the Operator, Console, and COSI driver. CI checks source and packaged image versions against the release tag. Both Helm charts are packaged from the Docker release commit, or from the requested tag for manual publication. + +### Upgrading from 0.0.8 + +1. Apply the CRDs from the 0.0.9 Operator chart before upgrading the controller. Helm leaves installed CRDs in place. See the [upgrade commands](deploy/rustfs-operator/README.md#upgrading). +2. If you manage PodDisruptionBudgets yourself, set `spec.disablePodDisruptionBudget: true` on those Tenants before the new Operator starts. If the Operator will manage the budgets, remove existing budgets that select the same Pool Pods. Kubernetes rejects evictions when two budgets select one Pod. +3. Plan for a StatefulSet rollout. The default readiness timeout increases from one to five seconds. Tenants using the default ServiceAccount roll eligible Pods with `RollingUpdate` and partition zero. A custom ServiceAccount preserves the existing strategy and partition. Set `spec.readinessProbe.timeoutSeconds: 1` to retain the previous timeout. + +## [0.0.8] - 2026-10-03 + +### Changed + +- Docker builds in CI and image publication use the smaller `dind-sm-standard-2` runners. + +## [0.0.7] - 2026-09-09 + ### Added -- Tenant `spec.readinessProbe` with optional initial delay, timeout, period, failure - threshold, and success threshold settings, preserved during reconciliation. -- Full mutual TLS (client-to-Pod and Pod-to-Pod) support when `caTrust.clientCaSecretRef` is - configured with cert-manager, including client certificate/key volume projections, automatic - `client auth` usage on managed default certificates, mTLS-aware container probes, and operator - admin/STS client certificate authentication. - Optional `rustfs-tenant` Helm chart for a Tenant and separate API/Console Ingress or HTTPRoute resources, with backend TLS policies, native YAML/Kustomize examples, and networking lifecycle documentation. Existing CRDs and controller behavior are unchanged. @@ -43,41 +68,14 @@ All notable changes to RustFS Operator are documented in this file. The format i - Tenant `spec.hostUsers` and OpenShift `hostUsers: false` defaults for `restricted-v3`. - Tenant bucket canned anonymous access and ConfigMap-sourced bucket policies. - Declarative Tenant bucket lifecycle rules with drift-aware ownership and explicit removal. -- Bucket lifecycle `transition` and `noncurrentVersionTransition` actions that move objects to a - remote tier registered in RustFS. -- Tenant `spec.tiers` for declarative S3, RustFS, and MinIO remote tiers with Secret-sourced - credentials, rotation on Secret updates, and conflict reporting for immutable tier settings. - Declarative Tenant bucket versioning and Object Lock default retention with drift-aware ownership. -- Declarative default bucket encryption (`SSE-S3` or `SSE-KMS`) with drift-aware ownership, - explicit removal, and validation of the Tenant SSE-S3 master key or KMS default key. - Helm chart `cosiDriver.enabled` to deploy the RustFS COSI (`rustfs.objectstorage.k8s.io`) driver alongside the upstream provisioner sidecar, with dedicated ServiceAccount/RBAC. - Seven built-in RustFS Grafana dashboards, published by default as sidecar-discoverable ConfigMaps with configurable labels and namespace. -- Per-pool PodDisruptionBudgets with `minAvailable` derived from the erasure layout RustFS - reports, so node drains keep `STANDARD` write quorum, including while drives are offline; - opt out with `spec.disablePodDisruptionBudget`. Enabled by default: before upgrading, set the - opt-out on Tenants whose budgets you manage yourself, or remove your own budgets that select - pool Pods, because Kubernetes rejects evictions of Pods selected by more than one budget. - -### Changed - -- The default Tenant readiness probe timeout is five seconds, increased from the - previous effective one-second default. Upgrades update existing StatefulSet Pod - templates. Tenants without `spec.serviceAccountName` use enforced `RollingUpdate` - with partition zero for default ServiceAccount token protection; Tenants with - a custom ServiceAccount retain their existing update strategy and partition. - Apply the updated Tenant CRD explicitly before upgrading the Operator or - configuring readiness fields; Helm does not upgrade installed CRDs. ### Fixed -- Check an existing Tenant bucket with HeadBucket before CreateBucket, so a bucket under - continuous writes no longer stays Pending on RustFS lock-timeout 503 responses. -- Update source release metadata to `0.0.8` so source Helm installs select the - `0.0.8` Operator and Console images, and verify release tags and chart images in CI. -- Use `docker.io/rustfs/operator` as the default Helm image repository for the Operator, - Console, and COSI driver, while preserving repository overrides through Helm values. - Reject multi-pool Tenants containing a single-node single-disk pool before applying pool workloads, matching RustFS startup constraints. - Reject additional volume mounts that overlap operator-managed data, logging, TLS, or OIDC paths. @@ -88,8 +86,6 @@ All notable changes to RustFS Operator are documented in this file. The format i ### Changed -- Documented the public Operator Helm repository, versioned installation, and an - Argo CD Application using the published chart. - Updated the default RustFS server image from `rustfs/rustfs:1.0.0-beta.10` to `rustfs/rustfs:1.0.0`. - Documented that distinct-physical-disk erasure failures and a separate data-plane operator are @@ -191,5 +187,8 @@ is unaffected. - Pin Operator and RustFS images independently, then verify Tenant readiness and S3 read/write data before and after any rollback. -[Unreleased]: https://github.com/rustfs/operator/compare/0.0.6...HEAD +[Unreleased]: https://github.com/rustfs/operator/compare/0.0.9...HEAD +[0.0.9]: https://github.com/rustfs/operator/compare/0.0.8...0.0.9 +[0.0.8]: https://github.com/rustfs/operator/compare/0.0.7...0.0.8 +[0.0.7]: https://github.com/rustfs/operator/compare/0.0.6...0.0.7 [0.0.6]: https://github.com/rustfs/operator/compare/0.0.5...0.0.6 diff --git a/Cargo.lock b/Cargo.lock index 3dcdac79..b62a8dc0 100755 --- a/Cargo.lock +++ b/Cargo.lock @@ -1870,7 +1870,7 @@ checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" [[package]] name = "operator" -version = "0.0.8" +version = "0.0.9" dependencies = [ "async-trait", "axum", diff --git a/Cargo.toml b/Cargo.toml index 95239b6f..ea0d7af5 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "operator" -version = "0.0.8" +version = "0.0.9" edition = "2024" repository = "https://github.com/rustfs/operator" license = "Apache-2.0" diff --git a/README.md b/README.md index 80080835..294b3c71 100755 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A Kubernetes operator for [RustFS](https://rustfs.com/) object storage, written in Rust with [kube-rs](https://github.com/kube-rs/kube). It reconciles a **`Tenant` custom resource** (`rustfs.com/v1alpha1`), validates referenced credential and KMS Secrets, and applies ServiceAccounts, Services, and StatefulSets so RustFS runs inside your cluster, from single-node single-disk development tenants to erasure-coded distributed clusters. -**Status:** v0.0.8 — under active development. +**Status:** v0.0.9 — under active development. ## Features diff --git a/deploy/README.md b/deploy/README.md index 0edaf188..76c7356e 100755 --- a/deploy/README.md +++ b/deploy/README.md @@ -13,12 +13,12 @@ helm repo add rustfs-operator https://operator.rustfs.com helm repo update helm search repo rustfs-operator/rustfs-operator --versions helm install rustfs-operator rustfs-operator/rustfs-operator \ - --version 0.0.8 \ + --version 0.0.9 \ --namespace rustfs-system \ --create-namespace ``` -The example selects published chart version `0.0.8`. Select another available +The example pins chart version `0.0.9`. Select another available version with `--version`. For GitOps deployments, see the [Argo CD Application example](rustfs-operator/README.md#argo-cd). diff --git a/deploy/rustfs-operator/Chart.yaml b/deploy/rustfs-operator/Chart.yaml index 45d4f049..bb018669 100755 --- a/deploy/rustfs-operator/Chart.yaml +++ b/deploy/rustfs-operator/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: rustfs-operator description: Kubernetes operator for managing RustFS storage clusters type: application -version: 0.0.8 -appVersion: "0.0.8" +version: 0.0.9 +appVersion: "0.0.9" home: https://rustfs.com sources: - https://github.com/rustfs/operator diff --git a/deploy/rustfs-operator/README.md b/deploy/rustfs-operator/README.md index 46585f52..a71440e9 100755 --- a/deploy/rustfs-operator/README.md +++ b/deploy/rustfs-operator/README.md @@ -30,14 +30,14 @@ Install the published chart with an explicit version: ```bash helm install rustfs-operator rustfs-operator/rustfs-operator \ - --version 0.0.8 \ + --version 0.0.9 \ --namespace rustfs-system \ --create-namespace ``` -The examples use published chart version `0.0.8`. Select another version from +The examples pin chart version `0.0.9`. Select another version from `helm search repo --versions` when installing or upgrading. Inspect that version's -configuration with `helm show values rustfs-operator/rustfs-operator --version 0.0.8`. +configuration with `helm show values rustfs-operator/rustfs-operator --version 0.0.9`. The chart publishes the seven bundled RustFS Grafana dashboards as ConfigMaps by default. It does not install Grafana or Prometheus. A Grafana dashboard sidecar @@ -58,7 +58,7 @@ spec: source: repoURL: https://operator.rustfs.com chart: rustfs-operator - targetRevision: "0.0.8" + targetRevision: "0.0.9" destination: server: https://kubernetes.default.svc namespace: rustfs-system @@ -571,7 +571,9 @@ kubectl apply -f examples/simple-tenant.yaml ## Upgrading -To upgrade the operator: +From a checkout of the target release, apply the CRDs before upgrading the Operator. +Helm leaves installed CRDs in place. The dedicated field manager takes ownership +of the chart-managed CRD fields, including CRDs originally created by Helm. ```bash kubectl apply --server-side --force-conflicts \ @@ -580,14 +582,23 @@ kubectl apply --server-side --force-conflicts \ kubectl apply --server-side --force-conflicts \ --field-manager=rustfs-operator-crd-upgrade \ -f deploy/rustfs-operator/crds/policybinding-crd.yaml +``` + +When upgrading from 0.0.8, set `spec.disablePodDisruptionBudget: true` on any +Tenant whose Pool budgets you manage yourself. If the Operator will manage +the budgets, remove any existing budgets that select the same Pool Pods. +Complete this step before starting the new Operator. + +Then upgrade the chart using your installation's values: + +```bash helm upgrade rustfs-operator deploy/rustfs-operator/ \ --namespace rustfs-system ``` -Helm does not upgrade existing CRDs from a chart's `crds/` directory. Apply the -cluster-scoped CRDs first so the API server accepts fields introduced by the -new Operator version. The dedicated field manager deliberately takes ownership -of the chart-managed CRD fields, including CRDs originally created by Helm. +The default readiness timeout increases from one to five seconds in 0.0.9. +See the [release notes](../../CHANGELOG.md#upgrading-from-008) for StatefulSet +rollout behavior. When adopting OpenShift mode on an existing installation, apply the CRDs first, then upgrade the chart with `openshift.enabled=true`, and wait for the Operator diff --git a/deploy/rustfs-tenant/Chart.yaml b/deploy/rustfs-tenant/Chart.yaml index 48c219a0..23ee0b76 100644 --- a/deploy/rustfs-tenant/Chart.yaml +++ b/deploy/rustfs-tenant/Chart.yaml @@ -16,7 +16,7 @@ apiVersion: v2 name: rustfs-tenant description: A RustFS Tenant with optional S3 and Console ingress resources type: application -version: 0.0.8 +version: 0.0.9 home: https://rustfs.com sources: - https://github.com/rustfs/operator diff --git a/docs/operator-user-guide.md b/docs/operator-user-guide.md index 9ab2fab0..5e94d33e 100644 --- a/docs/operator-user-guide.md +++ b/docs/operator-user-guide.md @@ -848,9 +848,9 @@ The Operator only changes and deletes budgets that the Tenant owns. If a PodDisr Upgrading an Operator release without PodDisruptionBudget support: -1. Upgrade the chart, so the CRD gains `disablePodDisruptionBudget` and the ClusterRole gains `policy/poddisruptionbudgets` permissions. -2. To keep managing budgets yourself, set `spec.disablePodDisruptionBudget: true` on those Tenants before the new Operator image starts. -3. Otherwise remove your own PodDisruptionBudgets that select pool Pods. Kubernetes rejects the eviction of a Pod that more than one budget selects, so a drain cannot evict any Pod of the pool while both exist. +1. Apply the [CRDs from the target release](../deploy/rustfs-operator/README.md#upgrading) so the API server accepts `spec.disablePodDisruptionBudget`. +2. To keep managing budgets yourself, set `spec.disablePodDisruptionBudget: true` on those Tenants. To use Operator-managed budgets, remove your own PodDisruptionBudgets that select the same pool Pods. Kubernetes rejects evictions when more than one budget selects a Pod. +3. Upgrade the chart to grant the ClusterRole its `policy/poddisruptionbudgets` permissions and start the new Operator. ### 7.5 TLS diff --git a/e2e/Cargo.lock b/e2e/Cargo.lock index cc5210fd..385f9893 100644 --- a/e2e/Cargo.lock +++ b/e2e/Cargo.lock @@ -2620,7 +2620,7 @@ checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" [[package]] name = "operator" -version = "0.0.8" +version = "0.0.9" dependencies = [ "async-trait", "axum", diff --git a/scripts/check-release-metadata.sh b/scripts/check-release-metadata.sh index 27f63d6e..255e01b1 100755 --- a/scripts/check-release-metadata.sh +++ b/scripts/check-release-metadata.sh @@ -153,9 +153,10 @@ grep -Fq '.Values.console.image.tag | default .Values.operator.image.tag | defau echo "release metadata check failed: Console image does not default to Chart.appVersion" >&2 exit 1 } -grep -Fq -- '--app-version "${{ steps.version.outputs.chart_version }}"' .github/workflows/helm-package.yml || { +if ! grep -Fq 'CHART_VERSION: ${{ steps.version.outputs.chart_version }}' .github/workflows/helm-package.yml || + ! grep -Fq -- '--app-version "$CHART_VERSION"' .github/workflows/helm-package.yml; then echo "release metadata check failed: Helm packaging does not set appVersion from the release tag" >&2 exit 1 -} +fi echo "release metadata is consistent: operator=$cargo_version rust=$toolchain_version" diff --git a/src/reconcile/pool_lifecycle.rs b/src/reconcile/pool_lifecycle.rs index e9cd93bf..bb39185e 100644 --- a/src/reconcile/pool_lifecycle.rs +++ b/src/reconcile/pool_lifecycle.rs @@ -695,15 +695,11 @@ fn should_start_decommission( )); } - if matches!(existing_state, Some(PoolLifecycleState::Decommissioning)) + let same_request = matches!(existing_state, Some(PoolLifecycleState::Decommissioning)) && existing .and_then(|status| status.request_id.as_deref()) - .is_some_and(|request_id| request_id == request.request_id) - { - return Ok(false); - } - - Ok(true) + .is_some_and(|request_id| request_id == request.request_id); + Ok(!same_request) } fn decommission_started_after_request(