You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Pro plan is cloud-only.** Self-hosted deployments require an Enterprise license. Existing Pro self-host licenses are grandfathered. Self-hosted Free instances can start a [14-day Enterprise trial](https://www.bytebase.com/contact-us/).
15
15
</Info>
16
16
17
+
<Note>
18
+
Running more than one self-hosted Bytebase replica requires HA to be enabled in the license. If multiple replicas are detected without HA enabled, Bytebase disables backend runners for safety. As a result, background operations such as rollout task execution, plan checks, schema sync, and other scheduled runners will stop progressing until you scale back to a single replica or enable HA in the license.
19
+
</Note>
20
+
17
21
## Configure Workspace License
18
22
19
23
Go to **Settings > Subscription**, paste your license and click **Upload License**.
Copy file name to clipboardExpand all lines: docs/get-started/self-host/deploy-with-kubernetes.mdx
+48-3Lines changed: 48 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,7 @@ title: Deploy with Kubernetes
6
6
## Deployment
7
7
8
8
<Note>
9
-
10
-
Make sure to set the replicas to **1**, otherwise, it may cause data race issues.
9
+
Single-replica deployment still works as before. For multi-replica deployment, see [High Availability](/get-started/self-host/high-availability/).
11
10
12
11
</Note>
13
12
@@ -20,7 +19,6 @@ metadata:
20
19
name: bytebase
21
20
namespace: default
22
21
spec:
23
-
# To prevent data races, only request one replica.
24
22
replicas: 1
25
23
selector:
26
24
matchLabels:
@@ -92,6 +90,10 @@ spec:
92
90
93
91
Bytebase provides an official Helm chart for simplified Kubernetes deployments. For comprehensive configuration options and advanced settings, visit the [Bytebase Helm Chart on Artifact Hub](https://artifacthub.io/packages/helm/bytebase/bytebase).
94
92
93
+
<Note>
94
+
The current official Helm chart deploys a single replica and does not yet expose HA-specific settings such as replica count and the `--ha` flag. If you want to run Bytebase in HA mode today, use a custom manifest based on this guide or customize the chart template before deploying.
95
+
</Note>
96
+
95
97
### Installation
96
98
97
99
Deploy Bytebase using Helm with your external PostgreSQL database:
@@ -110,3 +112,46 @@ To remove the Bytebase deployment:
Copy file name to clipboardExpand all lines: docs/get-started/self-host/external-postgres.mdx
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,10 @@ import TerminalDockerRunPgUrl from '/snippets/install/terminal-docker-run-pg-url
8
8
9
9
PostgreSQL 14 or above.
10
10
11
+
<Note>
12
+
External PostgreSQL is required for [High Availability](/get-started/self-host/high-availability/). HA mode is not supported with Bytebase's embedded PostgreSQL.
13
+
</Note>
14
+
11
15
### Database
12
16
13
17
Create a database named `bytebase` with UTF-8 encoding. UTF-8 encoding is required for proper system operation.
@@ -128,4 +132,3 @@ spec:
128
132
<Note>
129
133
When using file-based secrets, Kubernetes automatically updates the mounted file content when the Secret is updated (typically within a minute). Bytebase monitors the file for changes and automatically reloads the connection string, enabling seamless secret rotation without downtime.
Bytebase supports high availability (HA) for self-hosted deployments.
6
+
7
+
In HA mode, you run multiple Bytebase replicas behind the same external endpoint. The replicas coordinate through the shared metadata PostgreSQL database, so scheduled work such as rollout tasks, plan checks, schema sync, and cancellation handling remains safe across replicas.
8
+
9
+
## Requirements
10
+
11
+
- Use an external PostgreSQL database for Bytebase metadata
12
+
- Start every replica with the `--ha` flag
13
+
- Put all replicas behind the same load balancer / ingress / service
14
+
- Configure the same External URL for the deployment
15
+
- Use a license with HA enabled
16
+
17
+
<Warning>
18
+
HA mode does not work with Bytebase's embedded PostgreSQL. If `PG_URL` is not set, Bytebase will refuse to start in HA mode.
19
+
</Warning>
20
+
21
+
## How It Works
22
+
23
+
- Each replica sends heartbeats to the metadata PostgreSQL database
24
+
- Distributed coordination uses PostgreSQL advisory locks and row-level claiming
25
+
- Long-running tasks are owned by a replica; stale work is detected if that replica stops heartbeating
26
+
- Cancel signals are propagated across replicas through PostgreSQL `NOTIFY/LISTEN`
27
+
28
+
## Kubernetes Example
29
+
30
+
The example below shows the minimum HA-specific changes compared with a single-replica deployment:
0 commit comments