Repository navigation
Description
Problem or Motivation
The buckets, keys, quotas, anonymous read and lifecycle rules of the store must be in git, or they drift. The SeaweedFS operator has CRs for this: Bucket, BucketLifecyclePolicy, S3Identity, S3Credentials, S3Policy, S3PolicyBinding and ResourceReferenceGrant (api/v1 at operator 1.0.43). Thus the store needs no custom reconcile Job.
Proposed Solution & Architectural Design
CRs in k8s/object-store/. The Argo CD Application object-store applies them with SkipDryRunOnMissingResource=true.
- 9 Buckets with
spec.quotaandreclaimPolicy: Retain:reports20 GiB,reports-private20 GiB,cache10 GiB,argo-artifacts10 GiB,backups-gitea30 GiB,backups-llm60 GiB,backups-mattermost40 GiB,backups-devops5 GiB,backups-monitoring10 GiB.local-pathdoes not enforce the claim size, so the quotas are the real limits. anonymousRead(Read, no List) only onreportsandreports-private. The backup buckets never get anonymous access.- BucketLifecyclePolicy:
reports-private: prefixstudies/expires after 90 days;cacheandargo-artifacts: 7 days;- a 90-day rule on the prefix that feat(roadmap): publish the project review and link it on GitHub #4733 gives to version-review HTML;
- every bucket: AbortIncompleteMultipartUpload after 1 day;
backups-*: no Expiration rule.
- S3Identity for each writer:
devops,argo,backup-gitea,backup-llm,backup-mattermost,backup-devopsandbackup-monitoring. Also a reserved read-only identitycloud-backup(Read and List onreports,reports-privateandbackups-*) for the later cloud copy. It gets no key until that item. - S3Credentials with
secretRefto the Secret in each writer namespace, and a ResourceReferenceGrant there. ClusterSecret rows with SecretGenerator values for each key pair (no fixed key ID form). The keyring stays the source. - S3Policy and S3PolicyBinding: each key works only on its own bucket.
- No reconcile script, PostSync Job, CronJob or Python image.
- Fallback, only if a CR fails the build test: the upstream chart at the image version and a
weed shellJob (s3.bucket.create,s3.bucket.quota,s3.anonymous.set,s3.configure) plus one PutBucketLifecycleConfiguration call, about 60 lines.
Target Subsystem
Kubernetes & Minikube Automation (k8s/object-store/).
Existing Tool Considered
The SeaweedFS operator CRs (Apache-2.0). They replace a custom reconcile script: about 50k tokens and 1 hour of YAML, instead of about 250k tokens and 2 hours for a script.
Acceptance Criteria
- After the sync, 9 buckets exist with the quotas in git.
- An anonymous GET of a test object in
reportsreturns 200. An anonymous List ofreportsreturns AccessDenied. An anonymous GET incacheorbackups-giteareturns AccessDenied. - A key of namespace
llmgets AccessDenied onbackups-gitea. - A second sync makes 0 changes. A quota that a person changes by hand goes back to the git value.
- Lifecycle expiry check, on a branch revision: a rule with an Expiration date in the past on prefix
lifecycle-test/ofcacheremoves a test object at the next S3 lifecycle pass. An incomplete multipart upload older than 1 day goes away. - Unit tests: no
backups-*bucket has an Expiration rule, and onlyreportsandreports-privatehaveanonymousRead. - A person ran
uv run devops k8s push-secretsbefore the merge.
Dependencies
- Child 1 of feat(k8s): track the cluster content store #4742: "feat(k8s): run a three-node SeaweedFS object store" (feat(k8s): run a three-node SeaweedFS object store #4750).
- Tracker: feat(k8s): track the cluster content store #4742 (child 2).
Source: #4742
Alternatives check of 2026-11-14: in-use.
The item already names this tool.
Tool: seaweedfs/seaweedfs-operator (https://github.com/seaweedfs/seaweedfs-operator), Apache-2.0, last activity 2026-11-10, maintained.
Coordinator decision of 2026-11-22 (least privilege, decide-and-report): the four platform Buckets of this item (reports, reports-private, cache, argo-artifacts) and their lifecycle policies live in namespace object-store, and the operator watches only object-store. Reason: SeaweedFS operator 1.0.45 sees a Bucket only in a namespace it watches, and the chart gives each watched namespace its manager Role, which can write Secrets. Watching devops and argo-workflows would let the operator read and change every Secret there (the GitHub App keys of the roadmap Service among them). This replaces the refined criterion that puts these Buckets in the writer namespaces. The tenant Buckets of service repositories still come from the tenant chart of dan-petty/infra, in the namespace of each tenant.
Proposed design
Problem statement
The store's buckets, quotas, anonymous read and lifecycle rules live outside git and drift. This change declares the four buckets of the devops and argo-workflows workloads (reports, reports-private, cache and argo-artifacts) as SeaweedFS operator custom resources under k8s/object-store/, with their quotas, Retain policy, anonymous read and lifecycle rules, and adds the object-store Argo CD Application and the homelab project destinations. The tenant backup buckets, the writer identities and keys, and the read-only cloud-backup identity come from the tenant chart of dan-petty/infra#14 and are a separate issue.
Acceptance criteria
Requirement: Object-store manifests validate
The manifests under k8s/object-store/ and the object-store Argo CD Application SHALL pass the repository's Kubernetes validator.
Scenario: Kubernetes validator
- WHEN uv run devops ci --check --only k8s runs on the branch.
- THEN The command exits 0 and the k8s row reports no error.
Requirement: Store bucket quotas in git
The repository SHALL declare four SeaweedFS Bucket resources for reports, reports-private, cache and argo-artifacts with the quotas in git and reclaimPolicy: Retain on each.
Scenario: Buckets on the cluster
- WHEN The live check runs kubectl get buckets.seaweed.seaweedfs.com -A -o yaml.
- THEN The output has a Bucket for reports 20Gi, reports-private 20Gi and cache 10Gi in namespace devops and a Bucket for argo-artifacts 10Gi in namespace argo-workflows, each with reclaimPolicy: Retain and a clusterRef that names the store cluster that feat(k8s): run a three-node SeaweedFS object store #4750 deploys.
Requirement: Anonymous read only on reports
The store MUST allow anonymous GET, without anonymous List, only on reports and reports-private, and MUST refuse anonymous GET on cache.
Scenario: Anonymous GET and List
- WHEN The live check puts a test object in reports, reports-private and cache, and sends an anonymous GET and an anonymous List to the store endpoint.
- THEN reports and reports-private return 200 for GET and AccessDenied for List, and cache returns AccessDenied for GET.
Requirement: Lifecycle rules in git
The repository SHALL declare BucketLifecyclePolicy resources with the expiration and abort-incomplete-multipart rules in git.
Scenario: Lifecycle rules on the cluster
- WHEN The live check runs kubectl get bucketlifecyclepolicies.seaweed.seaweedfs.com -A -o yaml.
- THEN The output shows reports-private with prefix studies/ and a 90-day expiration, cache and argo-artifacts with a 7-day expiration, and each of the four buckets with an abort-incomplete-multipart rule of 1 day.
Requirement: Lifecycle expiry
A lifecycle rule with an Expiration date in the past MUST remove a test object at the next S3 lifecycle pass, and an incomplete multipart upload older than 1 day MUST go away.
Scenario: Expiry on a branch revision
- WHEN The live check runs on a branch revision with a test rule with an Expiration date in the past on prefix lifecycle-test/ of cache, puts a test object there, and waits for the next lifecycle pass.
- THEN The test object is gone, and the incomplete multipart upload older than 1 day is gone.
Requirement: Argo CD Application
The object-store Argo CD Application SHALL set automated sync with prune and self-heal, a retry limit of 5, and SkipDryRunOnMissingResource=true.
Scenario: Application sync policy
- WHEN The live check runs kubectl get application object-store -n argocd -o jsonpath='{.spec.syncPolicy}'.
- THEN The output shows automated.enabled, automated.prune and automated.selfHeal true, retry.limit 5, and SkipDryRunOnMissingResource=true in the sync options.
Requirement: Project destinations
The homelab AppProject SHALL list the namespaces of the store CRs, devops and argo-workflows, in spec.destinations.
Scenario: Project destinations
- WHEN The live check runs kubectl get appproject homelab -n argocd -o jsonpath='{.spec.destinations[*].namespace}'.
- THEN The output includes devops and argo-workflows.
Requirement: No custom reconcile code
The change SHALL add no reconcile script, PostSync Job, CronJob or Python image to k8s/object-store/.
Scenario: Store namespace workloads
- WHEN The live check runs kubectl get jobs,cronjobs -n object-store and kubectl get pods -n object-store -o jsonpath='{.items[].spec.containers[].image}'.
- THEN The first command reports no resources, and the second lists only the SeaweedFS images that feat(k8s): run a three-node SeaweedFS object store #4750 deploys, with no Python reconcile image.
Requirement: No key rows in the ClusterSecret table
The change SHALL add no ClusterSecret row for a store key; the key pair comes from an ESO Password generator.
Scenario: ClusterSecret table
- WHEN A unit test reads CLUSTER_SECRETS in src/devops_cli/k8s/cluster_secrets.py.
- THEN No ClusterSecret in the table has a name that starts with object-store-.
Existing Tool Considered
The alternatives check of 2026-11-14 records the verdict in-use for seaweedfs/seaweedfs-operator (https://github.com/seaweedfs/seaweedfs-operator, Apache-2.0, maintained), and the item already names that tool; the block is the check's record. The check's comment states the one lack: it did not confirm that the pinned version exposes every field the issue lists, such as per-bucket anonymous read with Read but not List. The Bucket CRD read on 2026-11-21 shows scope Namespaced, spec.quota.size, spec.reclaimPolicy with the values Retain and Delete, spec.anonymousRead as a boolean, and spec.access as a list of a user and an action set whose enum holds Read, Write, List, Tagging and Admin, so the design's fields exist at the operator revision of that date (https://github.com/seaweedfs/seaweedfs-operator/blob/master/config/crd/bases/seaweed.seaweedfs.com_buckets.yaml, fetched 2026-11-21), and the live S3 checks of the criteria prove them on the pinned 1.0.43 CRDs. The change builds no reconcile code, so it has no cost to build, keep or fix; it adds YAML and no Python.
Key questions
- Where do the tenant backup buckets, the writer keys and the cloud-backup identity come from?: From the tenant chart in
dan-petty/infra#14, for each namespace with backup.quotaGiB in its services entry: one generic CR form that creates a Bucket, an S3Identity, an S3Credentials, an S3Policy, an S3PolicyBinding and a ResourceReferenceGrant. The key pair comes from an ESO Password generator, not from a push-secrets row. The chart is a shared template, which ADR 0032 puts in dan-petty/infra, and the quota, the namespace and the Secret source are environment values, which it puts in dan-petty/homelab. This item defers that part to a new issue, so it declares no backup bucket, writer key or cloud-backup identity. (best practice) [sources: docs/adr/0032-infrastructure-templates-live-in-four-homes.md:39, docs/adr/0032-infrastructure-templates-live-in-four-homes.md:40, docs/adr/0032-infrastructure-templates-live-in-four-homes.md:44]- Chosen: The tenant chart of
dan-petty/infra#14. The owner decided it: one generic CR form per namespace with backup.quotaGiB, and the shared template lives in infra while its values live in the environment repository. - Rejected: Hand-written CRs for each writer in k8s/object-store/. The owner replaced it; the per-tenant form belongs in the chart that the tenant namespaces already read, and a copy here would drift from it.
- Rejected: A reconcile script with weed shell. The operator CRs replace it, and it adds code that the project must keep.
- Chosen: The tenant chart of
- Who runs uv run devops k8s push-secrets before the merge?: No person runs it for a store key. The owner decided that the key pair comes from an ESO Password generator and not from a push-secrets row, so this change adds no ClusterSecret row and no pod reads a store Secret; the push-secrets rule applies only to a Secret that has a row. The deferred tenant-chart issue adds the rows it needs to the cluster-secrets table of the environment that holds the store, dan-petty/homelab k8s/cluster-secrets.toml (
dan-petty/homelab#96). (best practice) [sources: k8s/README.md:736]- Chosen: ESO Password generator in the tenant chart. The owner decided it: the chart makes the key pair, so no keyring value and no push-secrets step is needed.
- Rejected: ClusterSecret rows pushed by devops k8s push-secrets. The owner refused it; the key pair would then live in the workstation keyring.
- Which AppProject holds the store CRs, and which destinations does it need?: The homelab project, as every leaf Application under k8s/argocd/apps/ uses it. Its destinations already list devops, so the change adds argo-workflows for the argo-artifacts Bucket and its lifecycle policy. No AppProject named services-admin exists in this repository; the owner names services-admin for the tenant chart's CRs, which the deferred issue covers in the repository that holds that chart. (best practice) [sources: k8s/argocd/apps/llm.yaml:11, k8s/argocd/apps/projects.yaml:24, k8s/argocd/apps/projects.yaml:34]
- Chosen: Use homelab and add the argo-workflows destination. It is the project of every leaf Application here, it already lists devops, and Argo CD refuses a resource whose namespace the project does not list.
- Rejected: Use services-admin for these CRs. No AppProject named services-admin exists in this repository; the owner names it for the tenant chart's CRs, which the deferred issue carries.
- Rejected: Rely on the Application destination without listing it. The sync fails the project check.
- What scope and namespace does each store CR get?: The Bucket and BucketLifecyclePolicy CRDs are Namespaced, so the design writes the namespace of each CR. The reports, reports-private and cache Buckets and their lifecycle policies live in devops, the namespace of the workload that writes them; argo-artifacts and its lifecycle policy live in argo-workflows, not in a bare argo namespace. Each CR names the SeaweedFS cluster that feat(k8s): run a three-node SeaweedFS object store #4750 deploys in object-store through clusterRef.namespace, because the CR sits in another namespace. The CR form keeps the namespace as a value, so the tenant chart can place the same form in each tenant namespace. (best practice) [sources: https://github.com/seaweedfs/seaweedfs-operator/blob/master/config/crd/bases/seaweed.seaweedfs.com_buckets.yaml, k8s/namespaces.yaml:79, k8s/namespaces.yaml:103, docs/adr/0008-argo-workflows-run-the-roadmap-jobs-after-a-measured-go.md:17]
- Chosen: One namespace per writer workload, written in the design. The owner asked for the scope and the namespace of each CR in the design, the CRDs are namespaced, and the admin project must list them.
- Rejected: All store CRs in one object-store namespace. A writer key then reaches across namespaces, and the per-namespace grant of the tenant chart cannot scope it.
- Rejected: Cluster-scoped CRs. The operator's Bucket CRD is Namespaced, so a cluster-scoped object is refused.
- Does the operator's Bucket CR expose the fields that the design sets?: Yes, in the master CRD read on 2026-11-21: Bucket is Namespaced and has spec.quota.size, spec.reclaimPolicy with the values Retain and Delete, spec.anonymousRead as a boolean, spec.access as a list of a user and an action set whose enum holds Read, Write, List, Tagging and Admin, and exactly one of spec.clusterRef or spec.seaweedRef. The live S3 checks of the criteria prove the same fields on the pinned 1.0.43 CRDs. [sources: https://github.com/seaweedfs/seaweedfs-operator/blob/master/config/crd/bases/seaweed.seaweedfs.com_buckets.yaml]
- How does Argo CD apply the CRs before the operator CRDs exist?: A raw leaf Application k8s/argocd/apps/object-store.yaml sets SkipDryRunOnMissingResource=true and retry.limit: 5, as the other leaf Applications do. A sync that races the CRDs retries instead of failing for good. (best practice) [sources: k8s/argocd/apps/llm.yaml:24, k8s/argocd/apps/llm.yaml:31, k8s/README.md:1055]
- Chosen: Skip the dry run and retry 5 times. It is the repository pattern for a kind whose CRD may be absent, and the retry covers the race.
- Rejected: Pre-install the CRDs by hand. It adds a manual step, and feat(k8s): run a three-node SeaweedFS object store #4750 installs the operator and its CRDs.
- Rejected: A sync wave before the operator. The CRs cannot apply before their CRDs exist.
- How does the plan correct manual drift?: Automated sync with prune: true and selfHeal: true, as the other leaf Applications use. A manual quota change returns to the git value. (best practice) [sources: k8s/README.md:1274, k8s/argocd/apps/llm.yaml:20]
- Chosen: Automated sync with self-heal. A manual quota change returns to the git value with no person step.
- Rejected: Manual sync only. It leaves drift in place until a person syncs.
- Rejected: A CronJob that patches quotas. It adds custom reconcile code that the operator replaces.
- Where does the 90-day lifecycle rule for the version-review HTML go?: To a new issue, because feat(roadmap): publish the project review and link it on GitHub #4733 has not yet fixed the bucket and the prefix that hold the HTML. A rule on a guessed prefix expires nothing or expires other objects, so the new issue adds the rule when feat(roadmap): publish the project review and link it on GitHub #4733 names the prefix. (proposed)
- Chosen: Defer the rule until feat(roadmap): publish the project review and link it on GitHub #4733 names the prefix. A rule on an unknown prefix is untestable and can expire the wrong objects.
- Rejected: Guess the prefix and add the rule now. A wrong prefix expires other objects, and a rule on a prefix with no object expires nothing.
- Rejected: Put the rule on the cache bucket. The version-review HTML is not the cache, and the cache already expires at 7 days.
- Does this change wait on the environment-tree migration feat(argocd): read the environment from the homelab repo #5134?: It merges in k8s/object-store/ here only before plan step 10 of feat(argocd): read the environment from the homelab repo #5134. From step 12 the freeze refuses a change to an environment path that homelab holds, and the part that misses the window lands in dan-petty/homelab, with its Secret rows in k8s/cluster-secrets.toml (
dan-petty/homelab#96). (best practice) [sources: docs/HOMELAB_REPO_SWITCH.md:174, docs/HOMELAB_REPO_SWITCH.md:178, docs/adr/0032-infrastructure-templates-live-in-four-homes.md:71]- Chosen: Merge here before plan step 10 of feat(argocd): read the environment from the homelab repo #5134. The owner's answer allows it, and the freeze starts only at step 12.
- Rejected: Wait and land the whole change in homelab. It keeps the store outside git for the length of the migration, and no homelab Application is added before step 12.
Fit
Fits in one pull request.
Suspected block
The environment-tree migration #5134: its step 12 freeze refuses changes to the environment paths that homelab holds, so a part that misses its plan step 10 lands in dan-petty/homelab (dan-petty/homelab#96).
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(k8s)scope of the title gives the scope.It is a prerequisite for backups and reports, but it is not a security fix or a broken production path.It gives every service a durable, quota-limited, access-controlled store and removes a custom reconcile script.The work is well-scoped YAML for 9 buckets, lifecycle policies, identities, credentials, and bindings, estimated at about 1 hour.Both target the Gitea backup path, but the candidate creates the backups-gitea bucket and store rules while 2144 builds the scheduled backup and restore job that writes to it.devops-cli-service commentedon Nov 14, 2026
Alternatives check: in-use
Reason: The searches found the SeaweedFS operator, whose CRDs declaratively cover exactly what the issue needs: buckets with quota and reclaimPolicy, lifecycle policies, S3 identities, credentials, policies and policy bindings, so no custom reconcile Job or script is required. The issue itself already names the SeaweedFS operator CRs as the existing tool considered, so it is in use.
The item already names this tool.
Tool: seaweedfs/seaweedfs-operator (https://github.com/seaweedfs/seaweedfs-operator)
Covers:
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 15, 2026
Owner question: Who runs
uv run devops k8s push-secretsbefore the merge? (a person decides)Options
Recommendation: Decide the question: only a person can answer it.
Evidence
fix(roadmap): Keep blockers that a sentence opens with other words (#…
devops-cli-service commentedon Nov 20, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
dan-petty commentedon Nov 21, 2026
Answer: I run
uv run devops k8s push-secretsfor the sevenobject-store-<identity>rows from the branch of this item, before the merge. The writer namespaces exist, so the push works before the merge. I merge only when--planshows every keyunchanged. #4750 merges first.devops-cli-service commentedon Nov 21, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
3 remaining items
test(k8s): hold the store buckets to namespace object-store
fix(k8s): put the store buckets in namespace object-store
docs(openspec): record the store namespace of the buckets
test(k8s): hold the store buckets to namespace object-store
fix(k8s): put the store buckets in namespace object-store
docs(openspec): record the store namespace of the buckets
devops-cli-service commentedon Nov 22, 2026
Released in v0.193.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.193.0
devops-cli-service commentedon Nov 22, 2026
Live since 2026-11-22 05:04 UTC