CockroachDB is a distributed SQL database that replicates data across nodes for high availability. If a node fails, the cluster elects new nodes and rebalances automatically, and an automated repair feature detects and corrects data inconsistencies. This guide deploys CockroachDB on Kubernetes via the CockroachDB Operator, and covers access through both the SQL client and the graphical console.

Prerequisites: a Kubernetes cluster with at least 3 nodes, 8GB RAM and 4 vCPUs each, and a workstation with kubectl configured against the cluster.

Install the CockroachDB Operator

The operator automates scaling and maintenance of CockroachDB nodes.

$ kubectl apply -f https://raw.githubusercontent.com/cockroachdb/cockroach-operator/v2.12.0/install/crds.yaml