|
| 1 | +# rustfs-operator-crds Helm chart |
| 2 | + |
| 3 | +The [rustfs-operator](https://github.com/OpenProjectX/rustfs-operator) CRDs |
| 4 | +(`Bucket`, `User`, `Policy`, `ClusterConnection`) as **Helm templates**, so |
| 5 | +they are upgradeable via `helm upgrade` and controllable through values — |
| 6 | +unlike the copy shipped in the main chart's `crds/` directory, which Helm |
| 7 | +only ever installs once. |
| 8 | + |
| 9 | +```sh |
| 10 | +helm repo add rustfs-operator https://openprojectx.github.io/rustfs-operator |
| 11 | + |
| 12 | +# install CRDs first, then the operator (it skips already-existing CRDs) |
| 13 | +helm install rustfs-operator-crds rustfs-operator/rustfs-operator-crds |
| 14 | +helm install rustfs-operator rustfs-operator/rustfs-operator \ |
| 15 | + --namespace rustfs-operator --create-namespace |
| 16 | +``` |
| 17 | + |
| 18 | +## Values |
| 19 | + |
| 20 | +| Key | Default | Description | |
| 21 | +|-----|---------|-------------| |
| 22 | +| `keep` | `true` | add `helm.sh/resource-policy: keep` so `helm uninstall` leaves the CRDs (deleting a CRD cascades to **all** CRs of that kind) | |
| 23 | +| `annotations` | `{}` | extra annotations on every CRD | |
| 24 | +| `labels` | `{}` | extra labels on every CRD | |
| 25 | +| `crds.bucket` | `true` | install `buckets.rustfs.com` | |
| 26 | +| `crds.user` | `true` | install `users.rustfs.com` | |
| 27 | +| `crds.policy` | `true` | install `policies.rustfs.com` | |
| 28 | +| `crds.clusterConnection` | `true` | install `clusterconnections.rustfs.com` | |
| 29 | + |
| 30 | +## Adopting CRDs installed by the main chart |
| 31 | + |
| 32 | +If the CRDs already exist on the cluster (installed from the main chart's |
| 33 | +`crds/` directory), Helm refuses to manage them until they carry release |
| 34 | +ownership metadata. Adopt them once, then install this chart: |
| 35 | + |
| 36 | +```sh |
| 37 | +for crd in buckets users policies clusterconnections; do |
| 38 | + kubectl annotate crd ${crd}.rustfs.com \ |
| 39 | + meta.helm.sh/release-name=rustfs-operator-crds \ |
| 40 | + meta.helm.sh/release-namespace=default --overwrite |
| 41 | + kubectl label crd ${crd}.rustfs.com \ |
| 42 | + app.kubernetes.io/managed-by=Helm --overwrite |
| 43 | +done |
| 44 | +helm install rustfs-operator-crds rustfs-operator/rustfs-operator-crds |
| 45 | +``` |
| 46 | + |
| 47 | +(Adjust the release name/namespace to whatever you install with.) |
| 48 | + |
| 49 | +## Development |
| 50 | + |
| 51 | +Templates are generated from the Rust CRD types — do not edit them by hand. |
| 52 | +Regenerate after changing `src/crd.rs`: |
| 53 | + |
| 54 | +```sh |
| 55 | +python3 scripts/generate-crds.py |
| 56 | +``` |
0 commit comments