Endpoints
Kelpie deploys to the Swarm it runs on, called local, and to any other Docker host or Swarm
cluster with an edge agent that connects back to it. The agent opens the connection, so the host
needs no open ports and can sit behind NAT.
Adding an endpoint
Section titled “Adding an endpoint”Under Endpoints, add one. Kelpie shows a key and the command that starts the agent:
docker run -d --name kelpie-agent --restart always \ -v /var/run/docker.sock:/var/run/docker.sock -v /:/host:ro \ -e KELPIE_EDGE_KEY=... ghcr.io/denniedev/kelpie:0.2.10 agentThe command names the image of the version the server runs, since agents have to match it.
On a Swarm cluster, run it as a service on a manager instead, or deploy it with agents on every node as described under Swarm clusters.
The key holds the server URL, the endpoint’s ID, and a secret. Kelpie only stores a hash of the secret. Generating a new key disconnects the agent that uses the old one.
Use an https:// server URL; the agent verifies the certificate. Set KELPIE_PUBLIC_URL when
Kelpie is behind a proxy, so the key carries the external address. The agent reconnects with
backoff when the connection drops.
Swarm clusters
Section titled “Swarm clusters”A single edge agent sees the Docker socket and filesystem of the manager it runs on. To check bind mounts on the other nodes too, run Kelpie’s node agent on every node next to it, the same way Kelpie’s own stack does. The edge agent finds them through Swarm DNS and relays the server’s calls to them, so they still need no open ports.
Create two secrets on a manager, the key and a token the agents share:
printf '%s' 'KEY FROM THE ENDPOINT PAGE' | docker secret create kelpie_edge_key -openssl rand -hex 32 | docker secret create kelpie_agent_token -Then deploy this stack, with the server’s version in the image tags:
services: edge: image: ghcr.io/denniedev/kelpie:0.2.10 command: agent environment: KELPIE_AGENT_DNS: tasks.agent secrets: [kelpie_edge_key, kelpie_agent_token] deploy: placement: constraints: [node.role == manager] volumes: - /var/run/docker.sock:/var/run/docker.sock - /:/host:ro networks: [agents]
agent: image: ghcr.io/denniedev/kelpie:0.2.10 command: agent secrets: [kelpie_agent_token] deploy: mode: global volumes: - /var/run/docker.sock:/var/run/docker.sock - /:/host:ro networks: [agents]
networks: agents: driver: overlay driver_opts: encrypted: "true"
secrets: kelpie_edge_key: external: true kelpie_agent_token: external: truedocker stack deploy -c kelpie-agent.yml kelpie-agentRemove an edge agent you started with docker service create first: a key serves one agent at a
time, and a second one takes the connection over from the first.
Using it
Section titled “Using it”Point a stack at the endpoint in its kelpie.yaml:
endpoint: edge-01On a host that isn’t a Swarm manager the stack is a Compose project; on a Swarm manager it is a
Swarm stack, unless type says otherwise.
Deploys, validation, drift checks, and restarts run against the endpoint exactly as they do
locally. On a Swarm endpoint, the Nodes, Services, Networks, Secrets, and Configs pages have an
endpoint picker, and task logs and terminals work as they do for local; logs and terminals on
nodes other than the edge agent’s need the node agents. An unknown endpoint
name shows as a configuration error on the stack. Moving a stack to another endpoint doesn’t
remove it from the old one.
A Compose project on local runs on the manager the Kelpie server runs on. With more than one
manager the server can move to another, and the next deploy starts the project there while the
old containers keep running. On such a cluster, give Compose projects a host of their own through
an edge agent.
Endpoints that stacks still use can’t be deleted. Deploys to a disconnected endpoint fail at the
resolve stage, and Kelpie sends an endpoint.disconnected notification.
Limits
Section titled “Limits”- On a remote Swarm without agents on the other nodes, pre-flight warns that it couldn’t check bind mounts on those nodes.
- Keep edge agents on the same version as the server. On upgrade, start them again with the new image tag.