werf/lockgate

Lockgate is a cross-platform distributed locking library for Go. Supports distributed locks backed by Kubernetes or HTTP lock server. Supports conventional...

Hosted by Cloud Native Computing Foundation · part of Linux Foundation

View on GitHub ↗Jump to charts ↓

werf/lockgate has 250+ stars and 10+ forks on GitHub, is written in Go, and was last pushed on Jul 4, 2026. Data as of . Signed-in members get hourly updates — create a free account.

Summary Information

Updated 14 minutes ago
Added to GitGenius on October 15th, 2026
Created on December 13th, 2019
Open Issues & Pull Requests: 5 (+0)
GitHub issues: Enabled
Number of forks: 16
Total Stargazers: 268 (+0)
Total Subscribers: 10 (+0)

Repository Insights (GitGenius)

Most active contributors

Sign in to see contributor activity.
Sign in

Related repositories by overlapping contributors

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 1
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,458 days
Stale 30+ days: 1
Stale 90+ days: 1

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

Sign in to see which issues are moving.
Sign in

Detailed Description

Lockgate is a distributed locking library for Go that supports file-based locks on a single host, Kubernetes-backed distributed locks, and HTTP-based locks across multiple hosts.

The library addresses the need to synchronize access to shared resources across multiple processes running on single or multiple hosts. It provides a classical locking interface with two lock types (shared and exclusive) and two modes (blocking and non-blocking). For Kubernetes-based locking, the tool stores locks in annotations of an arbitrary Kubernetes resource and uses native Kubernetes optimistic locking to handle concurrent access. The HTTP locker approach allows clients to connect to a lockgate lock server, which can run as a standalone process or multiple Kubernetes-backed instances, with support for in-memory or Kubernetes key-value storage. Clients waiting on locks can be placed in a FIFO queue to ensure fairness, with an "Acquirer Id" mechanism to serialize access for long-held locks.

Developers should choose this library when they need to coordinate multiple processes across hosts and have an existing Kubernetes cluster or can deploy an HTTP lock server. The file locker suits single-host scenarios where multiple processes share a filesystem. The Kubernetes locker is appropriate for teams already running Kubernetes and wanting to avoid additional infrastructure. The HTTP locker provides flexibility for deployments that need a dedicated locking service, with the option to run it standalone or backed by Kubernetes. The library is actively used in the werf CI/CD tool for synchronizing build and deploy processes.

The project maintains active development with regular updates to its core locking implementations. The codebase shows consistent refinement of the Kubernetes locker's optimistic locking behavior and HTTP server functionality. Documentation is comprehensive, covering installation, usage patterns for each locker type, and practical examples. The project welcomes community contributions and maintains a feedback channel for users.