You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Commits, pushes, and opens pull requests for the RustFS Operator repo per CONTRIBUTING.md and AGENTS.md. Use when the user asks to commit, push to remote my, submit a PR upstream, or follow project contribution workflow.
4
+
---
5
+
6
+
# RustFS Operator — commit, push, PR
7
+
8
+
## Preconditions
9
+
10
+
- Run from repository root: `/home/jhw/my/operator` (or clone path).
11
+
- Source of truth: [`CONTRIBUTING.md`](../../../CONTRIBUTING.md), [`Makefile`](../../../Makefile), [`.github/pull_request_template.md`](../../../.github/pull_request_template.md).
12
+
13
+
## Before commit
14
+
15
+
1. Run **`make pre-commit`** (fmt-check → clippy → test → console-lint → console-fmt-check). Fix failures before committing.
16
+
2. User-visible changes: update **[`CHANGELOG.md`](../../../CHANGELOG.md)** under `[Unreleased]` (Keep a Changelog).
17
+
3.**Commit message**: [Conventional Commits](https://www.conventionalcommits.org/), **English**, subject **≤ 72 characters** (e.g. `fix(pool): align CEL with console validation`).
18
+
19
+
## Commit
20
+
21
+
```bash
22
+
git add -A
23
+
git status
24
+
git commit -m "type(scope): short description"
25
+
```
26
+
27
+
## Push to fork (`my`)
28
+
29
+
Remote is typically `my` → `git@github.com:GatewayJ/operator.git` (verify with `git remote -v`).
30
+
31
+
```bash
32
+
git push my main
33
+
```
34
+
35
+
If `main` is non-fast-forward on `my`, integrate or use `git push my main --force-with-lease` only when intentionally replacing fork history (dangerous).
36
+
37
+
## Open PR upstream (`rustfs/operator`)
38
+
39
+
-**Target**: `rustfs/operator` branch **`main`**.
40
+
-**Head**: fork branch (e.g. `GatewayJ:main`).
41
+
-**PR title and body**: **English**.
42
+
-**Body**: Must follow **every section** in [`.github/pull_request_template.md`](../../../.github/pull_request_template.md); use **`N/A`** where not applicable; keep all headings.
43
+
44
+
**Do not** pass multiline `--body` to `gh` inline. Write a file and use `--body-file`:
45
+
46
+
```bash
47
+
cat > /tmp/pr_body.md <<'EOF'
48
+
## Type of Change
49
+
- [x] Bug Fix
50
+
...
51
+
EOF
52
+
53
+
gh pr create --repo rustfs/operator --head GatewayJ:main --base main \
54
+
--title "fix: concise English title" \
55
+
--body-file /tmp/pr_body.md
56
+
```
57
+
58
+
Adjust checkboxes and sections to match the change. Include **`make pre-commit`** under Verification.
59
+
60
+
## Quick checklist
61
+
62
+
-[ ]`make pre-commit` passed
63
+
-[ ] CHANGELOG updated if user-visible
64
+
-[ ] Commit message conventional, English
65
+
-[ ] PR template complete, English, `--body-file` used
Copy file name to clipboardExpand all lines: CHANGELOG.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
10
10
### Documentation
11
11
12
+
- Expanded root [`README.md`](README.md) with overview, quick start, development commands, CI vs `make pre-commit`, and documentation index.
12
13
- Aligned [`CLAUDE.md`](CLAUDE.md) and [`ROADMAP.md`](ROADMAP.md) with current code: Tenant status conditions and StatefulSet updates on the successful reconcile path are documented as implemented; remaining work (status on early errors, integration tests, rollout extras) is listed explicitly.
13
14
- Clarified the documentation map: [`CONTRIBUTING.md`](CONTRIBUTING.md) (quality gates and CI alignment), [`docs/DEVELOPMENT.md`](docs/DEVELOPMENT.md) (environment setup), [`docs/DEVELOPMENT-NOTES.md`](docs/DEVELOPMENT-NOTES.md) (historical notes, not normative).
14
15
- Updated [`examples/README.md`](examples/README.md): Tenant Services document S3 **9000** and RustFS Console **9001**; distinguished the Operator HTTP Console (default **9090**, `cargo run -- console`) from the Tenant `{tenant}-console` Service.
@@ -19,8 +20,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
19
20
20
21
-**`console-web` / `make pre-commit`**: `npm run lint` now runs `eslint .` (bare `eslint` only printed CLI help). Added `format` / `format:check` scripts; [`Makefile`](Makefile)`console-fmt` and `console-fmt-check` call them so Prettier resolves from `node_modules` after `npm install` in `console-web/`.
21
22
23
+
-**Tenant `Pool` CRD validation (CEL)**: Match the operator console API — require `servers × volumesPerServer >= 4` for every pool, and `>= 6` total volumes when `servers == 3` (fixes the previous 3-server rule using `< 4` in CEL). Regenerated [`deploy/rustfs-operator/crds/tenant-crd.yaml`](deploy/rustfs-operator/crds/tenant-crd.yaml) and [`tenant.yaml`](deploy/rustfs-operator/crds/tenant.yaml). Added [`validate_pool_total_volumes`](src/types/v1alpha1/pool.rs) as the shared Rust implementation used by [`src/console/handlers/pools.rs`](src/console/handlers/pools.rs).
24
+
25
+
-**Tenant name length**: [`validate_dns1035_label`](src/types/v1alpha1/tenant.rs) now caps `metadata.name` at **55** characters so derived names like `{name}-console` remain valid Kubernetes DNS labels (≤ 63).
26
+
27
+
### Changed
28
+
29
+
-**Deploy scripts** ([`scripts/deploy/deploy-rustfs.sh`](scripts/deploy/deploy-rustfs.sh), [`deploy-rustfs-4node.sh`](scripts/deploy/deploy-rustfs-4node.sh)): Docker builds use **layer cache by default** (`docker_build_cached`); set `RUSTFS_DOCKER_NO_CACHE=true` for a full rebuild. Documented in [`scripts/README.md`](scripts/README.md).
30
+
-**4-node deploy**: Help text moved to an early heredoc (avoids trailing `case`/parse issues); see script header.
31
+
-**4-node cleanup** ([`cleanup-rustfs-4node.sh`](scripts/cleanup/cleanup-rustfs-4node.sh)): Host storage dirs under `/tmp/rustfs-storage-*` may require `sudo rm -rf` after Kind (root-owned bind mounts).
32
+
-**Dockerfile** (operator and [`console-web/Dockerfile`](console-web/Dockerfile)): Build caching and reproducibility tweaks (cargo-chef pin, pnpm in frontend image as applicable).
33
+
22
34
### Added
23
35
36
+
- Cursor Agent skill [`.cursor/skills/rustfs-operator-contribute/SKILL.md`](.cursor/skills/rustfs-operator-contribute/SKILL.md) for `make pre-commit`, commit, push to fork `my`, and opening PRs to `rustfs/operator` with the project template.
Copy file name to clipboardExpand all lines: README.md
+74-1Lines changed: 74 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,64 @@
1
1
# RustFS Kubernetes Operator
2
2
3
-
RustFS Kubernetes operator (under development; not production-ready).
3
+
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`) and provisions ConfigMaps, Secrets, RBAC, Services, and StatefulSets so RustFS runs as an erasure-coded cluster inside your cluster.
4
+
5
+
**Status:** v0.1.0 pre-release — under active development, **not production-ready**.
6
+
7
+
## Features
8
+
9
+
-**Tenant CRD** — Declare pools, persistence, scheduling, credentials (Secret or env), TLS, and more; see [`examples/`](examples/).
10
+
-**Controller** — Reconciliation loop with status conditions (`Ready` / `Progressing` / `Degraded`), events, and safe StatefulSet update checks.
11
+
-**Operator HTTP console** — Optional management API (`cargo run -- console`, default port **9090**) used by [`console-web/`](console-web/) (Next.js UI).
RustFS **S3 API** and **RustFS Console UI** inside a Tenant are exposed on **9000** and **9001** respectively; the operator’s own HTTP API is separate (typically **9090**). See [`CLAUDE.md`](CLAUDE.md) for ports and env vars.
15
+
16
+
## Requirements
17
+
18
+
-**Rust** — Toolchain from [`rust-toolchain.toml`](rust-toolchain.toml) (stable; edition 2024).
19
+
-**Kubernetes** — Target API **v1.30** (see `Cargo.toml` / `k8s-openapi` features); a reachable cluster for `server` mode.
20
+
-**console-web** (optional) — **Node.js ≥ 20** and `npm install` in `console-web/` if you run frontend lint/format or UI dev.
21
+
22
+
## Quick start
23
+
24
+
```bash
25
+
# Clone and build
26
+
git clone https://github.com/rustfs/operator.git
27
+
cd operator
28
+
cargo build --release
29
+
30
+
# Emit Tenant CRD YAML (stdout or file)
31
+
cargo run -- crd
32
+
cargo run -- crd -f tenant-crd.yaml
33
+
34
+
# Run the controller (needs kubeconfig / in-cluster config)
35
+
cargo run -- server
36
+
37
+
# Run the operator HTTP console API (default :9090)
38
+
cargo run -- console
39
+
```
40
+
41
+
**Docker**
42
+
43
+
```bash
44
+
docker build -t rustfs/operator:dev .
45
+
```
46
+
47
+
**End-to-end on Kind** (single-node or multi-node) — see [`scripts/README.md`](scripts/README.md).
48
+
49
+
## Development
50
+
51
+
From the repo root:
52
+
53
+
| Command | Purpose |
54
+
|--------|---------|
55
+
|`make pre-commit`| Full local gate: Rust `fmt` / `clippy` / `test` + `console-web` ESLint and Prettier (run after `npm install` in `console-web/`). |
CI (`.github/workflows/ci.yml`) runs Rust tests (including `nextest`), `cargo fmt --check`, and `clippy`; it does **not** run `console-web` checks — use **`make pre-commit`** before opening a PR so frontend changes are validated.
60
+
61
+
Contribution workflow, commit style, and PR expectations: [`CONTRIBUTING.md`](CONTRIBUTING.md).
0 commit comments