Skip to content

feat: Documentation improvements for a real setup - #5

Merged
meisam-ui merged 26 commits into
mainfrom
feat/docimprove
Nov 27, 2026
Merged

meisam-ui merged 26 commits into
mainfrom
feat/docimprove

Conversation

@rikled

@rikled rikled commented Aug 17, 2026

Copy link
Copy Markdown
Member

This PR improves the documentation for a real setup

rikled added 2 commits August 13, 2026 12:16
Signed-off-by: Hendrik Leidinger <hendrik.leidinger@nextcloud.com>
Signed-off-by: Hendrik Leidinger <hendrik.leidinger@nextcloud.com>
Assisted-by: Claude Code:Opus 4.8

@meisam-ui meisam-ui left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inlining the S3 guide and adding external-services and troubleshooting sections is a real improvement. Requesting changes mainly for: example values that contradict the server defaults, a PVC table listing a claim the chart doesn't create, unverifiable Redis configuration, a missing quorum-queue note for multi-replica brokers, and two broken anchors. Details are inline.

Comment thread README.md Outdated
Comment on lines +72 to +80
> **Note on memory:** the Kubernetes scheduler places pods based on resource
> *requests*, not on actual usage. A cluster whose nodes are individually small
> (under ~4 GB allocatable) can fail to schedule Docs pods with
> `0/N nodes are available: N Insufficient memory` even when real memory usage is
> low. If you hit this, either raise node size or lower the `requests` of Docs and
> of your dependencies (RabbitMQ, Redis and database charts often request far more
> than a small deployment needs). See
> [Troubleshooting](#troubleshooting).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This note duplicates the "Pods stay Pending with Insufficient memory" entry in the new Troubleshooting section, which covers the same point with diagnostic commands. I'd suggest keeping it in one place only.

It's also slightly misleading for a default install: the chart sets requests: {} for all Docs containers (verified with helm template on default values), so Docs itself doesn't contribute to the scheduler's memory accounting unless the user sets requests. A shortage comes from the dependencies or from user-set requests.

Suggested change
> **Note on memory:** the Kubernetes scheduler places pods based on resource
> *requests*, not on actual usage. A cluster whose nodes are individually small
> (under ~4 GB allocatable) can fail to schedule Docs pods with
> `0/N nodes are available: N Insufficient memory` even when real memory usage is
> low. If you hit this, either raise node size or lower the `requests` of Docs and
> of your dependencies (RabbitMQ, Redis and database charts often request far more
> than a small deployment needs). See
> [Troubleshooting](#troubleshooting).
> If Docs pods stay `Pending` with `Insufficient memory`, see
> [Troubleshooting](#troubleshooting).

Comment thread README.md Outdated
Comment on lines +171 to +180
Install cert-manager, wait for all three of its deployments to be ready, then
install the operator and re-apply:

```
$ kubectl apply -f https://github.com/cert-manager/cert-manager/releases/latest/download/cert-manager.yaml
$ kubectl -n cert-manager rollout status deploy/cert-manager --timeout=180s
$ kubectl -n cert-manager rollout status deploy/cert-manager-webhook --timeout=180s
$ kubectl -n cert-manager rollout status deploy/cert-manager-cainjector --timeout=180s
$ kubectl apply -f https://github.com/rabbitmq/cluster-operator/releases/latest/download/cluster-operator.yml
```

@meisam-ui meisam-ui Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two points:

  1. releases/latest/download makes this non-reproducible: the result changes whenever upstream releases. Please pin explicit versions.
  2. "install the operator and re-apply" reads as if the operator was applied before, but the commands apply it only once, after cert-manager. Suggest:
Suggested change
Install cert-manager, wait for all three of its deployments to be ready, then
install the operator and re-apply:
```
$ kubectl apply -f https://github.com/cert-manager/cert-manager/releases/latest/download/cert-manager.yaml
$ kubectl -n cert-manager rollout status deploy/cert-manager --timeout=180s
$ kubectl -n cert-manager rollout status deploy/cert-manager-webhook --timeout=180s
$ kubectl -n cert-manager rollout status deploy/cert-manager-cainjector --timeout=180s
$ kubectl apply -f https://github.com/rabbitmq/cluster-operator/releases/latest/download/cluster-operator.yml
```
Install cert-manager first, wait for all three of its deployments to be ready,
then install the operator:
```
$ kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/<CERT_MANAGER_VERSION>/cert-manager.yaml
$ kubectl -n cert-manager rollout status deploy/cert-manager --timeout=180s
$ kubectl -n cert-manager rollout status deploy/cert-manager-webhook --timeout=180s
$ kubectl -n cert-manager rollout status deploy/cert-manager-cainjector --timeout=180s
$ kubectl apply -f https://github.com/rabbitmq/cluster-operator/releases/download/<OPERATOR_VERSION>/cluster-operator.yml
```

Comment thread README.md Outdated
Comment on lines +188 to +189
- Set `terminationGracePeriodSeconds` to something reasonable (e.g. `600`). The
default is **7 days**, which stalls every node drain and rolling upgrade.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

terminationGracePeriodSeconds is an upper bound, not a fixed wait, so it doesn't stall every drain. The pod exits as soon as the operator's preStop hook finishes. That hook (kubectl get sts <cluster>-server -o jsonpath='{.spec.template.spec.containers[0].lifecycle.preStop.exec.command}') runs rabbitmq-upgrade await_online_quorum_plus_one and drain, each with -t 604800. The long default exists so Kubernetes never kills the hook before stopping the node is safe for quorum queues. Lowering it can break quorum during rolling restarts, which matters once quorum queues are enabled (see the next comment).

Suggested change
- Set `terminationGracePeriodSeconds` to something reasonable (e.g. `600`). The
default is **7 days**, which stalls every node drain and rolling upgrade.
- `spec.terminationGracePeriodSeconds` defaults to **7 days**. It is an upper
bound: the operator's `preStop` hook waits until quorum queues stay available
without this node, then drains it. Lowering the value bounds drain time but can
interrupt that check during rolling restarts. Keep the default when using
quorum queues.

Comment thread README.md

- Set `terminationGracePeriodSeconds` to something reasonable (e.g. `600`). The
default is **7 days**, which stalls every node drain and rolling upgrade.
- Use an **odd** replica count. Scaling *down* is not supported by the operator.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important for multi-replica brokers: broker replicas do not replicate Docs queues. Common/config/default.json declares every work queue with "x-queue-type": "classic", and a classic queue lives on a single node. Restarting that node makes ds.converttask6 unavailable, which shows up as conversion timeouts (ingress 504s).

The server already supports quorum queues (filterQueueOptions in Common/sources/rabbitMQCore.js drops maxPriority for them). Broker-side default_queue_type has no effect, because Docs declares the type explicitly.

Reproduced on a 3-replica operator cluster: with classic queues, restarting the node hosting ds.converttask6 caused 504s that continued until docservice was restarted. With the override below, killing a broker pod caused no outage.

Suggested change
- Use an **odd** replica count. Scaling *down* is not supported by the operator.
- Use an **odd** replica count. Scaling *down* is not supported by the operator.
- **Replicas do not make Docs queues highly available.** Docs declares classic
queues, which live on one node. To replicate them, add to `local.json`
(via `extraConf`):
```json
"rabbitmq": {
"queueconverttask": {"options": {"arguments": {"x-queue-type": "quorum"}}},
"queueconvertresponse": {"options": {"arguments": {"x-queue-type": "quorum"}}},
"queueconvertdead": {"options": {"arguments": {"x-queue-type": "quorum"}}},
"queuedelayed": {"options": {"arguments": {"x-queue-type": "quorum"}}}
}
```
An existing queue's type can't be changed. Delete the existing queues
(`rabbitmqctl delete_queue <name>`) and restart docservice and converter to
recreate them; messages still in those queues are lost. Quorum queues don't
support `maxPriority`, so conversion-task priorities are dropped. Verify with
`rabbitmqctl list_queues name type members`.

Comment thread README.md Outdated
Comment on lines +1570 to +1571
Compare the error timestamps against the restart — messages that stop when the
broker came back need no action.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Need no action" doesn't hold in all cases: conversions can keep failing after the broker returns, until docservice is restarted. Quorum queues avoid this. Switching to them without deleting the existing queues produces a second error worth documenting.

Suggested change
Compare the error timestamps against the restart — messages that stop when the
broker came back need no action.
If conversions still fail after the broker is back, restart Docservice
(`kubectl rollout restart deploy/docservice`). To avoid this on multi-replica
brokers, switch Docs to quorum queues, see
[3.1](#31-alternative-rabbitmq-cluster-operator).
### `PRECONDITION_FAILED - inequivalent arg 'x-max-priority' for queue 'ds.converttaskN'`
The queue already exists with different arguments, typically after changing
`x-queue-type` in `local.json`. RabbitMQ does not change an existing queue's
type. Delete the queue (`rabbitmqctl delete_queue <name>`) and restart Docservice
and Converter so they recreate it. Messages still in the queue are lost.

Comment thread README.md Outdated
Comment on lines +1121 to +1123
address. If it is left unset, the app falls back to the address from the
incoming browser request, and the Converter then tries to download the document
from itself:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fallback isn't the incoming request's address. It's a fixed http://localhost/example/, which the error log below shows: localhost regardless of how the browser reached Docs, and //download from the default's trailing slash plus the appended path.

Suggested change
address. If it is left unset, the app falls back to the address from the
incoming browser request, and the Converter then tries to download the document
from itself:
address. If it is left unset, the app falls back to `http://localhost/example/`,
and Docservice and Converter then try to download the document from
themselves:

Comment thread README.md Outdated
Comment on lines +1132 to +1134
The Example application is for testing only and should not be enabled in
production. A real integration supplies its own callback URLs, subject to the same
browser-facing versus server-facing distinction.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth saying why: once enabled, the Example app is reachable through the Docs proxy at /example/ (same host, same Ingress) without any authentication.

Suggested change
The Example application is for testing only and should not be enabled in
production. A real integration supplies its own callback URLs, subject to the same
browser-facing versus server-facing distinction.
The Example application is for testing only and should not be enabled in
production: once enabled, it is reachable through the Docs proxy at `/example/`
without authentication. A real integration supplies its own callback URLs,
subject to the same browser-facing versus server-facing distinction.

Comment thread README.md Outdated
$ kubectl top nodes
```

Lower the `requests` of Docs or of your dependencies, or use larger nodes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: by default the chart sets requests: {} for all Docs containers, so Docs only contributes to scheduling once the user sets requests.

Suggested change
Lower the `requests` of Docs or of your dependencies, or use larger nodes.
Lower the `requests` you set for Docs (none by default) or for your
dependencies, or use larger nodes.

Comment thread README.md Outdated
Comment on lines +1581 to +1587
### Pods stuck `Terminating` during node drains

Managed Kubernetes providers treat nodes as immutable and replace them for
upgrades and configuration changes. A drain honours PodDisruptionBudgets and pod
grace periods, so a long `terminationGracePeriodSeconds` on **any** workload can
stall a node replacement indefinitely. Check the grace periods of Docs and of your
dependencies before a planned upgrade.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"can stall a node replacement indefinitely" isn't accurate: terminationGracePeriodSeconds is an upper bound, and a pod exits as soon as its preStop hook and process finish. Drains are blocked indefinitely by PodDisruptionBudgets that can't be satisfied, or delayed by preStop hooks that wait, up to the grace period. The Docs workloads use 30 s by default. The provider-specific opening is unsourced.

Suggested change
### Pods stuck `Terminating` during node drains
Managed Kubernetes providers treat nodes as immutable and replace them for
upgrades and configuration changes. A drain honours PodDisruptionBudgets and pod
grace periods, so a long `terminationGracePeriodSeconds` on **any** workload can
stall a node replacement indefinitely. Check the grace periods of Docs and of your
dependencies before a planned upgrade.
### Node drains stall or pods stay `Terminating`
A drain honours PodDisruptionBudgets and pod grace periods. A PodDisruptionBudget
that cannot be satisfied blocks the drain indefinitely; a `preStop` hook that
waits (for example the RabbitMQ Cluster Operator's quorum check) delays it up to
the pod's `terminationGracePeriodSeconds`. The Docs workloads use 30 seconds by
default. Check the budgets and grace periods of your dependencies before a
planned upgrade.

Comment thread README.md Outdated

1. `kubectl port-forward svc/documentserver 8082:8888` → welcome page loads
(Docservice + Proxy).
2. `helm test RELEASE_NAME` → chart's own dependency checks.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth a caveat: sources/scripts/test_ds.py connects to Redis without TLS (redis.Redis(...), no ssl), so helm test fails against a TLS-only Redis even when the installation works.

Suggested change
2. `helm test RELEASE_NAME` → chart's own dependency checks.
2. `helm test RELEASE_NAME` → chart's own dependency checks. Note that the Redis
check does not use TLS and fails against a TLS-only Redis.

Signed-off-by: mheidari <meisam.heidari@strato.de>
@meisam-ui meisam-ui changed the title Feat: Documentation improvements for a real setup feat: Documentation improvements for a real setup Nov 27, 2026
meisam-ui and others added 18 commits November 27, 2026 11:18
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
… operator

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
…ow to use quorum queues

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
…t secret keys

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
…mple

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
meisam-ui and others added 4 commits November 27, 2026 14:36
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
… the inequivalent arg error

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: mheidari <meisam.heidari@strato.de>
Signed-off-by: mheidari <meisam.heidari@strato.de>
@meisam-ui
meisam-ui self-requested a review November 27, 2026 14:15
@meisam-ui

Copy link
Copy Markdown
Contributor

Fixes are applied according to the reviewer comments.

@meisam-ui
meisam-ui merged commit 7011c2f into main Nov 27, 2026
2 checks passed
@meisam-ui
meisam-ui deleted the feat/docimprove branch November 27, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants