Skip to content

B2-2: Add Docker Compose and Kubernetes deployment manifests #146

Closed

Description

@scttfrdmn

Summary

Create a Docker Compose file for local distributed development and Kubernetes manifests for production cluster deployment. The deploy/ directory currently exists but is completely empty.

Files to Create

deploy/docker/docker-compose.yaml

3-node ObjectFS cluster + LocalStack S3, suitable for local distributed mode development:

services:
  localstack:
    image: localstack/localstack:3
    ports: ["4566:4566"]
    environment:
      SERVICES: s3
      AWS_DEFAULT_REGION: us-east-1

  objectfs-1:
    build: ../..
    command: mount --foreground --config /etc/objectfs/config.yaml s3://test-bucket /mnt/data
    devices: ["/dev/fuse:/dev/fuse"]
    cap_add: [SYS_ADMIN]
    environment:
      OBJECTFS_CLUSTER_ENABLED: "true"
      OBJECTFS_CLUSTER_NODE_ID: "node-1"
      OBJECTFS_CLUSTER_ADVERTISE_ADDR: "objectfs-1:7946"
      OBJECTFS_CLUSTER_SEEDS: "objectfs-1:7946,objectfs-2:7946,objectfs-3:7946"
    depends_on: [localstack]

  objectfs-2: # mirrors objectfs-1 with node-2 identity
    ...

  objectfs-3: # mirrors objectfs-1 with node-3 identity
    ...

deploy/kubernetes/daemonset.yaml

Runs ObjectFS on every cluster node using /dev/fuse device (not privileged):

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: objectfs
spec:
  template:
    spec:
      containers:
      - name: objectfs
        image: ghcr.io/scttfrdmn/objectfs:latest
        securityContext:
          capabilities:
            add: ["SYS_ADMIN"]
          allowPrivilegeEscalation: false
        volumeMounts:
        - name: fuse
          mountPath: /dev/fuse
        - name: mount-point
          mountPath: /mnt/objectfs
          mountPropagation: Bidirectional
      volumes:
      - name: fuse
        hostPath:
          path: /dev/fuse
      - name: mount-point
        hostPath:
          path: /mnt/objectfs

deploy/kubernetes/rbac.yaml

Minimal RBAC — no cluster-admin required.

deploy/README.md

Documents both deployment modes with quick-start instructions.

Acceptance Criteria

  • docker compose up --wait starts all 3 ObjectFS nodes and LocalStack; all nodes show as alive
  • docker compose down tears down cleanly (mounts unmounted)
  • Kubernetes manifests pass kubectl --dry-run=client apply -f deploy/kubernetes/
  • deploy/README.md explains both modes and includes a troubleshooting section

Activity

  1. added
    type: enhancement
    priority: medium
    area: config
    on Apr 7, 2026
  2. scttfrdmn commented on Jul 30, 2026

    @scttfrdmn
    OwnerAuthor

    Note from the v0.10.0 review — two corrections

    deploy/ does not exist. The issue states it "currently exists but is completely empty."
    There is no such directory in the repo, so the work is creating it rather than populating it.
    Minor, but it changes the first step.

    The 3-node acceptance criterion depends on #139. "All nodes show as alive" requires a working
    ClusterManager in the running process and gossip actually exchanging state. Neither is wired
    today — Adapter has no cluster field, and config.ClusterConfig cannot be passed to
    distributed.NewClusterManager without a translation layer (see the note on #139). It also
    requires env-var config binding for per-node identity, which should be confirmed as working or
    added to scope.

    Suggest either adding #139 as an explicit dependency, or splitting this into the
    single-node container work (which is unblocked and useful now) and the multi-node compose
    topology (which is not).

  3. scttfrdmn commented on Aug 2, 2026

    @scttfrdmn
    OwnerAuthor

    Corrections: deploy/ does not exist, and the Compose file specifies LocalStack

    Re-verified against main.

    1. "The deploy/ directory currently exists but is completely empty" is wrong — it does not exist at all (ls -d deploy → No such file or directory). Minor, but it changes the first step from "populate" to "create", and an empty directory would not have survived in git anyway.

    2. The Compose file uses LocalStack, which this project does not test against. CLAUDE.md states integration tests hit real AWS S3 and explicitly says no LocalStack; v0.10.1 built internal/testaws/, which runs the real S3 backend against an in-process substrate endpoint over real HTTP — no network, no credentials, no account. Shipping a LocalStack dependency in deploy/ would make the recommended local development path diverge from the one CI exercises, and would be a third S3 emulation story alongside substrate and real AWS.

    For a Compose file the choice is narrower than for tests, since substrate is in-process and Compose needs a network service. Reasonable resolutions, in order:

    • Point the Compose stack at real S3 with a bucket the developer supplies, and document the credential passthrough. Matches what the project tests.
    • Or run substrate as a standalone container if it grows a server binary — worth asking upstream before assuming it can't.
    • Or keep LocalStack but say plainly in the file's header comment that it is a convenience for wiring up gossip and not an S3-fidelity target, so nobody debugs an ObjectFS/S3 semantics question against it.

    3. The command: line assumes a subcommand that does not exist yet. mount --foreground --config ... s3://bucket /mnt/data requires #134 (subcommand routing). Today cmd/objectfs/main.go takes exactly two positional arguments and no subcommands. The dependency should be explicit — as written the manifests would ship broken.

    4. The env-var names do not exist. OBJECTFS_CLUSTER_ENABLED, OBJECTFS_CLUSTER_NODE_ID, OBJECTFS_CLUSTER_ADVERTISE_ADDR, and OBJECTFS_CLUSTER_SEEDS have zero hits repo-wide. internal/config/config.go:720-850 has an explicit env-mapping table — 24 variables, none of them cluster. So this issue also owns adding those four mappings, or the manifests configure nothing. That is the same defect class as the eighteen inert FUSE fields removed in v0.10.1: a name that looks like a knob and is read by nothing. A test asserting the four variables reach Configuration.Cluster belongs in the acceptance criteria.

    5. area: config is the wrong label for deployment manifests; area: build or area: docs fits better. Low stakes, but it is why this issue is easy to miss when triaging packaging work.

    Accurate as written: the DaemonSet's /dev/fuse + SYS_ADMIN + allowPrivilegeEscalation: false + mountPropagation: Bidirectional shape is right, and notably better than the privileged: true most FUSE-in-Kubernetes examples reach for.

  4. added
    effort: medium
    on Aug 3, 2026
  5. scttfrdmn commented on Aug 9, 2026

    @scttfrdmn
    OwnerAuthor

    Scoping note: this issue specifies LocalStack, which this project rules out.

    CLAUDE.md:130 ("Integration tests hit real AWS S3 (no LocalStack)") and CONTRIBUTING.md:189 ("Do not use LocalStack, and prefer not to write a mock") are both explicit, and #240 deleted an entire tests/integration/ suite for targeting it. The issue text predates that decision.

    The replacement is internal/testaws — the real S3 backend against an in-process substrate endpoint over real HTTP: no network, no credentials, no AWS account. For anything an emulator cannot answer, real AWS behind -tags=integration with AWS_PROFILE=aws AWS_REGION=us-west-2. A hand-written mock is the last resort, because a mock sits on the far side of a seam and agrees with its caller by construction — which is how 32,680 lines of tests missed roughly 45 defects.

    Whoever picks this up should substitute accordingly rather than following the issue body literally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: configeffort: mediumpriority: mediumtype: enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions