|
| 1 | += Helm chart |
| 2 | +:description: Install Stackable Cockpit with its Helm chart and configure ingress, reverse proxy headers, CA certificates and the scratch volume. |
| 3 | + |
| 4 | +The Helm chart deploys Cockpit. |
| 5 | +It does not deploy PostgreSQL, the OIDC provider or Trino. |
| 6 | +The chart is published to `oci.stackable.tech/sdp-charts/cockpit`. |
| 7 | +The https://github.com/stackabletech/cockpit/blob/{stackable-operator-branch}/deploy/helm/cockpit/README.md[chart README{external-link-icon}^] lists all values. |
| 8 | + |
| 9 | +[source,console,subs="attributes"] |
| 10 | +---- |
| 11 | +$ helm install cockpit oci://oci.stackable.tech/sdp-charts/cockpit --version {stackable-operator-version} --values cockpit-values.yaml |
| 12 | +---- |
| 13 | + |
| 14 | +== Ingress and reverse proxy |
| 15 | + |
| 16 | +IMPORTANT: Cockpit must be served over HTTPS, because session cookies and credentials such as S3 keys pass through the browser connection. |
| 17 | +Cockpit itself serves plain HTTP, so terminate TLS at the Ingress or reverse proxy and use `https://` URLs for `origin` and `auth.baseUrl`. |
| 18 | + |
| 19 | +The chart creates a ClusterIP Service on port 3000 and can create an Ingress with the `ingress` values. |
| 20 | + |
| 21 | +Cockpit must be served at the root path `/` of its host, for example `https://cockpit.example.com/`. |
| 22 | +Other base paths such as `https://example.com/cockpit/` are not supported, so do not route a path prefix to Cockpit or rewrite paths in the Ingress or reverse proxy. |
| 23 | + |
| 24 | +Set `origin` to the URL users open in the browser. |
| 25 | +Behind a reverse proxy, also set the forwarded headers Cockpit trusts: |
| 26 | + |
| 27 | +[source,yaml] |
| 28 | +---- |
| 29 | +origin: https://cockpit.example.com |
| 30 | +proxy: |
| 31 | + protocolHeader: x-forwarded-proto |
| 32 | + hostHeader: x-forwarded-host |
| 33 | +---- |
| 34 | + |
| 35 | +=== Response header size |
| 36 | + |
| 37 | +Pages send a `Link` header that preloads their JavaScript and CSS. |
| 38 | +It grows with the number of files a page loads and exceeds 4 KB on some pages. |
| 39 | +Proxies with a smaller header buffer answer these pages with `502 Bad Gateway`, for example ingress-nginx and nginx with their default `4k` buffer. |
| 40 | +Raise the buffer to 16 KB: |
| 41 | + |
| 42 | +[source,yaml] |
| 43 | +---- |
| 44 | +ingress: |
| 45 | + enabled: true |
| 46 | + className: nginx |
| 47 | + annotations: |
| 48 | + nginx.ingress.kubernetes.io/proxy-buffer-size: "16k" |
| 49 | +---- |
| 50 | + |
| 51 | +For plain nginx, set `proxy_buffer_size 16k;` and `proxy_busy_buffers_size 16k;`. |
| 52 | + |
| 53 | +// TODO: Remove once Cockpit uses SvelteKit 3, which preloads with <link> elements instead of a header, see https://github.com/sveltejs/kit/pull/15939. |
| 54 | + |
| 55 | +== CA certificates |
| 56 | + |
| 57 | +For backends with a private CA, set either a SecretClass or the path of a mounted CA file: |
| 58 | + |
| 59 | +[source,yaml] |
| 60 | +---- |
| 61 | +trino: |
| 62 | + tls: |
| 63 | + secretClass: tls # <1> |
| 64 | +database: |
| 65 | + tls: |
| 66 | + caCert: /stackable/database-ca/ca.crt # <2> |
| 67 | +extraVolumes: |
| 68 | + - name: database-ca |
| 69 | + secret: |
| 70 | + secretName: database-ca |
| 71 | +extraVolumeMounts: |
| 72 | + - name: database-ca |
| 73 | + mountPath: /stackable/database-ca |
| 74 | + readOnly: true |
| 75 | +---- |
| 76 | +<1> The Secret Operator mounts the CA certificate of the SecretClass. |
| 77 | +<2> A CA file mounted from a Secret. |
| 78 | + |
| 79 | +The same options exist under `storage.tls` for S3 endpoints. |
| 80 | + |
| 81 | +== Additional environment variables |
| 82 | + |
| 83 | +To set xref:reference/environment-variables.adoc[environment variables] directly, use `extraEnv` or `extraEnvFrom`: |
| 84 | + |
| 85 | +[source,yaml] |
| 86 | +---- |
| 87 | +extraEnv: |
| 88 | + - name: LOG_LEVEL |
| 89 | + value: debug |
| 90 | +---- |
| 91 | + |
| 92 | +== Scratch volume |
| 93 | + |
| 94 | +The chart mounts an emptyDir at `/tmp` for the archive preview cache. |
| 95 | +Keep `tmp.sizeLimit` above `storage.archiveCacheMaxMb`, otherwise the kubelet evicts the pod when the cache fills up: |
| 96 | + |
| 97 | +[source,yaml] |
| 98 | +---- |
| 99 | +tmp: |
| 100 | + sizeLimit: 1Gi |
| 101 | +storage: |
| 102 | + archiveCacheMaxMb: 512 |
| 103 | +---- |
| 104 | + |
| 105 | +== Replicas |
| 106 | + |
| 107 | +Cockpit keeps running queries in memory, so keep `replicaCount` at `1`. |
| 108 | + |
| 109 | +// TODO: Remove once query state is shared between replicas, see https://github.com/stackabletech/cockpit/issues/310. |
0 commit comments