gotenberg
by MaikuMori
A Helm chart for Gotenberg
About this chart
Gotenberg
This is a HELM chart for Gotenberg.
Gotenberg provides a developer-friendly API to interact with powerful tools like Chromium and LibreOffice for converting numerous document formats (HTML, Markdown, Word, Excel, etc.) into PDF files, and more!
Upstream links:
OCI Repositories
The recommended way to install these charts is via OCI and the helm search hub maikumori command should list the available charts.
Non-OCI Repository
If you don't want to use the OCI repositories you can add the maikumori repository as follows.
helm repo add maikumori https://maikumori.github.io/helm-charts/
helm repo update
Installing the Chart
To install the chart with the release name my-release:
helm install my-release --namespace gotenberg oci://ghcr.io/maikumori/helm-charts/gotenberg
If you added the non-OCI repository above, you can also use the maikumori/gotenberg shorthand in place of the OCI URL in any of the commands below.
Verifying the Chart
Each release is signed twice: with GPG as a Helm provenance file, and with keyless cosign from this repository's release workflow.
To verify the GPG signature, fetch the signing key (fingerprint F29F20C1CBD1FDE9566828E0641F7D67BC03019B) into a keyring file and pass it to Helm:
curl -sSfL https://raw.githubusercontent.com/MaikuMori/helm-charts/master/pubkey.asc | gpg --dearmor > maikumori.gpg
helm pull oci://ghcr.io/maikumori/helm-charts/gotenberg --version <version> --verify --keyring maikumori.gpg
helm install and helm upgrade accept the same --verify --keyring maikumori.gpg flags.
The cosign signatures need cosign 3.0 or newer and exist for chart 1.28.0 and later. To verify the OCI chart:
cosign verify ghcr.io/maikumori/helm-charts/gotenberg:<version> \
--certificate-identity https://github.com/MaikuMori/helm-charts/.github/workflows/release.yml@refs/heads/master \
--certificate-oidc-issuer https://token.actions.githubusercontent.com
Charts from the GitHub releases come with a .sigstore.json bundle:
cosign verify-blob gotenberg-<version>.tgz --bundle gotenberg-<version>.tgz.sigstore.json \
--certificate-identity https://github.com/MaikuMori/helm-charts/.github/workflows/release.yml@refs/heads/master \
--certificate-oidc-issuer https://token.actions.githubusercontent.com
From chart 1.29.0, releases also carry GitHub artifact attestations recording the release workflow and source commit. Verify them with the GitHub CLI:
gh attestation verify oci://ghcr.io/maikumori/helm-charts/gotenberg:<version> --repo MaikuMori/helm-charts \
--signer-workflow MaikuMori/helm-charts/.github/workflows/release.yml
gh attestation verify gotenberg-<version>.tgz --repo MaikuMori/helm-charts \
--signer-workflow MaikuMori/helm-charts/.github/workflows/release.yml
Uninstalling the Chart
To uninstall/delete the my-release deployment:
helm delete my-release
The command removes all the Kubernetes components associated with the chart and deletes the release.
Upgrading Chart
helm upgrade my-release oci://ghcr.io/maikumori/helm-charts/gotenberg --install
Upgrading to 2.0.0
Chart 2.0.0 runs Gotenberg 9, which changes routes, form fields, flags and metrics. Read Gotenberg's upgrade guide and the chart's CHANGELOG first.
- Check that the cluster runs Kubernetes 1.30 or later.
- Update your values file with the CHANGELOG's Values to update table. If it copies the 1.x defaults, delete the four
api.disable*RouteTelemetry: falseentries andchromium.maxConcurrency: 0. - Remove any
image.tagorimage.digestthat pins Gotenberg 8. - Plan the rollout. Gotenberg 8 and 9 pods share the Service while it runs, and clients of the removed routes fail on the 9 pods. Migrate clients first, set
strategy.type: Recreate, or install 2.0.0 as a separate release and switch clients over. - Upgrade with
--reset-values, so Helm doesn't reuse 1.x values that the schema rejects:
helm upgrade my-release oci://ghcr.io/maikumori/helm-charts/gotenberg --version 2.0.0 --reset-values -f values.yaml
To stay on Gotenberg 8, keep chart 1.31.0.
Using a Newer Gotenberg Version
Chart releases are typically published when new features or breaking changes are added to Gotenberg that require chart modifications. However, you can use any Gotenberg 9 version by overriding the image.tag value.
To use a specific version of Gotenberg:
helm upgrade --install my-release oci://ghcr.io/maikumori/helm-charts/gotenberg --set image.tag="9.10.2"
Or with --rollback-on-failure (--atomic on Helm 3) for automatic rollback on failure:
helm upgrade --install --rollback-on-failure my-release oci://ghcr.io/maikumori/helm-charts/gotenberg --set image.tag="9.10.2"
This allows you to stay current with Gotenberg releases without waiting for a new chart version, as there are typically no breaking changes within a major version. A newer flag the chart maps needs a Gotenberg version that has it.
Pinning Images by Digest
Tags can be moved to point at a different image. To pull exactly the image you reviewed, set its digest along with the tag:
helm upgrade --install my-release oci://ghcr.io/maikumori/helm-charts/gotenberg \
--set image.tag="9.10.2" --set image.digest="sha256:<digest>"
docker buildx imagetools inspect gotenberg/gotenberg:9.10.2 prints the digest. The helm test image is pinned by digest unless you set testImage.tag or testImage.digest.
Resources
The chart sets no resource requests or limits by default. Gotenberg recommends at least 512Mi of memory and 0.2 CPU; Chromium and LibreOffice use more under load, so leave headroom in the memory limit. Chromium, LibreOffice and Gotenberg itself, which does the PDF processing, share it. chromium.maxMemory and libreOffice.maxMemory fail the conversion that runs over its budget and restart that engine, instead of letting the container get OOM-killed. GOMEMLIMIT, set through extraEnv, makes Gotenberg's Go runtime collect garbage before it reaches its share; it's a soft limit, not a cap. Keep the three together under the container's limit:
resources:
requests:
cpu: 200m
memory: 512Mi
limits:
memory: 3Gi
chromium:
maxMemory: 800MB
libreOffice:
maxMemory: 900MB
extraEnv:
- name: GOMEMLIMIT
value: 1000MiB
See Limits for these and the PDF module's limits.
Hardening Example
Outside OpenShift, the chart's default security contexts already meet the Pod Security restricted level; on OpenShift, the SCC decides. Containers and volumes you add, such as initContainers, have to meet it too. Gotenberg's own defaults are permissive about outbound requests: it assumes it runs on a trusted network, so Chromium, LibreOffice, downloadFrom, webhooks and the PDF timestamp authority can reach internal addresses such as the cloud metadata service.
The values below are an example to start from if callers or their documents aren't trusted, not a complete or guaranteed setup: review them against your cluster and threat model, and adjust the NetworkPolicy to your clients, DNS and network ranges. They deny private addresses and limit the pod's network access. CI installs them to catch regressions, checking that documents still convert, that Chromium and the PDF timestamp stage refuse a private address, and that the NetworkPolicy allows DNS and public HTTPS but not another release's Service:
# Example hardening for untrusted callers: a starting point to adjust to your
# cluster, not a complete setup.
# Reject outbound requests to private, loopback and link-local addresses from
# every module that fetches URLs.
api:
downloadFromDenyPrivateIps: true
chromium:
denyPrivateIps: true
libreOffice:
denyPrivateIps: true
pdf:
denyPrivateIps: true
webhook:
denyPrivateIps: true
networkPolicy:
enabled: true
# Only accept API calls from pods in the release's namespace. Replace the
# rule with a selector for your clients. 3000 is api.port.
ingress:
- from:
- podSelector: {}
ports:
- port: 3000
# Only allow DNS, and HTTP(S) outside the private ranges below. Adapt the
# ranges to your cluster and check that your CNI enforces NetworkPolicies;
# this alone doesn't guarantee the cluster network is unreachable. Some
# CNIs don't apply NetworkPolicies to the node's own addresses, which can
# include the Kubernetes API (as on MicroShift). IPv4
# only: on dual-stack clusters, add ::/0 excepting fc00::/7 and fe80::/10.
# DNS pods are kube-dns, or openshift-dns listening on 5353 on OpenShift
# (not tested with OVN-Kubernetes).
egress:
- to:
- namespaceSelector: {}
podSelector:
matchLabels:
k8s-app: kube-dns
ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
podSelector:
matchLabels:
dns.operator.openshift.io/daemonset-dns: default
ports:
- port: 5353
protocol: UDP
- port: 5353
protocol: TCP
- to:
- ipBlock:
cidr: 0.0.0.0/0
except:
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
- 169.254.0.0/16
- 100.64.0.0/10
ports:
- port: 80
- port: 443
Also require authentication on the API, with api.basicAuth.enabled or api.enableOidcAuth, and disable what you don't use, such as chromium.disableRoutes, libreOffice.disableRoutes, or pdf.disableRoutes with pdf.disableStages for all PDF processing. See Outbound URL Filtering for the allow and deny lists.
OpenShift
OpenShift support is best effort. When the cluster serves the security.openshift.io/v1 API, the default security context leaves the user, non-root check and seccomp profile to the SCC. CI installs the chart on MicroShift built from OKD, with the Kindnet CNI rather than OVN-Kubernetes, under the restricted-v2 and anyuid SCCs; it isn't tested on OpenShift Container Platform. Detection needs Helm to see the cluster's APIs: when rendering without cluster access, such as helm template, pass --api-versions security.openshift.io/v1. Issues and pull requests from OpenShift users are welcome.
Requirements
Kubernetes: >=1.30.0-0
Values
| Key | Type | Default | Description |
|---|---|---|---|
| affinity | object | {} | |
| api.archiveMaxEntries | int | nil | Set the maximum number of entries of a zip archive sent in the archives form field. Must be positive. Leave unset for the upstream default (10000). |
| api.archiveMaxRatio | int | nil | Set how many times its own size a zip archive sent in the archives form field may unpack to. Must be positive. Leave unset for the upstream default (100). |
| api.basicAuth.enabled | bool | false | Enable basic authentication, with credentials from existingSecret, or username and password. Mutually exclusive with enableOidcAuth. |
| api.basicAuth.existingSecret | string | "" | Name of an existing secret holding the credentials |
| api.basicAuth.password | string | nil | Set the password (ignored if existingSecret is set) |
| api.basicAuth.passwordKey | string | "" | Key in existingSecret for the password (default: password) |
| api.basicAuth.username | string | nil | Set the username (ignored if existingSecret is set) |
| api.basicAuth.usernameKey | string | "" | Key in existingSecret for the username (default: username) |
| api.bodyLimit | string | nil | Set the request body limit for multipart/form-data (e.g., "100MB") |
| api.correlationIdHeader | string | nil | Set the header name to use for identifying requests (default "Gotenberg-Trace") |
| api.disableDebugRouteTelemetry | bool | nil | Disable telemetry on the debug route. Leave unset for the upstream default (true). |
| api.disableDownloadFrom | bool | nil | Disable the download from feature |
| api.disableHealthCheckRouteTelemetry | bool | nil | Disable health check route telemetry. Leave unset for the upstream default (true). |
| api.disableRootRouteTelemetry | bool | nil | Disable telemetry on the root route. Leave unset for the upstream default (true). |
| api.disableVersionRouteTelemetry | bool | nil | Disable telemetry on the version route. Leave unset for the upstream default (true). |
| api.downloadFromAllowList | list | nil | List of regular expressio |
Deploy gotenberg with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has gotenberg on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartgotenberg is pinned at v2.0.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply