Sign inSign up

durguto/clusdr

By durguto

•Updated 21 days ago

A runtime for the cluster. An SDK for the app.

Image
Networking
Developer tools
0

1.3K

durguto/clusdr repository overview

clusdr ⁠

A runtime for the cluster. An SDK for the app.

docs release image License


Linux daemon for cluster awareness. The container is the cluster member. Your application talks to it on the same host; it does not join Raft.

Not a database, queue, or Kubernetes. Wire API is v1alpha1. TLS is on by default.

Application → local SDK → this container → the rest of the cluster

⁠Supported tags

TagWhat it is
v0.2.1Current release
v0.2.0Previous
v0.1.1Go 1.27, durguto/clusdr
v0.1.0First release
latestSame image as the newest vX.Y.Z

Platforms: linux/amd64, linux/arm64. Distroless, non-root.

Dockerfile⁠

⁠Quick reference

⁠How to use this image

The image CMD is start. It does not run init. Identity lives on the volume. Init once, then start.

docker pull durguto/clusdr
docker volume create clusdr-data

docker run --rm \
  -v clusdr-data:/var/lib/clusdr \
  durguto/clusdr init

docker run --rm -d --name clusdr \
  -e CLUSDR_NODE_ADDR=127.0.0.1:7947 \
  -e CLUSDR_GRPC_ADDR=0.0.0.0:7947 \
  -p 7947:7947 \
  -v clusdr-data:/var/lib/clusdr \
  durguto/clusdr start --bootstrap

CLUSDR_NODE_ADDR is the address stored in membership. Do not set it to 0.0.0.0. Across machines, use a host IP every peer can dial, and map 7946 for Raft.

docker run --rm -d --name clusdr \
  -e CLUSDR_NODE_ADDR=203.0.113.10:7947 \
  -e CLUSDR_GRPC_ADDR=0.0.0.0:7947 \
  -e CLUSDR_RAFT_ADDR=203.0.113.10:7946 \
  -p 7946:7946 -p 7947:7947 \
  -v clusdr-data:/var/lib/clusdr \
  durguto/clusdr start --bootstrap

⁠Image contract

ENTRYPOINT/clusdr
CMDstart
Usernon-root (distroless)
Volume/var/lib/clusdr
Ports7947 Runtime gRPC · 7946 Raft
CLUSDR_DATA_DIR/var/lib/clusdr
CLUSDR_CONTROL_SOCKET/var/lib/clusdr/clusdr.sock

Do not share one volume between two processes.

⁠Compose

In-tree docker-compose.yml is one node and does not run init. A healthcheck that calls clusdr version only proves the binary runs.

services:
  clusdr:
    image: durguto/clusdr:v0.2.1
    restart: unless-stopped
    environment:
      CLUSDR_NODE_ADDR: "127.0.0.1:7947"
      CLUSDR_GRPC_ADDR: "0.0.0.0:7947"
      CLUSDR_DATA_DIR: "/var/lib/clusdr"
      CLUSDR_LOG_FORMAT: "json"
    ports:
      - "7947:7947"
    volumes:
      - clusdr-data:/var/lib/clusdr

volumes:
  clusdr-data:

Init the volume before the first start --bootstrap.

⁠From an app

This image is the daemon, not the SDK.

go get github.com/clusdr/clusdr/sdk
pip install clusdr
# Cargo.toml: clusdr = "0.2.1"
npm install clusdr
# Maven: io.clusdr:clusdr:0.2.1

The app still talks to the local Runtime on this host.

Tag summary

Content type

Image

Digest

sha256:b1c651b35…

Size

6.6 MB

Last updated

21 days ago

docker pull durguto/clusdr