4. Multi-Target Deployment Compiler

Fleetmesh nodes are deployed across diverse computing environments—from large enterprise Kubernetes clusters to edge IoT devices running rootless Podman or raw systemd.

To eliminate brittle configuration drift between environments, meshctl export serves as a multi-target deployment compiler. It ingests standard apiVersion: fleetmesh.org/v1alpha1 manifests and compiles them into production-hardened templates for target orchestrators.

4.1. Compilation Targets

The compiler supports four primary target architectures:

Target Identifier

Platform

Generated Artifacts

--target=k8s

Kubernetes

Deployments, ClusterIP/NodePort Services, ConfigMaps, and Secret references.

--target=quadlet

Podman Quadlet

Rootless systemd .container units, user namespaces, and security opt-ins.

--target=systemd

Linux systemd

Hardened .service and .timer unit files with Linux namespace sandboxing.

--target=compose

Docker Compose

Multi-container topology definitions (docker-compose.yaml) with isolated networks.

4.2. Kubernetes (--target=k8s)

Compiling to Kubernetes generates fully qualified Kubernetes manifests incorporating recommended cloud-native patterns:

meshctl export -f manifests/meshnode.yaml --target k8s > k8s-meshnode.yaml

Key features of the generated Kubernetes manifest: - Stateful Persistence: Mounts persistent volumes for /var/lib/fleetmesh to ensure cryptographic keys (keys.json) and databases (store.sqlite, grants.sqlite) survive pod rescheduling. - Port Mapping: Exposes required transport ports:

  • UDP port 11801 for Iroh QUIC transport.

  • TCP port 7777 for WebSocket relay bridging.

  • TCP port 8000 for HTTP/Blossom storage and JSON-LD endpoints.

  • Liveness & Readiness Probes: Leverages the meshctl status command to provide deterministic Kubernetes health probes over the control socket.

4.3. Podman Quadlet (--target=quadlet)

For rootless container execution on modern Linux distributions (Fedora CoreOS, RHEL, openSUSE MicroOS), Podman Quadlet translates .container files directly into user-mode systemd services:

meshctl export -f manifests/meshnode.yaml --target quadlet > ~/.config/containers/systemd/node.container

Generated configuration includes: - Rootless user namespace remapping (UserNS=auto). - Memory and CPU limits derived from manifest capacity declarations. - Direct host network passthrough option for high-throughput QUIC packet processing. - Automatic integration with systemctl --user start node.service.

4.4. Hardened systemd (--target=systemd)

When running directly on bare metal or virtual machines without container virtualization, meshctl export –target=systemd produces systemd service units fortified with defense-in-depth Linux isolation primitives:

meshctl export -f manifests/meshnode.yaml --target systemd > /etc/systemd/system/meshnode.service

Security hardening directives applied automatically:

[Service]
Type=simple
User=fleetmesh
Group=fleetmesh
ExecStart=/usr/local/bin/meshnode /var/lib/fleetmesh run
Restart=always
RestartSec=5s

# Sandboxing & Security Controls
ProtectSystem=strict
ProtectHome=true
NoNewPrivileges=true
PrivateTmp=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
ReadWritePaths=/var/lib/fleetmesh

4.5. Docker Compose (--target=compose)

For local development clusters and automated integration testbeds, meshctl export –target=compose outputs a self-contained docker-compose.yaml file:

meshctl export -f manifests/fleet-cluster.yaml --target compose > docker-compose.yaml
docker compose up -d

Features: - Configures bridge networks with deterministic internal IP addressing. - Sets up local volume mounts for easy log and database inspection. - Provisions sidecar containers (e.g., local strfry relay or Blossom storage nodes) automatically when specified in manifest extensions.