Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
0bc53c3
add PostgreSQL node migration and CloudBeaver solutions (MIDDLEWARE-3…
SuJinpei Jun 18, 2026
73e1b5d
docs: drop hand-written zh mirrors (pipeline auto-generates them)
SuJinpei Jun 18, 2026
d80a95e
docs: address CodeRabbit review on PG solutions
SuJinpei Jun 18, 2026
3164b7f
docs: add PostgreSQL cross-cluster instance migration guide (KB260720…
SuJinpei Jul 20, 2026
f06cb0e
docs: add full source-dismantle + XCR teardown steps to migration guide
SuJinpei Jul 20, 2026
054eafd
docs: correct teardown per live validation (PVC retention, lingering …
SuJinpei Jul 20, 2026
d4206cb
docs: add workstation-relayed logical migration for isolated clusters
SuJinpei Jul 21, 2026
ad657b6
docs: split network-isolated migration into standalone solution KB260…
SuJinpei Jul 21, 2026
e89eec2
docs: address review findings on KB260721001
SuJinpei Jul 21, 2026
4e10e28
docs: make per-database scope explicit in KB260721001
SuJinpei Jul 22, 2026
8e2cb49
docs: add scripted whole-instance migration to KB260721001
SuJinpei Jul 22, 2026
dc53cda
docs: restructure KB260721001 script-first
SuJinpei Jul 22, 2026
9bf2b25
docs: preserve application passwords across the migration (KB260721001)
SuJinpei Jul 22, 2026
2407ef0
docs: drop the manual-transfer reference section from KB260721001
SuJinpei Jul 22, 2026
dc60b42
docs: fix codex round-2 findings on KB260721001
SuJinpei Jul 22, 2026
abdd3e6
docs: unify large-database handling into the script (DUMP_DIR file mode)
SuJinpei Jul 22, 2026
a12836f
docs: gate dump reuse behind REUSE_DUMPS (codex round-3)
SuJinpei Jul 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
---
kind:
- How To
products:
- Alauda Application Services
ProductsVersion:
- 4.0,4.1,4.2,4.3
id: KB260515008
---

# How to Deploy CloudBeaver for PostgreSQL Management

## Issue

You need a web-based SQL client for browsing and querying PostgreSQL instances managed by Alauda Application Services, without installing a desktop tool on every operator's workstation. CloudBeaver is the open-source web edition of DBeaver and runs as a single-pod Deployment on Kubernetes. This how-to deploys CloudBeaver and connects it to a PostgreSQL cluster managed by the PostgreSQL Operator.

## Environment

- Any Kubernetes cluster reachable to operators (NodePort exposure is used below; Ingress / Route works equally well)
- A `StorageClass` capable of provisioning ReadWriteOnce PVCs — used to persist CloudBeaver workspace state across pod restarts
- Network reachability from the CloudBeaver pod to the target PostgreSQL Service (`<cluster>` on port 5432)

## Resolution

### 1. Prepare the manifest

Save the following to `cloudbeaver.yaml`. Adjust `storageClassName`, image registry, and resource requests to match your environment:

```yaml
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cloudbeaver
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: sc-topolvm # replace with any RWO StorageClass available in the cluster
volumeMode: Filesystem
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: cloudbeaver
spec:
replicas: 1
selector:
matchLabels:
app: cloudbeaver
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
template:
metadata:
labels:
app: cloudbeaver
spec:
containers:
- name: cloudbeaver
image: docker-mirrors.alauda.cn/dbeaver/cloudbeaver:latest
imagePullPolicy: Always
ports:
- name: web
containerPort: 8978
protocol: TCP
resources:
limits:
cpu: "1"
memory: 1Gi
requests:
cpu: 100m
memory: 256Mi
volumeMounts:
- name: cloudbeaver-data
mountPath: /opt/cloudbeaver/workspace
volumes:
- name: cloudbeaver-data
persistentVolumeClaim:
claimName: cloudbeaver
---
apiVersion: v1
kind: Service
metadata:
name: cloudbeaver
spec:
type: NodePort
selector:
app: cloudbeaver
ports:
- name: web
port: 8978
targetPort: 8978
protocol: TCP
```

> CloudBeaver stores its administrator password, saved connections, and query history under `/opt/cloudbeaver/workspace`. Without a persistent volume, everything is lost on every pod restart. Confirm the chosen `storageClassName` exists in the target cluster before applying.

> **Air-gapped / IPv6-only clusters:** the public `docker-mirrors.alauda.cn/dbeaver/cloudbeaver:latest` image may be unreachable from the cluster. Mirror it into the cluster's own registry first and reference that path in the Deployment, for example `skopeo copy docker://docker-mirrors.alauda.cn/dbeaver/cloudbeaver:latest docker://<cluster-registry>/dbeaver/cloudbeaver:latest`.

### 2. Deploy

```bash
kubectl -n <namespace> apply -f cloudbeaver.yaml
kubectl -n <namespace> rollout status deploy/cloudbeaver
```

### 3. Discover the access URL

The Service uses NodePort, so any node IP plus the allocated NodePort exposes the UI:

```bash
namespace=<namespace>
HOST=$(kubectl -n "$namespace" get pod -l app=cloudbeaver \
-o jsonpath='{.items[0].status.hostIP}')
PORT=$(kubectl -n "$namespace" get svc cloudbeaver \
-o jsonpath='{.spec.ports[0].nodePort}')
echo "http://$HOST:$PORT"
```

Open the URL in a browser.

### 4. Initial setup

1. On first launch CloudBeaver prompts you to set the administrator password. Choose a strong password and store it safely — this account governs all subsequent server-side configuration.
2. Log in with the administrator user.
3. (Optional) Switch the UI language under the user menu in the top-right.

### 5. Connect to a PostgreSQL instance

1. Click **New Connection** and choose **PostgreSQL**.
2. Fill **Host** with the cluster Service name and **Port** `5432`. From inside the cluster the host is `<cluster>.<namespace>` (the read-write Service); the `<cluster>-repl` Service points at replicas. From outside the cluster, retrieve the NodePort or LoadBalancer address:

```bash
kubectl -n <pg-namespace> get svc <cluster>
```

3. Enter the database user and password. The Operator stores each role's credentials in a Secret named `<role>.<cluster>.credentials.postgresql.acid.zalan.do`. Retrieve the `postgres` superuser password from its Secret:

```bash
kubectl get secret postgres.<cluster>.credentials.postgresql.acid.zalan.do \
-n <pg-namespace> -o jsonpath='{.data.password}' | base64 -d; echo
```

The same Secret also carries `username`, `host` and `port` keys.

4. (Optional) Set **Database** to the target database; otherwise CloudBeaver connects to the default `postgres` database.
5. Under **Access Management**, grant the current CloudBeaver user permission to use the new connection.
6. Save and test the connection. SQL editors can now be opened from the browser and queries executed against the PostgreSQL cluster.

### 6. Uninstall

```bash
kubectl -n <namespace> delete -f cloudbeaver.yaml
```

The PVC is removed alongside the rest of the manifest. To preserve CloudBeaver state for a future redeploy, delete only the Deployment and Service and re-attach the existing PVC during the next install.
Loading
Loading