Repository navigation
feat: Documentation improvements for a real setup - #5
Conversation
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
left a comment
There was a problem hiding this comment.
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.
| > **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). | ||
|
|
There was a problem hiding this comment.
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.
| > **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). |
| 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 | ||
| ``` |
There was a problem hiding this comment.
Two points:
releases/latest/downloadmakes this non-reproducible: the result changes whenever upstream releases. Please pin explicit versions.- "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:
| 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 | |
| ``` |
| - Set `terminationGracePeriodSeconds` to something reasonable (e.g. `600`). The | ||
| default is **7 days**, which stalls every node drain and rolling upgrade. |
There was a problem hiding this comment.
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).
| - 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. |
|
|
||
| - 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. |
There was a problem hiding this comment.
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.
| - 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`. |
| Compare the error timestamps against the restart — messages that stop when the | ||
| broker came back need no action. |
There was a problem hiding this comment.
"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.
| 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. |
| 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: |
There was a problem hiding this comment.
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.
| 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: |
| 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. |
There was a problem hiding this comment.
Worth saying why: once enabled, the Example app is reachable through the Docs proxy at /example/ (same host, same Ingress) without any authentication.
| 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. |
| $ kubectl top nodes | ||
| ``` | ||
|
|
||
| Lower the `requests` of Docs or of your dependencies, or use larger nodes. |
There was a problem hiding this comment.
Minor: by default the chart sets requests: {} for all Docs containers, so Docs only contributes to scheduling once the user sets requests.
| 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. |
| ### 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. |
There was a problem hiding this comment.
"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.
| ### 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. |
|
|
||
| 1. `kubectl port-forward svc/documentserver 8082:8888` → welcome page loads | ||
| (Docservice + Proxy). | ||
| 2. `helm test RELEASE_NAME` → chart's own dependency checks. |
There was a problem hiding this comment.
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.
| 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. |
2a87c00 to
4ba6caa
Compare
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>
… 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>
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>
02cad37 to
69c5475
Compare
Signed-off-by: mheidari <meisam.heidari@strato.de>
|
Fixes are applied according to the reviewer comments. |
This PR improves the documentation for a real setup