feat(miner-deployment): add Kubernetes StatefulSet + Secret example for AMS fleet-mode - #5250
feat(miner-deployment): add Kubernetes StatefulSet + Secret example for AMS fleet-mode#5250davion-knight wants to merge 1 commit into
Conversation
…or AMS fleet-mode Add k8s/ example manifests so an operator can deploy N isolated miner workers with kubectl instead of hand-rolling manifests or being limited to docker run/compose (JSONbored#5181). Uses a StatefulSet (not a Deployment) with volumeClaimTemplates so each replica gets its OWN PersistentVolumeClaim — the miner's local SQLite ledgers are not safe for concurrent multi-pod access, so per-pod isolated storage is the safety property. Built on the existing Dockerfile image (entrypoint gittensory-miner, continuous 'run' worker, /data/miner state). Ships a Secret template (GITHUB_TOKEN + optional provider keys), a k8s/README.md deploy/scale guide, and a validation test asserting well-formed manifests pass, a malformed one fails, and the per-pod-storage invariant holds (no shared PVC across replicas). Packaging only — no runtime/governor/claim control-flow touched. Closes JSONbored#5181
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5250 +/- ##
=======================================
Coverage 94.34% 94.34%
=======================================
Files 473 473
Lines 39982 39982
Branches 14576 14576
=======================================
Hits 37722 37722
Misses 1585 1585
Partials 675 675
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - fixes requiredReview updated: 2026-07-12 11:48:11 UTC
🛑 Suggested Action - Fix Blockers Review summary Nits — 5 non-blocking
CI checks failing
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
|
Gittensory is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-code)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Adds
k8s/example manifests so an operator can run N isolated miner workers on a small cluster withkubectl(#5181). Built on the existingpackages/gittensory-miner/Dockerfileimage. (Resubmit of #5246 — fixes below.)Fixes vs #5246 (which was auto-closed)
miner-secret.example.yamlno longer commits placeholder credential strings — all values are empty (GITHUB_TOKEN: ""), and the README shows thekubectl create secret --from-literalpath so real values never touch a file. The scanner triggers on the value, not intent.runAsGroup: 1000+fsGroup: 1000+fsGroupChangePolicy: OnRootMismatchso the non-root worker owns its PVC and can create SQLite files on a root-ownedReadWriteOncevolume.storageClassNameexample in the volumeClaimTemplate; README notes on image-tag pinning and probes.Why a StatefulSet (not a Deployment)
The miner keeps all state in local SQLite ledgers not safe for concurrent multi-pod access, so each replica needs its OWN volume. A Deployment shares one PVC across replicas; a StatefulSet's
volumeClaimTemplatesgive each replica its own — the per-pod-isolation safety property this issue requires.Contents
k8s/miner-deployment.yaml— StatefulSet: configurablereplicas, per-podvolumeClaimTemplatefor/data/miner, non-root securityContext withfsGroup, resource requests/limits, continuousrunworker, secret-sourcedGITHUB_TOKEN(+ optional provider keys).k8s/miner-secret.example.yaml—Secrettemplate (empty values) forGITHUB_TOKEN+ optional provider keys.k8s/README.md— deploy sequence, scaling, and the StatefulSet/fsGroup rationale.Validation
test/unit/miner-k8s-manifests.test.ts(7 tests): real manifests are well-formed Kubernetes; a deliberately malformed manifest fails the validator; the per-pod-storage invariant holds (hasvolumeClaimTemplates, rejects a shared-PVC config, rejects a no-volumeClaimTemplates config).src/**logic touched.Closes #5181