Skip to main content

Server (server-zd)

View as Markdown

server-zd is the Dex Server. It stores every Flow's state and hands Steps and RPCs to Workers. Its only runtime dependency is object storage, such as Amazon S3 or an S3-compatible store.

How it works​

server-zd commits every write to object storage before it acknowledges the write. It keeps a local store as a cache. After a restart, a node rebuilds that cache from object storage.

One active process serves a cluster. It holds a lease in object storage, so a second process cannot write at the same time. You can run standby processes that take over when the active process stops.

How it fits with the other components​

  • Workers and Clients connect to the server's API port. Workers open outbound streams; the server never calls in.
  • Dex Web runs as a separate process and reads Flows through the same API.
  • dexcli calls the same API. dexcli dev also starts server-zd on your machine.
  • External Attribute Sync is a server feature. server-zd writes selected Attributes to PostgreSQL.

Run it​

For local development, run dexcli dev. It starts server-zd with embedded object storage, together with Dex Web.

In production, run dex-server-zd serve with one YAML configuration file. The release publishes binaries and a container image. On Kubernetes, run it as a StatefulSet.

dex-server-zd serve --config /etc/dex-server-zd/config.yaml

To run one production node on local disk without external object storage, run dex-server-zd local. It keeps an embedded object store in its data directory and has no standby.

Reference​

The Server reference covers configuration, Kubernetes, high availability, object storage, authentication, Worker dispatch, search, Attribute Store sync, metrics, and upgrades.