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
docs: improve Kubernetes deployment section in external PostgreSQL guide
- Rename "Running with Kubernetes" to "Kubernetes Deployment" for clarity
- Reorganize secret configuration with clearer subheadings
- Add comprehensive example for mounting secrets as files
- Document automatic secret rotation behavior with file mounts
- Clarify that Bytebase monitors file changes for seamless updates
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Instead of specifying PostgreSQL connection string directly in Helm or Kubernetes yaml file, you can use Kubernetes secrets resources:
89
+
For enhanced security, store your PostgreSQL connection string in a Kubernetes Secret:
90
90
91
-
#### Kubernetes
91
+
#### Using Secret as Environment Variable
92
92
93
-
Use the following yaml section to replace the`spec.templates.spec.containers.env` section:
93
+
Add the following environment variable configuration to your deployment's`spec.templates.spec.containers.env` section:
94
94
95
95
```yaml
96
96
env:
@@ -101,3 +101,31 @@ env:
101
101
key: secret_key
102
102
```
103
103
104
+
#### Using Secret as File Mount
105
+
106
+
Mount the secret as a file and point `PG_URL` to the file path. This approach supports automatic secret rotation - when the Kubernetes Secret is updated, the mounted file content is automatically refreshed, and Bytebase will pick up the new connection string without requiring a restart:
107
+
108
+
```yaml
109
+
spec:
110
+
containers:
111
+
- name: bytebase
112
+
env:
113
+
- name: PG_URL
114
+
value: "/var/secrets/pg-connection/url"
115
+
volumeMounts:
116
+
- name: pg-secret
117
+
mountPath: "/var/secrets/pg-connection"
118
+
readOnly: true
119
+
volumes:
120
+
- name: pg-secret
121
+
secret:
122
+
secretName: bytebase-pg-secret
123
+
items:
124
+
- key: connection-string
125
+
path: url
126
+
```
127
+
128
+
<Note>
129
+
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.
0 commit comments