Podmaker
All pages
Use

Clusters (Swarm and Kubernetes)

Grow from single servers to Docker Swarm or Kubernetes (k3s or an existing cluster) with rolling updates.

Clusters

Single servers with Docker Compose are the simplest runtime. When you need several replicas, rolling updates or nodes that can fail, run environments on a cluster.

Runtime Rolling updates Migrations (hooks) Setup
Compose (one server) no (recreate) yes none
Docker Swarm yes not yet Podmaker creates it
Kubernetes (k3s) yes not yet Podmaker bootstraps k3s (approval required)
Kubernetes (existing) yes not yet you provide API URL, CA and token

Docker Swarm

podmaker cluster create swarm-1 --manager app-01            # --type swarm is the default
podmaker cluster init swarm-1
podmaker cluster node-add swarm-1 app-02 --role worker
podmaker cluster node-add swarm-1 app-03 --role worker
podmaker cluster health swarm-1

Servers created with podmaker provider provision ... --cluster swarm-1 join automatically after they enroll.

Run an environment on it:

podmaker project env-create shop production --kind production --cluster swarm-1

The environment config may set "replicas": 3 and "strategy": "rolling".

Maintenance:

podmaker cluster node-drain swarm-1 app-02      # move tasks away
podmaker cluster node-activate swarm-1 app-02
podmaker cluster node-remove swarm-1 app-02
podmaker cluster scale swarm-1 <workload> 5
podmaker cluster capacity swarm-1
podmaker cluster drift-policy swarm-1 correct   # or report: what to do when the cluster differs from Podmaker's state

Kubernetes

Bootstrap a single-node k3s server. Installing software on the node needs an approval:

podmaker cluster create k3s-1 --type kubernetes --mode k3s --manager app-04
podmaker cluster approve k3s-1

Connect an existing cluster. A connector server runs the agent and talks to the API server:

podmaker cluster create prod-k8s --type kubernetes --mode external --manager connector-01 \
  --api-server https://k8s.example.com:6443 --ca-file ca.pem < token.txt

Environments on Kubernetes use "kubernetes": {"manifests": "..."} in their config. Podmaker applies the manifests with the image digest, watches the rollout and rolls back on failure.

Limits today:

  • k3s is single-server. Joining more k3s nodes is not implemented.
  • Lifecycle hooks such as migrations are refused on Swarm and Kubernetes. Run migrations as a job of your own.