惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V2EX - 技术
V2EX - 技术
L
LangChain Blog
IT之家
IT之家
S
SegmentFault 最新的问题
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
The Blog of Author Tim Ferriss
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
U
Unit 42
B
Blog RSS Feed
GbyAI
GbyAI
Microsoft Security Blog
Microsoft Security Blog
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
T
Threatpost
C
CERT Recently Published Vulnerability Notes
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
Vercel News
Vercel News
S
Schneier on Security
Spread Privacy
Spread Privacy
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
博客园 - 叶小钗
雷峰网
雷峰网
博客园_首页
人人都是产品经理
人人都是产品经理
P
Palo Alto Networks Blog
The Hacker News
The Hacker News
T
Tor Project blog
L
Lohrmann on Cybersecurity
Know Your Adversary
Know Your Adversary
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
P
Privacy International News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tenable Blog
V
Vulnerabilities – Threatpost
大猫的无限游戏
大猫的无限游戏
博客园 - 【当耐特】
V
V2EX
Security Latest
Security Latest
A
About on SuperTechFans
Cloudbric
Cloudbric
S
Security Affairs
MongoDB | Blog
MongoDB | Blog
Y
Y Combinator Blog
Martin Fowler
Martin Fowler
TaoSecurity Blog
TaoSecurity Blog

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店 GitHub - EdoardoBambini/Agent-Armor-Iaga: AI agents are getting tool access — shell, file system, databases, APIs, secrets. But **nobody is governing what they actually do with it**. Frameworks like LangChain, CrewAI, AutoGen, and Claude Code give agents the power to execute. Agent Armor gives you the power to control, audit, and approve every single action before it happens. HN Vibes — Week 15, Apr 7–13 2026 GitHub - chojs23/ec: Easy terminal-native 3-way git mergetool vim-like workflow GitHub - SethPyle376/hiraeth: Local AWS emulator focused on fast integration testing, with SQS support, SQLite-backed state, and a debug-friendly web UI. GitHub - JakOb-dotcom/cloud-sandbox-security-analysis: Technical analysis and Proof of Concept (PoC) regarding environment variable exfiltration in containerized cloud sandboxes via side-channel data leaks. Springboards - Flint Alpha Show HN: A simpler coding agent harness GitHub - audiodude/sudomake-friends GitHub - 256thFission/mini-mythos: OSS clone of Anthropic’s Mythos harness to locate C/C++ memory vulnerabilities Show HN: OpenParallax: OS-level privilege separation for AI agent execution Hacker News Sorted - Chrome 应用商店 Show HN: How to Install Docker on Ubuntu 24.04 LTS: Complete 2026 Guide GitHub - himanshudongre/smriti GitHub - sverrirsig/claude-control: macOS desktop dashboard for monitoring and managing multiple Claude Code sessions GitHub - ory/dockertest: Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work. Chiral - Chrome 应用商店 Show HN: Two Claudes collaborating through shared memory on a $100 mini-PC GitHub - pmichaillat/latex-cv: Minimalist LaTeX template for academic CVs GitHub - oguzbilgic/posse: A web UI for Anthropic Managed Agents. GitHub - sshiraz/depsly: Dependency risk analysis tool for npm packages ABI Add safari/agent-harness — Safari browser automation via safari-mcp by achiya-automation · Pull Request #212 · HKUDS/CLI-Anything GitHub - Halfblood-Prince/trustcheck: Verify PyPI package attestations and improve Python supply-chain security GitHub - oguzbilgic/kern-ai: Agents that do the work and show it. GitHub - bruits/satteri: High-performance Markdown and MDX processing for the JavaScript ecosystem GitHub - tylergibbs1/feedstock: High-performance web crawler and scraper for TypeScript, powered by Bun and Playwright GitHub - Grimm67123/grimmbot: The self-improving sandboxed and open-source AI agent. With persistent memory and scheduling. GitHub - whitevanillaskies/whitebloom: Local whiteboard that blooms. GitHub - hwdsl2/docker-whisper: Docker image for a self-hosted Whisper speech-to-text server with speaker diarization and OpenAI-compatible transcription and translation APIs. Powered by faster-whisper. Supports all Whisper models, NVIDIA GPU (CUDA) acceleration, JSON/SRT/VTT output, SSE streaming, offline mode, and multi-arch (amd64, arm64). GitHub - yisding/reviewwiggum GitHub - MarwanAlsoltany/serrors: Structured errors for Go: sentinel hierarchies, typed data, custom formatting, and slog integration. GitHub - soatok/age-php GitHub - Luthiraa/markitme GitHub - stagas/rtdiff: realtime git diff gui and AI-assisted commits GitHub - tombedor/excalicharts GitHub - wh1le/excalidraw-edit: Open and edit .excalidraw files from the terminal. Offline, auto-saves to disk. MalExt Sentry - Malicious Extension Scanner - Chrome 应用商店 GitHub - syi0808/asciianimesvg: Generate animated ASCII art SVGs from text. CLI, Rust library, WASM, and web editor. GitHub - zaina-ml/ml_forge: A visual-based graph node editor for training computer vision models. GitHub - anakin87/llm-rl-environments-lil-course: 🌱 A little course on Reinforcement Learning Environments for evaluating and training Language Models GitHub - takaakit/superpowers-uml: Superpowers-UML modifies Superpowers to ensure a software development workflow in which AI agents design through UML modeling. AdriByte Studio - Sviluppo Web e Soluzioni Digitali GitHub - chouligi/angel-copilot: Your personalized Angel Investment Advisor Show HN: MoodSense AI (ML and FastAPI and Gradio, Deployed on Hugging Face) Moodsense Ai - a Hugging Face Space by aman179102 GitHub - agenteractai/lodmem: Level Of Detail Context Management for Agents GitHub - ostefani/subnetlens: A fast, concurrent network scanner with a TUI and plain-text CLI, built in Go. It discovers live hosts on your network, scans their open ports, resolves hostnames, and fingerprints operating systems—delivered. Cyber Pulse: Agentic Intel - Apps on Google Play Whisper API: Self-Hostable Speech to Text Transcription The Agent-Web Protocol Stack: A Research Thesis GitHub - msmarkgu/RelayFreeLLM: A restful API designed to route user prompts to various AI model providers. Show HN: Provepy – A Python decorator that proves your code using Lean and LLMs Show HN: Pardonned.com – A searchable database of US Pardons GitHub - patrickdappollonio/dux: Dux is a terminal UI that lets you run multiple AI coding agents side by side, each in its own git worktree, with full companion terminals, macros, commit generation, and a command palette that knows more tricks than you do. kMC Crystal Simulator Show HN: HyperFlow – A self-improving agent framework built on LangGraph GitHub - stef41/vibescore: 🎵 Grade your vibe-coded project. One command, instant letter grade across security, quality, dependencies, and testing. GitHub - stef41/lmscan: 🔍 Detect AI-generated text and fingerprint which LLM wrote it. Open-source GPTZero alternative. Zero dependencies, works offline. imgur.com GitHub - visionscaper/collabmem: Enabling long-term collaboration with Agentic AI - building up episodic and world model memory over time with in-context awareness 在 Steam 上购买 FriedrichAI: Offline AI 立省 10% GitHub - atripati/ark: AI Runtime Kernel — a context operating system for AI agents. Eliminates tool bloat, loads only what’s needed, and gives LLMs their reasoning space back. GitHub - nowork-studio/toprank: Open-source Claude Code skills for SEO, SEM, Google Ads GitHub - tacomanator/sash: Lightweight macOS menu bar app for reliably cycling through windows of the current application. Appents | Social Media Management for Product-First Teams GitHub - pnhoang/youtube-spam-blocker: Automatically detects and hides spam messages in YouTube Live chat. Set rate limits, keyword filters, and block repeat offenders. GitHub - decisionnode/DecisionNode: CLI + Local MCP - A shared structured memory store across Claude Code, Cursor, Windsurf, Antigravity, and every MCP client. Semantically queryable. GitHub - AvaCodeSolutions/django-email-learning: An open source Django app for creating email-based learning platforms with IMAP integration and React frontend components. The $100K Gap in Kubernetes Security Tooling Function Calling Harness: From 6.75% to 100%
GitHub - debarshibasak/superkube
debarshri · 2026-05-01 · via Hacker News: Show HN

A minimal, single-binary Kubernetes-compatible control plane in Rust. Building it just because I want to build it.

PS: I am working towards making this platform production grade.

superkube server boots the API server and registers the host as a node — one process, one binary, real containers running through Docker (macOS) or libcontainer (Linux), accessible from real kubectl.

Screenshot 2026-05-01 at 16 54 50 Screenshot 2026-05-01 at 16 55 27

What works

  • kubectl-shaped API: discovery, table responses, cluster-info, get all, describe, logs -f, exec, port-forward.
  • Workloads: Pods, Deployments, StatefulSets, DaemonSets — each with their own controller loop.
  • Networking: Services (ClusterIP, NodePort, LoadBalancer), Endpoints; a userspace NodePort proxy on every node forwards to local pods.
  • Configuration: ServiceAccount, Secret, ConfigMap.
  • RBAC (storage only): ClusterRole, ClusterRoleBinding.
  • Scheduling: nodeSelector, full node affinity (In/NotIn/Exists/DoesNotExist/Gt/Lt), pod affinity / anti-affinity with topology keys.
  • Observability: Events emitted by the controllers, scheduler, and node agent.
  • Storage: SQLite (default, zero-setup) or PostgreSQL — same schema, picked by --db-url.

Most of kubectl get/apply/delete/describe/logs/exec/port-forward/cluster-info works against this server with stock kubectl.

Architecture

┌─────────────────────────────────────────────────────────────────────────┐
│                  CONTROL PLANE  (superkube server)                      │
│                                                                         │
│  ┌──────────────┐  ┌──────────────────┐  ┌──────────────┐              │
│  │  API server  │  │   Controllers    │  │  Scheduler   │              │
│  │   (axum)     │  │ Deployment / SS  │  │ + node-affty │              │
│  │              │  │   DS / Pod /     │  │ + pod-affty  │              │
│  │              │  │   Service /      │  │              │              │
│  │              │  │   Endpoints      │  │              │              │
│  └──────┬───────┘  └────────┬─────────┘  └──────┬───────┘              │
│         │                   │                   │                       │
│         └───────────────────┼───────────────────┘                       │
│                             │                                           │
│                  ┌──────────▼──────────┐                                │
│                  │  SQLite or Postgres │                                │
│                  └─────────────────────┘                                │
│                                                                         │
│  ┌────────────────────  embedded node agent  ────────────────────────┐  │
│  │ registers the server's host as a control-plane node automatically │  │
│  └───────────────────────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────────────────┘
                                   │
                                   │  HTTP / WebSocket
                                   ▼
┌─────────────────────────────────────────────────────────────────────────┐
│                  NODE AGENT  (superkube node, optional)                 │
│                                                                         │
│  Heartbeat / pod sync / NodePort proxy / log + exec relay               │
│                                                                         │
│  Runtime selector:                                                      │
│    macOS → Docker (bollard → /var/run/docker.sock)                      │
│    Linux → embedded (oci-distribution + libcontainer)                   │
│    any   → mock (in-memory, for tests)                                  │
└─────────────────────────────────────────────────────────────────────────┘

Multi-master with PostgreSQL

Point N copies of superkube server at the same Postgres URL and they all become active masters. Every API server is fully usable; coordination of the write paths (controllers + scheduler) happens through short-lived leases in a leases table, so any single object is reconciled by exactly one master at a time. Adding a master is just another process with the same --db-url.

   ┌─────────────────────────────────────────────────────────────────────┐
   │           kubectl / clients              workers (superkube node)   │
   └──────────────┬─────────────────────────────────────┬────────────────┘
                  │                                     │  HTTP/WebSocket
                  ▼                                     ▼
   ┌─────────────────────────────────────────────────────────────────────┐
   │                       Load balancer  (:6443)                        │
   │                       round-robin / least-conn                      │
   └────────────┬──────────────────┬───────────────────┬─────────────────┘
                ▼                  ▼                   ▼
   ┌────────────────────┐ ┌────────────────────┐ ┌────────────────────┐
   │   superkube #1     │ │   superkube #2     │ │   superkube #3     │
   │   (active master)  │ │   (active master)  │ │   (active master)  │
   │                    │ │                    │ │                    │
   │  API server  ✓     │ │  API server  ✓     │ │  API server  ✓     │
   │  Controllers (lease)│ │  Controllers (lease)│ │  Controllers (lease)│
   │  Scheduler   (lease)│ │  Scheduler   (lease)│ │  Scheduler   (lease)│
   │  embedded agent    │ │  embedded agent    │ │  embedded agent    │
   └──────────┬─────────┘ └──────────┬─────────┘ └──────────┬─────────┘
              │                      │                      │
              │            --db-url=postgres://…            │
              └──────────────────────┼──────────────────────┘
                                     ▼
              ┌──────────────────────────────────────────────┐
              │                 PostgreSQL                   │
              │      primary  ──streaming repl──►  replica   │
              │                                              │
              │  Tables:  pods / deployments / services /…   │
              │           + leases  (controller/deployment,  │
              │             controller/scheduler, …)         │
              │                                              │
              │  Single source of truth. Each named lease    │
              │  has one current `holder` — that holder is   │
              │  the only master running that controller     │
              │  for the next ~30s.                          │
              └──────────────────────────────────────────────┘

How dispatch works:

  • API serves are symmetric. Any master answers reads and writes; the LB just round-robins.
  • Per-controller leases (Postgres only). Each tick, every master tries to grab the lease for controller/deployment, controller/statefulset, controller/daemonset, controller/pod, controller/service, and scheduler. Whoever wins runs that loop; the others skip until the lease frees up. Different leases land on different masters, so the work spreads.
  • Acquisition is one UPSERT. INSERT … ON CONFLICT (name) DO UPDATE … WHERE leases.holder = me OR leases.expires_at < now() — a row is taken over only if it's stale. No advisory locks, no long-held connections.
  • Failure recovery is the TTL. If the lease holder crashes, the lease expires after 30s and another master picks it up on its next tick.
  • SQLite mode skips this entirely. SQLite is single-process by design, so the lease layer short-circuits to "always own it" — the leases table is created but never written.
  • Work execution still flows through pod.spec.nodeName. The scheduler (whichever master holds its lease) writes nodeName; the embedded agent on that host's master picks the pod up and runs it. Masters are also nodes, so this is the same path as a single-master cluster.
  • HA is the database's job. Use a managed Postgres or a primary/replica with automatic failover (Patroni, RDS Multi-AZ, Cloud SQL HA). Superkube just needs one connection string.
  • Workers don't pin to a master. The node agent talks HTTP/WebSocket to the LB; any master answers pod sync, log relay, and exec.

Quick start

Prerequisites

  • Rust 1.88+ (transitive deps: home ≥0.5.12 needs 1.88, base64ct ≥1.8 needs edition2024/1.85)
  • One of:
    • macOS: Docker Desktop running (the embedded node agent talks to its socket)
    • Linux: a kernel with cgroups v2 + namespaces (any modern distro); libseccomp headers if you build with seccomp enabled
  • kubectl ≥1.27 if you want to drive it

Build and run

cargo build --release

# Single command — server + embedded node agent + control-plane registration.
./target/release/superkube server

That's it. The first run creates ./superkube.db (SQLite), starts the API on :6443, and the embedded agent registers the host:

$ kubectl --server=http://localhost:6443 get nodes
NAME                    STATUS   ROLES           AGE   VERSION
Debarshis-MacBook-Pro   Ready    control-plane   3s    superkube/0.1.0

Running on macOS

macOS is the primary development target. The embedded node agent talks to a Docker-API-compatible Unix socket at /var/run/docker.sock — Docker Desktop, Colima, and Podman all expose one (Colima and Podman either symlink it for you or do so via a small helper). Pick whichever you prefer; the rest of the project doesn't care.

Why the socket path matters: bollard (the Rust Docker client) is hardcoded to /var/run/docker.sock here and does not read DOCKER_HOST. Whatever runtime you choose has to be reachable at that path.

Shared prerequisites

# Rust toolchain (skip if `rustc --version` already prints 1.88+)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"

# kubectl
brew install kubectl

Then pick one of the three container runtimes below.

Option A — Docker Desktop

  1. Install and start it:

    brew install --cask docker
    open -a Docker
    # wait for the whale icon → "Docker Desktop is running"
    docker ps   # sanity check, should succeed without sudo
  2. Build and start superkube:

    cargo build --release
    ./target/release/superkube server
  3. From a second terminal:

    kubectl --server=http://localhost:6443 get nodes

Apple Silicon note: Docker Desktop emulates linux/amd64 images via QEMU. If a pod stays in ContainerCreating, prefer multi-arch images or pin linux/arm64 variants (e.g. nginx:latest is multi-arch and works out of the box).

Option B — Colima (open-source, no Docker Desktop)

Colima runs dockerd inside a small Lima VM and exposes the socket back to the host — fully open source, no Docker Desktop license, fewer background services.

  1. Install Colima and the Docker CLI:

    brew install colima docker
  2. Start a VM (defaults are fine; tune later if needed):

    colima start
    # or, to size it explicitly:
    #   colima start --cpu 4 --memory 6 --disk 30

    On Apple Silicon, add --arch aarch64 (default) for native arm64 or --arch x86_64 if you specifically need amd64 images without emulation.

  3. Confirm the socket is wired up:

    ls -l /var/run/docker.sock   # should symlink into ~/.colima/default/
    docker ps                    # sanity check

    If /var/run/docker.sock is missing (older Colima, or a leftover from Docker Desktop), symlink it once:

    sudo ln -sf "$HOME/.colima/default/docker.sock" /var/run/docker.sock
  4. Build and run superkube as in Option A. Stop the VM with colima stop when you're done.

Option C — Podman

Podman on macOS runs its container engine inside a podman machine VM and ships a small helper (podman-mac-helper) that points /var/run/docker.sock at it.

  1. Install Podman:

    brew install podman
  2. Create and start the VM:

    podman machine init
    podman machine start

    Default sizing is conservative — if pods get OOM-killed, recreate with more headroom:

    podman machine stop
    podman machine rm
    podman machine init --cpus 4 --memory 6144 --disk-size 30
    podman machine start
  3. Wire the Docker-compat socket to /var/run/docker.sock:

    sudo /opt/homebrew/bin/podman-mac-helper install   # Apple Silicon
    # or  sudo /usr/local/bin/podman-mac-helper install   on Intel
    podman machine stop && podman machine start        # required after helper install
    docker ps                                          # should work via Podman now

    Without the helper, Podman only exposes its socket inside the VM. You can still bridge it manually by reading podman machine inspect | jq -r '.[0].ConnectionInfo.PodmanSocket.Path' and symlinking that to /var/run/docker.sock, but the helper is the supported path.

  4. Build and run superkube as in Option A.

Podman caveats worth knowing:

  • The Docker API surface bollard uses (pull, create, start, inspect, logs, exec, port publishing) all work, but Podman's exec stream has historically been the flakiest part of the compat layer — if kubectl exec hangs or drops, that's the first thing to suspect.
  • Rootless Podman publishes ports through slirp4netns / pasta, so NodePort works for curl from the host but throughput is lower than Docker Desktop's vmnet path.

Troubleshooting (any runtime)

  • error trying to connect: ... /var/run/docker.sock — the runtime isn't running, or its socket isn't at that path. ls -l /var/run/docker.sock and re-check the steps for whichever option you picked.
  • Port 6443 already in use — another tool (often a previous run, or a real Kubernetes context) is bound. lsof -iTCP:6443 -sTCP:LISTEN to find it, or pass --port 8443 to superkube server.
  • NodePort curl hangs — all three runtimes publish container ports onto the host, so reach them via localhost. If you're calling from another machine on the LAN, hit the Mac's LAN IP, not localhost.

kubectl

# (optional) wire up a kubeconfig once
cat > ~/.kube/superkube.yaml <<'EOF'
apiVersion: v1
kind: Config
clusters: [{name: superkube, cluster: {server: http://localhost:6443}}]
contexts: [{name: superkube, context: {cluster: superkube, user: superkube}}]
users:    [{name: superkube, user: {}}]
current-context: superkube
EOF
export KUBECONFIG=~/.kube/superkube.yaml

kubectl apply -f - <<'EOF'
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
spec:
  replicas: 3
  selector: {matchLabels: {app: nginx}}
  template:
    metadata: {labels: {app: nginx}}
    spec:
      containers:
        - name: nginx
          image: nginx:latest
          ports: [{containerPort: 80}]
          resources:
            requests: {cpu: 100m, memory: 128Mi}
            limits:   {cpu: 500m, memory: 256Mi}
EOF

kubectl apply -f - <<'EOF'
apiVersion: v1
kind: Service
metadata: {name: nginx}
spec:
  type: NodePort
  selector: {app: nginx}
  ports: [{port: 80, targetPort: 80, nodePort: 31080}]
EOF

kubectl get all                # pods, deployments, services, RS/RC stubs
kubectl logs -f <pod>          # streams from Docker
kubectl exec -it <pod> -- sh   # interactive shell inside the container
curl http://localhost:31080/   # NodePort proxy → real nginx

Cross-compiling for Linux from macOS

If you develop on a Mac but want a binary that runs on a Linux node, cross-compile with cross (recommended — it runs the build inside a Linux container, so glibc, OpenSSL, and libseccomp headers are sorted out for you):

# one-time setup
cargo install cross
rustup target add x86_64-unknown-linux-gnu        # Intel/AMD Linux
rustup target add aarch64-unknown-linux-gnu       # ARM Linux (Graviton, RPi 64-bit, etc.)

# build (Docker Desktop / Colima / Podman must be running — cross uses it)
cross build --release --target x86_64-unknown-linux-gnu
# binary lands at: ./target/x86_64-unknown-linux-gnu/release/superkube

For a fully static binary that runs on any Linux without glibc concerns, target musl. You'll need a musl cross-toolchain because the host macOS linker can't produce ELF binaries:

brew tap messense/macos-cross-toolchains
brew install x86_64-unknown-linux-musl
rustup target add x86_64-unknown-linux-musl

# .cargo/config.toml
# [target.x86_64-unknown-linux-musl]
# linker = "x86_64-linux-musl-gcc"

CC_x86_64_unknown_linux_musl=x86_64-linux-musl-gcc \
  cargo build --release --target x86_64-unknown-linux-musl

Notes:

  • The embedded runtime (libcontainer) only compiles on Linux, so cross-compilation is the only way to produce that variant from a Mac. The docker runtime cross-compiles cleanly either way.
  • seccomp requires libseccomp headers in the build environment. cross's default image already has them; for raw cargo build against musl, either disable the seccomp feature or install libseccomp-dev into the toolchain sysroot.
  • Apple Silicon → x86_64 Linux works via cross (it runs an amd64 container under QEMU emulation in Docker Desktop). It's slow but reliable; prefer aarch64-unknown-linux-gnu if your target Linux box is ARM.

Adding more nodes (multi-host)

# On any other host with Docker:
./target/release/superkube node --server http://<server-host>:6443
# (--name defaults to the host's hostname)

Or, having cross-compiled above, ship the produced binary to the Linux host:

scp target/x86_64-unknown-linux-gnu/release/superkube node1:/usr/local/bin/
ssh node1 'superkube node --server http://<server-host>:6443'

Deployment

The repo ships ready-to-use service files and one-shot installers under deploy/, plus a Makefile wrapping the common targets.

As a service

Host Files Install
Linux (systemd) deploy/systemd/superkube-server.service, superkube-node.service, superkube.env.example sudo make install-linux (server) or sudo make install-linux-node SERVER=http://master:6443
macOS (launchd) deploy/launchd/dev.superkube.server.plist sudo make install-macos

The installers (install-linux.sh, install-macos.sh) auto-detect a binary in target/release/ (or any target/<linux-triple>/release/ for cross-builds), create a dedicated superkube user, set up /var/lib/superkube, write /etc/superkube/superkube.env, drop the unit/plist into place, and start it. They're idempotent — re-run to upgrade. make install picks the right one for the host OS.

Inspect / control:

# Linux
sudo systemctl status  superkube-server
sudo journalctl -fu    superkube-server

# macOS
sudo launchctl print system/dev.superkube.server
tail -f /var/log/superkube/server.{log,err}

Uninstall with sudo make uninstall (binary, data, and env file are left in place — remove manually if you want a clean slate).

As a container

A multi-stage Dockerfile is included. Build with BuildKit (cache mounts speed up incremental builds):

make docker                                  # → superkube:dev
make docker-run                              # → :6443 on the host, SQLite on a named volume

Or directly:

DOCKER_BUILDKIT=1 docker build -t superkube .
docker run --rm -p 6443:6443 \
    -v superkube-data:/var/lib/superkube \
    superkube

The image runs as a non-root user, exposes 6443 (API) and 10250 (node agent), and defaults to SQLite at /var/lib/superkube/superkube.db. For Postgres, pass -e DATABASE_URL=postgres://…. Note: inside a Linux container --runtime=docker is not compiled in (bollard is gated to macOS in Cargo.toml) — the image is intended for the API/control-plane role, with node agents running on the host where they can reach a real container runtime.

CLI

superkube server

Flag Env Default Notes
--db-url DATABASE_URL sqlite://./superkube.db Postgres also supported: postgres://user:pass@host/db
--host 0.0.0.0 Bind address
--port 6443 API server port
--pod-cidr 10.244.0.0/16 First /24 used by the embedded agent for pod IPs
--service-cidr 10.96.0.0/12 First /24 used to auto-assign ClusterIPs

Server boots the API + an embedded node agent that registers the host as the control-plane node. No separate superkube node invocation is needed for a single-host cluster.

superkube node

Flag Default Notes
--server — required URL of the superkube control plane
--name host's short hostname Node name
--runtime auto auto / docker / embedded / mock
--containerd-socket /run/containerd/containerd.sock only used by the mock runtime placeholder

--runtime=auto picks Docker on macOS, the embedded libcontainer runtime on Linux, otherwise the mock.

Container runtimes

Backend Where What it talks to Status
docker macOS, Linux /var/run/docker.sock via bollard Production-ready: pull / create / start / inspect / logs (live stream) / exec / port publishing for NodePort.
embedded Linux only youki's libcontainer crate, in-process Skeleton: image pull (oci-distribution) → bundle build (our oci/bundle.rs) → libcontainer::ContainerBuilder.start(). TODO: networking (no veth/bridge yet), log capture, exec.
mock any nothing In-memory stub for tests / dev without a runtime.

The embedded path is the answer to "single static binary, no host daemon" on Linux: superkube node --runtime=embedded pulls images itself and hands the OCI bundle to libcontainer for namespaces / cgroups v2 / pivot_root.

Ports

Port Who What
6443 superkube server Kubernetes API (kubectl talks here)
10250 superkube node agent Logs / exec / port-forward HTTP+WS endpoint
30000–32767 superkube node proxy NodePort listeners — one TCP socket per type: NodePort Service, opened on 0.0.0.0:<nodePort>
pod's containerPort (e.g. 80) the container itself Inside the pod's netns, on the pod IP (10.244.0.X by default)

The CNI / bridge layer doesn't open any port — it's just netlink syscalls into the kernel to wire up superkube0, veth pairs, IPs, and routes. Nothing listens for connections there.

Resources

Group/Version Kinds Notes
v1 Pod, Service, Endpoints, Node, Namespace, Event, ServiceAccount, Secret, ConfigMap Pods/Services run real workloads; SA/Secret/CM are storage-only.
v1 ReplicationController Stub (empty list). Exists so kubectl get all doesn't 404.
apps/v1 Deployment, StatefulSet, DaemonSet Each has its own reconciliation loop; pods are owned directly.
apps/v1 ReplicaSet Stub (empty list). Deployments don't materialize ReplicaSets here.
rbac.authorization.k8s.io/v1 ClusterRole, ClusterRoleBinding Stored only — no enforcement.

Storage

One portable schema across both backends.

namespaces / nodes / pods / deployments / services / endpoints
events / serviceaccounts / secrets / configmaps
clusterroles / clusterrolebindings
statefulsets / daemonsets

JSON spec/labels/annotations stored as TEXT; UUIDs and timestamps as ISO strings. Migrations run on every server start.

Known caveats

  • kubectl apply on existing objects uses HTTP PATCH, which we don't implement yet. First-time apply (PUT/POST) works; re-applying a changed resource currently fails with MethodNotAllowed. Workarounds: kubectl replace -f file.yaml --force, or delete + apply.
  • Embedded runtime: skeleton only — image pull and libcontainer wiring are in place, but pod networking, log capture, and exec aren't yet hooked up. On Linux today, --runtime=docker is the productive choice.
  • No CNI: pod IPs are assigned from --pod-cidr (default 10.244.0.0/16) but pod-to-pod connectivity isn't wired. Service traffic works because the NodePort proxy connects to the host port that Docker publishes for each container.
  • No RBAC enforcement: ClusterRole/Binding objects round-trip through the API but are not consulted at request time. The API has no auth.
  • OpenAPI schemas aren't generated. We serve a benign empty /openapi/v2 (zero bytes, parses as an empty protobuf Document) and an empty /openapi/v3 JSON, so kubectl validation passes without --validate=false.

Status

Hobby project — built incrementally. The pieces above all work end-to-end on macOS through Docker Desktop; the Linux embedded path compiles but needs a Linux box to actually exercise.

License

MIT