One-command Kubernetes + AWS deployment, multi-arch images - #15
Merged
Conversation
…ublishing deploy/kubernetes — kustomize tree for the serverless topology: - serving: StatefulSet with a PVC per replica (a warm disk makes restarts a seconds-long delta catch-up; two replicas sharing one PVC would corrupt each other, hence StatefulSet not Deployment), startupProbe sized for cold rebuilds (the engine binds the port only AFTER loading collections — without it a big rebuild gets liveness-killed into a crash loop), fsGroupChangePolicy: OnRootMismatch (no recursive chown of warm caches) - writer: stateless Deployment, emptyDir scratch, kill-any-time - components/cold: optional serve-from-storage tier, warm promotion off - pod security throughout: runAsNonRoot uid 10001 (the image's user), seccomp RuntimeDefault, all capabilities dropped - overlays: minio-dev (self-contained on any local cluster) and aws (real S3; IRSA or access-key auth; optional secret so IRSA needs none) deploy/terraform/aws — the storage half: - private S3 bucket: public-access block, KMS encryption, TLS-only bucket policy, incomplete-multipart lifecycle cleanup, versioning deliberately off (the LSM manages object lifecycle; versioning would resurrect deleted fragments), force_destroy=false so destroy refuses on data - least-privilege IAM (object CRUD + list + multipart only), IRSA role with correctly-scoped OIDC trust, or opt-in IAM user + access key .github/workflows/docker.yml — publishes ghcr.io/runcaptain/compass (amd64+arm64) on release tags; the overlays reference it. Builder base rust:1.88-bookworm -> rust:1.88-trixie: bookworm's gcc-12 fails on the numkong dependency's ARM feature probes, making arm64 images impossible. Tested, not just written: minio-dev overlay deployed on a live k3s cluster — all tiers 1/1, PVC bound, 8/8 in-cluster checks through the Services (cross-tier read-your-writes writer->serving, role refusal, cold tier serving from the bucket), data survives serving-pod replacement via the PVC; terraform apply/re-apply/destroy exercised against an AWS API emulator (idempotent; destroy refuses while the bucket holds data); both image architectures built from the new base. Signed-off-by: Edgar Babajanyan <bedgar2005@gmail.com>
The advisory landed 2026-07-05 and fails cargo audit on every PR. cxx is a transitive dependency (usearch bindings); the unsound let_cxx_string! macro is not used anywhere in this workspace, but the clean fix is the patched version rather than an audit ignore. Suites unaffected. Signed-off-by: Edgar Babajanyan <bedgar2005@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
"Deploy Compass serverless on AWS" was a docs page (
docs/deployment.md), not an artifact. A stranger had no manifests, no Terraform, and — silently worse — no public container image at all: the release workflow publishes binaries, nothing publishes to a registry, and arm64 images were impossible (bookworm's gcc-12 fails on thenumkongdependency's ARM feature probes):What this ships
deploy/kubernetes— kustomize tree for the full serverless topology on any cluster:runAsNonRootas the image's uid 10001, seccompRuntimeDefault, all capabilities dropped,fsGroupChangePolicy: OnRootMismatchso a large warm cache isn't recursively chowned on every mount.minio-dev(the whole topology self-contained on kind/k3s/minikube in onekubectl apply -k) andaws(real S3; IRSA or access-key auth; the AWS secret is optional so IRSA needs none).deploy/terraform/aws— the storage half: private S3 bucket (public-access block, KMS encryption, TLS-only bucket policy, incomplete-multipart cleanup, versioning deliberately off — the LSM manages object lifecycle and versioning would resurrect deleted fragments,force_destroy=falseso destroy refuses while data exists) + least-privilege IAM (object CRUD/list/multipart only) as an IRSA role or an opt-in access key..github/workflows/docker.yml— publishesghcr.io/runcaptain/compass(amd64+arm64) on release tags; the overlays reference it. Builder base →rust:1.88-trixie(same toolchain pin; gcc-14 unblocks arm64).Tested, not just written
1/1 Running, PVCBound, security context verified applied. 8/8 in-cluster checks through the Services: health on all tiers, writer-tier ingest → serving-tiermin_seqread-your-writes, writer role refusal, cold tier answering from the bucket. Data survives serving-pod deletion (PVC warm restart).destroywith data in the bucket refuses (BucketNotEmpty) exactly as designed.k8s.ionamespace, uid mismatch (65532 vs the image's 10001), and the boot-order/probe interaction.Notes
deploy/README.md): NetworkPolicy (cluster-specific), PodDisruptionBudget (single-replica default), tenant-affinity routing (roadmap).ghcr.io/runcaptain/compassexists before announcing the overlays.writer refuses readsreturns HTTP 500 today; 403 would be cleaner — engine nit, noted for a follow-up, not deploy scope.