Skip to content

Commit 36a0d95

Browse files
d-bytebaseclaude
andauthored
docs: reorganize external access configuration guide (#775)
Improve the external access documentation structure and clarity: - Add clear sections for Docker and Kubernetes deployments - Include comprehensive Nginx and Caddy examples for Docker - Add Kubernetes Gateway API example alongside Ingress - Document WebSocket requirements and troubleshooting tips - Remove redundant configuration details The guide now clearly states that Bytebase doesn't provide native HTTPS and guides users to appropriate reverse proxy solutions based on their deployment method. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <[email protected]>
1 parent 4f03231 commit 36a0d95

File tree

1 file changed

+137
-26
lines changed

1 file changed

+137
-26
lines changed

mintlify/get-started/external-access.mdx

Lines changed: 137 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@ title: External Access Configuration
33
description: Configure external access, WebSocket, and ingress for your Bytebase deployment
44
---
55

6-
This guide covers how to configure external access for your Bytebase deployment, including WebSocket support for SQL Editor and Kubernetes ingress configuration.
6+
This guide covers how to configure external access for your Bytebase deployment across different deployment methods.
77

8-
## Enable WebSocket for SQL Editor
8+
<Note>
9+
Bytebase service itself does not provide native HTTPS support. We recommend using a reverse proxy (Nginx, Caddy) on the same VM for Docker deployments, or ingress/gateway for Kubernetes deployments.
10+
</Note>
11+
12+
## Docker Deployment with Reverse Proxy
913

10-
SQL Editor autocomplete requires WebSocket. If you access Bytebase via a gateway, you need to enable WebSocket there. Here is a sample NGINX configuration (including the optional HTTPS mentioned below):
14+
When deploying Bytebase with Docker on a VM, use a reverse proxy for external access and HTTPS termination.
15+
16+
### Nginx Configuration
17+
18+
For Docker deployments using Nginx as a reverse proxy:
1119

1220
```nginx
1321
@@ -47,50 +55,153 @@ http {
4755
}
4856
```
4957

50-
## Enable HTTPS
58+
### Caddy Configuration
59+
60+
For Docker deployments using Caddy (automatic HTTPS with Let's Encrypt):
61+
62+
```caddy
63+
bytebase.example.com {
64+
# Automatic HTTPS with Let's Encrypt
65+
66+
# Reverse proxy to Bytebase
67+
reverse_proxy localhost:8080 {
68+
# Timeouts for long-running operations
69+
transport http {
70+
read_timeout 3600s
71+
write_timeout 3600s
72+
}
73+
}
74+
}
75+
```
76+
77+
To use this Caddy configuration:
78+
1. Install Caddy on your VM
79+
2. Save the configuration to `/etc/caddy/Caddyfile`
80+
3. Run: `caddy reload`
5181

52-
Bytebase does not support enabling HTTPS in server configuration. We suggest use [NGINX](https://nginx.org/) or [Caddy](https://caddyserver.com/) as a reverse proxy in front of Bytebase to enable HTTPS.
82+
## Kubernetes Deployment
5383

54-
## Kubernetes Ingress Configuration
84+
For Kubernetes deployments, use ingress controllers or gateways to configure external access with HTTPS support.
5585

56-
### Deploy with Ingress
86+
### Nginx Ingress Controller
5787

58-
We use [Ingress-Nginx Controller](https://kubernetes.github.io/ingress-nginx/deploy/) as ingress controller. You need to config `Ingress-Nginx Controller` according to your environment.
88+
Deploy Bytebase with [Nginx Ingress Controller](https://kubernetes.github.io/ingress-nginx/deploy/):
5989

6090
```yaml
6191
apiVersion: networking.k8s.io/v1
6292
kind: Ingress
6393
metadata:
94+
name: bytebase-ingress
95+
namespace: default
6496
annotations:
97+
# Enable HTTPS redirect
6598
nginx.ingress.kubernetes.io/ssl-redirect: 'true'
66-
# https://kubernetes.github.io/ingress-nginx/user-guide/miscellaneous/#websockets
99+
100+
# WebSocket support for SQL Editor
67101
nginx.ingress.kubernetes.io/proxy-read-timeout: '3600'
68102
nginx.ingress.kubernetes.io/proxy-send-timeout: '3600'
69-
name: bytebase-ingress
70-
namespace: default
71103
spec:
72104
ingressClassName: nginx
105+
tls:
106+
- hosts:
107+
- bytebase.example.com
108+
secretName: bytebase-tls-secret
73109
rules:
74-
- host: example.com
110+
- host: bytebase.example.com
75111
http:
76112
paths:
77-
- backend:
113+
- path: /
114+
pathType: Prefix
115+
backend:
78116
service:
79-
name: bytebase-entrypoint
117+
name: bytebase-service
80118
port:
81-
number: 80
82-
path: /
83-
pathType: ImplementationSpecific
84-
tls:
85-
- hosts:
86-
- example.com
87-
secretName: tls-secret
119+
number: 8080
88120
```
89121
90-
<Note>
91-
If you use ingress, make sure to use https to access bytebase.
92-
</Note>
122+
### Kubernetes Gateway API
123+
124+
For modern Kubernetes deployments using Gateway API:
125+
126+
```yaml
127+
apiVersion: gateway.networking.k8s.io/v1
128+
kind: HTTPRoute
129+
metadata:
130+
name: bytebase-route
131+
namespace: default
132+
spec:
133+
parentRefs:
134+
- name: gateway
135+
namespace: default
136+
hostnames:
137+
- bytebase.example.com
138+
rules:
139+
- matches:
140+
- path:
141+
type: PathPrefix
142+
value: /
143+
backendRefs:
144+
- name: bytebase-service
145+
port: 8080
146+
---
147+
apiVersion: gateway.networking.k8s.io/v1
148+
kind: Gateway
149+
metadata:
150+
name: gateway
151+
namespace: default
152+
spec:
153+
gatewayClassName: nginx
154+
listeners:
155+
- name: https
156+
protocol: HTTPS
157+
port: 443
158+
tls:
159+
mode: Terminate
160+
certificateRefs:
161+
- name: bytebase-tls-secret
162+
- name: http
163+
protocol: HTTP
164+
port: 80
165+
# Redirect HTTP to HTTPS
166+
allowedRoutes:
167+
namespaces:
168+
from: Same
169+
```
170+
171+
### Service Configuration
172+
173+
Ensure your Bytebase service is configured correctly:
174+
175+
```yaml
176+
apiVersion: v1
177+
kind: Service
178+
metadata:
179+
name: bytebase-service
180+
namespace: default
181+
spec:
182+
selector:
183+
app: bytebase
184+
ports:
185+
- protocol: TCP
186+
port: 8080
187+
targetPort: 8080
188+
type: ClusterIP
189+
```
190+
191+
## Additional Configuration
192+
193+
### Configure External URL
194+
195+
For production usage, configure the External URL to match your domain. See [Configure External URL](/get-started/install/external-url) for details.
196+
197+
### WebSocket Support
198+
199+
SQL Editor autocomplete requires WebSocket support. All configurations above include the necessary WebSocket settings. Key endpoints that require WebSocket:
200+
- `/v1:adminExecute` - For SQL execution
201+
- `/lsp` - For Language Server Protocol (autocomplete)
93202

94-
## Configure External URL
203+
### Troubleshooting
95204

96-
For production usage, you should configure a proper External URL. Check [Configure External URL](/get-started/install/external-url) for details.
205+
- **WebSocket issues**: Verify proxy/ingress WebSocket configuration
206+
- **502 errors**: Check Bytebase service status
207+
- **Timeout errors**: Increase proxy timeout settings (see examples above)

0 commit comments

Comments
 (0)