c1b3ba1c34
Buckets could not choose which RGW placement target (and thus durability profile) backs them, so all data landed on the cluster default. The estate's radosgw exposes two targets - default-placement (3x replicated) and ec (4+1 erasure-coded) - and archival workloads want ec. - Validate spec.placementTarget: a DNS-ish pattern, 63-char cap, and a CEL self==oldSelf immutability rule (RGW fixes placement at bucket creation and cannot move a bucket between targets); make spec.zonegroup immutable too. - Thread the target into the S3 CreateBucket LocationConstraint via the existing helper; an empty zonegroup yields ":<target>", selecting the local zonegroup so callers need not name the zonegroup api-name. - Read the live placement_rule and zonegroup back from the Admin Ops bucket stats and surface them: status.placementTarget plus a Placement print column. - Guard the controller: if a live bucket's placement differs from spec, set an Error phase with a PlacementImmutable reason instead of deleting/recreating. - Cover locationConstraint construction, placement readback (httptest), and the placementConflict guard with tests; document targets and immutability in the README and add config/samples/06-bucket-ec.yaml. Claude-Session: https://claude.ai/code/session_015ur3i7D2azsMAWTSVABApv
19 lines
734 B
YAML
19 lines
734 B
YAML
# A bucket placed on the erasure-coded (4+1) placement target instead of the
|
|
# default 3x-replicated pool. Good for bulk/archival data where capacity matters
|
|
# more than the extra replica.
|
|
#
|
|
# placementTarget is immutable: RGW chooses the placement at bucket creation and
|
|
# cannot move an existing bucket between targets, so it can only be set on a
|
|
# fresh Bucket. The operator reports the live placement in status.placementTarget.
|
|
apiVersion: ceph.unkin.net/v1alpha1
|
|
kind: Bucket
|
|
metadata:
|
|
name: raw-archive
|
|
namespace: default
|
|
spec:
|
|
bucketName: raw-archive
|
|
ownerRef: app-owner
|
|
# Cluster-configured placement target. On this estate: "default-placement"
|
|
# (3x replicated) or "ec" (4+1 erasure-coded).
|
|
placementTarget: ec
|