cockroachdb/cockroach
Deployment
CockroachDB deployments come in three shapes: dedicated single-tenant clusters, multi-tenant host+SQL-pod deployments, and CockroachDB Serverless. The repo includes binaries and configurations for all three.
Producing release artifacts
pkg/cmd/release/ and pkg/cmd/publish-artifacts/ drive the release process:
- Cut a tag (e.g.
v25.4.5). - CI builds for darwin-amd64, darwin-arm64, linux-amd64, linux-arm64, windows-amd64, and FIPS variants.
- Artifacts are published to S3 and Docker Hub.
- The
cockroachbinary embeds version and build info frompkg/build/.
Packaging
The repo emits:
- A standalone
cockroachbinary. - A
cockroach-sqlbinary. - Container images via
build/Dockerfileand the release tooling. - Kubernetes manifests under
cloud/kubernetes/(some upstream and some demonstration). - Datadog dashboard JSON in
pkg/cli/cockroachdb_datadog_dashboard.json.
CI for cluster lifecycle
CI runs:
- Unit tests — every package on every PR.
- Logictest — across multiple cluster configs (local, 5-node, multiregion, mixed-version).
- Acceptance — small docker-compose-driven smoke tests.
- Roachtest — long-running real-cluster tests on AWS and GCE.
- Mixed-version logictest — recent prior versions joined to the current binary.
- Microbench — across recent commits, alerting on regressions.
The release-cut workflow is in .github/workflows/release-cut.yml.
Auto-upgrade
pkg/server/auto_upgrade.go runs an in-cluster job that finalizes the cluster version once every node reports it can support the next version. Operators can opt out by setting cluster.preserve_downgrade_option.
Decommission and drain
- Drain (
pkg/server/drain.go) — graceful shutdown with lease transfer. - Decommission (
pkg/server/decommission.go) — permanent removal; replicas move off, range leases drain.
Multi-tenant orchestration
For SQL pods, the host cluster boots a system-tenant Server. SQL pods run as separate processes started with cockroach mt start-sql. The host's controller (pkg/server/server_controller*.go) orchestrates which tenant runs where.
CockroachDB Serverless additionally uses pkg/ccl/sqlproxyccl/ (a TCP proxy) to terminate pgwire and dispatch by tenant.
Related pages
- systems/server — node lifecycle.
- systems/cluster-version-and-upgrade — rolling-upgrade story.
- features/multi-tenant — orchestration.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.