Skip to content

Commit 4eabc8f

Browse files
authored
Initial commit for Postgres Operator UI (#613)
* Initial commit for our basic Postgres Operator UI: * Create and modify Postgres manifests * Watch Operator Logs in the UI * Observe cluster creation progress * S3 Backup browser for clone and restore Many thanks to Manuel Gomez and Jan Mussler for the initial UI work a long time ago!
1 parent 4fc5822 commit 4eabc8f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+12752
-13
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ There is a browser-friendly version of this documentation at
2828

2929
* [How it works](docs/index.md)
3030
* [The Postgres experience on K8s](docs/user.md)
31+
* [The Postgres Operator UI](docs/operator-ui.md)
3132
* [DBA options - from RBAC to backup](docs/administrator.md)
3233
* [Debug and extend the operator](docs/developer.md)
3334
* [Configuration options](docs/reference/operator_parameters.md)

delivery.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,38 @@ pipeline:
5757
fi
5858
export IMAGE
5959
make push
60+
61+
- id: build-operator-ui
62+
type: script
63+
64+
commands:
65+
- desc: 'Prepare environment'
66+
cmd: |
67+
apt-get update
68+
apt-get install -y build-essential
69+
70+
- desc: 'Compile JavaScript app'
71+
cmd: |
72+
cd ui
73+
make appjs
74+
75+
- desc: 'Build and push Docker image'
76+
cmd: |
77+
cd ui
78+
image_base='registry-write.opensource.zalan.do/acid/postgres-operator-ui'
79+
if [[ "${CDP_TARGET_BRANCH}" == 'master' && -z "${CDP_PULL_REQUEST_NUMBER}" ]]
80+
then
81+
image="${image_base}"
82+
else
83+
image="${image_base}-test"
84+
fi
85+
image_with_tag="${image}:c${CDP_BUILD_VERSION}"
86+
87+
if docker pull "${image}"
88+
then
89+
docker build --cache-from="${image}" -t "${image_with_tag}" .
90+
else
91+
docker build -t "${image_with_tag}" .
92+
fi
93+
94+
docker push "${image_with_tag}"

docs/administrator.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ empty sequence `[]`. Setting the field to `null` or omitting it entirely may
313313
lead to K8s removing this field from the manifest due to its
314314
[handling of null fields](https://kubernetes.io/docs/concepts/overview/object-management-kubectl/declarative-config/#how-apply-calculates-differences-and-merges-changes).
315315
Then the resultant manifest will not contain the necessary change, and the
316-
operator will respectively do noting with the existing source ranges.
316+
operator will respectively do nothing with the existing source ranges.
317317

318318
## Running periodic 'autorepair' scans of K8s objects
319319

@@ -409,3 +409,40 @@ A secret can be pre-provisioned in different ways:
409409
* Generic secret created via `kubectl create secret generic some-cloud-creds --from-file=some-cloud-credentials-file.json`
410410
* Automatically provisioned via a custom K8s controller like
411411
[kube-aws-iam-controller](https://github.com/mikkeloscar/kube-aws-iam-controller)
412+
413+
## Setting up the Postgres Operator UI
414+
415+
With the v1.2 release the Postgres Operator is shipped with a browser-based
416+
configuration user interface (UI) that simplifies managing Postgres clusters
417+
with the operator. The UI runs with Node.js and comes with it's own docker
418+
image.
419+
420+
Run NPM to continuously compile `tags/js` code. Basically, it creates an
421+
`app.js` file in: `static/build/app.js`
422+
423+
```
424+
(cd ui/app && npm start)
425+
```
426+
427+
To build the Docker image open a shell and change to the `ui` folder. Then run:
428+
429+
```
430+
docker build -t registry.opensource.zalan.do/acid/postgres-operator-ui:v1.2.0 .
431+
```
432+
433+
Apply all manifests for the `ui/manifests` folder to deploy the Postgres
434+
Operator UI on K8s. For local tests you don't need the Ingress resource.
435+
436+
```
437+
kubectl apply -f ui/manifests
438+
```
439+
440+
Make sure the pods for the operator and the UI are both running. For local
441+
testing you need to apply proxying and port forwarding so that the UI can talk
442+
to the K8s and Postgres Operator REST API. You can use the provided
443+
`run_local.sh` script for this. Make sure it uses the correct URL to your K8s
444+
API server, e.g. for minikube it would be `https://192.168.99.100:8443`.
445+
446+
```
447+
./run_local.sh
448+
```
44.4 KB
Loading
63.7 KB
Loading
35.8 KB
Loading
127 KB
Loading

docs/diagrams/pgui-new-cluster.png

131 KB
Loading
254 KB
Loading
116 KB
Loading

0 commit comments

Comments
 (0)