Repository navigation
[Helm] Add lifecycle and terminationGracePeriodSeconds for the server pod - #2060
Merged
yili-db merged 24 commits intoOct 31, 2026
Merged
Conversation
This was referenced Oct 27, 2026
Collaborator
Author
|
/review |
2 similar comments
Collaborator
Author
|
/review |
Collaborator
Author
|
/review |
shba24
force-pushed
the
stack/ep3-helm-graceful-shutdown
branch
from
October 27, 2026 07:35
5ef7ded to
21484d9
Compare
yili-db
pushed a commit
that referenced
this pull request
Oct 27, 2026
## 🥞 Stacked PR Use this [link](https://github.com/unitycatalog/unitycatalog/pull/2020/files) to review incremental changes. - [**stack/ep3-helm-release**](#2020) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2020/files)] ← _this PR_ - [stack/ep3-helm-docs](#2021) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2021/files/22d5742dcd3de2ec7784ec335f32eb4aca321559..dc242459fb5b9bf7e5ddd757cb988fad092be25e)] - [stack/ep3-helm-graceful-shutdown](#2060) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2060/files/dc242459fb5b9bf7e5ddd757cb988fad092be25e..21484d93c12f0b49af7b37cb86f5905983d85588)] - [stack/ep14-helm-readyz](#2063) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2063/files/21484d93c12f0b49af7b37cb86f5905983d85588..c2bc7a8976ff0757c1b79d22724a4df534608453)] --------- **Description of changes** The chart has been version `0.0.1-pre.1` with app version `main` since May 2025. A default install therefore runs the `main` server image, a March 2026 development build, and there is no published chart: users clone the repository and install from the folder (#1058, #1025). This PR makes the chart releasable: - **Published name:** the chart is named `unitycatalog-chart`, to be published at `oci://registry-1.docker.io/unitycatalog/unitycatalog-chart`. Docker Hub stores a chart in a repository named after the chart, and `unitycatalog/unitycatalog` already holds the server image. - **Versions from the release:** `Chart.yaml` keeps placeholder versions. `helm/package-chart.sh X.Y.Z` packages chart X.Y.Z with app version `vX.Y.Z`, so a release chart runs that release's server image by default. It rejects a version with a leading `v`, which would point at a `vvX.Y.Z` image. - **UI version:** the UI image keeps the chart's default tag, the app version. Chart X.Y.Z runs `unitycatalog/unitycatalog:vX.Y.Z` and `unitycatalog/unitycatalog-ui:vX.Y.Z`, and each release publishes both. - **README:** install from the OCI registry, which needs Helm 3.8 or later. - **Package contents:** `.helmignore` excludes `*.sh`, so `package-chart.sh` and `generate-docs.sh` don't ship in the published chart. The README drops the version badges, which showed the `0.0.0-dev` and `main` placeholders in a released chart. - **CI:** the workflow packages the chart with the same script and installs that package. Both image tags come only from the version the script stamps. - **Pinned helper images:** the Alpine and busybox helper images move from `latest` to `alpine:3.24.2` and `busybox:1.37.0`, pinned by digest, so every install of a release runs the same images. Each release updates them to the latest stable release (step in #2021's `RELEASING.md`). **User impact.** The published chart is named `unitycatalog-chart`, but resource names don't change: the name helpers fall back to `unitycatalog`, the chart's old name, instead of the chart name. Release `unitycatalog` still creates `unitycatalog-server`, so an install from a cloned folder upgrades in place and keeps its database volume and signing key, with no `nameOverride`. The default is in the helpers rather than `values.yaml`, so a `helm upgrade --reuse-values` keeps it too. I checked with `helm template` that `main`'s chart and this one give the same resource names, apart from the new test pod. **Before the first release.** Docker Hub has only `unitycatalog-ui:main` (May 2025, which predates bun), which the chart starts with yarn (#2019). Each release publishes `unitycatalog-ui:vX.Y.Z`, built with bun (steps in #2021); 0.8.0 is the first. **Tests:** on kind, the chart packaged by `package-chart.sh 0.0.0-ci` ran `unitycatalog:v0.0.0-ci` (built from source) and `unitycatalog-ui:v0.0.0-ci` with no tag override, and `helm test` passed. CI installs that package with the chart's default values, so the UI runs too. `package-chart.sh` rejects `v0.8.0`, `0.8` and `foo`, and accepts `0.8.0`, `0.8.0-rc0` and `0.0.0-ci`. <details><summary><b>📐 Design notes & details</b></summary> **Why placeholders instead of keeping `Chart.yaml` in sync with `version.sbt`.** The release version passed to the script is the only source, so there's no second file to keep in sync and nothing to compare. The Unity Catalog images rendered after packaging 0.7.0: ``` unitycatalog/unitycatalog:v0.7.0 unitycatalog/unitycatalog-ui:v0.7.0 ``` **Why chart version = Unity Catalog version.** A user who asks for chart 0.8.1 expects server 0.8.1. The cost is that a chart-only fix ships with the next release. **Why the UI uses the server's version.** Releases are published by hand. A separate UI version would add a decision and a pin bump to every release, and CI couldn't test a pinned tag before it was published. Rebuilding an unchanged UI image for a release takes a few minutes. **Why not a separate Docker Hub namespace for charts** (for example `unitycatalogcharts/unitycatalog`): - Docker Hub namespaces allow only lowercase letters and digits, and repositories can't be nested. - The `unitycatalog` organization's open-source program benefits apply per organization, and a new organization would start without them. **CI step.** Both images are loaded into kind only as `unitycatalog:v0.0.0-ci` and `unitycatalog-ui:v0.0.0-ci`, with `pullPolicy: Never`. If the stamping broke (for example, the app version stayed `main`), the pods couldn't start and the install would fail. **Pinned helper images.** The chart's helper images used `latest`, so CI and every install could pull different bytes from one run to the next. Tags move too: `busybox:1.37.0` was rebuilt under the same tag on 2026-09-23. They are now pinned by digest: `alpine:3.24.2@sha256:294b…` for the config init container and the create-users job, and `busybox:1.37.0@sha256:bdf5…` for the UI init container. The config init container still runs `apk add` at start (signed packages; versions follow Alpine 3.24); building those tools into an image is a separate change (#1019). The security review of the CI build is in #2019. **Measured with auth on** (kind, `auth.users` set): the create-users job ran on the pinned Alpine, created `[email protected]` and granted CREATE CATALOG. `GET /api/2.1/unity-catalog/catalogs` returned 401 without a token and 401 with a forged token. </details> **PR Checklist** - [x] A description of the changes is added to the description of this PR. - [ ] If there is a related issue, make sure it is linked to this PR. - [x] If you've fixed a bug or added code that should be tested, add tests! - [ ] If you've added or modified a feature, documentation in `docs` is updated This pull request and its description were written by Isaac. --------- Signed-off-by: Shubham Bansal <[email protected]> Co-authored-by: Isaac <[email protected]>
shba24
force-pushed
the
stack/ep3-helm-graceful-shutdown
branch
4 times, most recently
from
October 28, 2026 01:11
60125db to
dc6a808
Compare
Collaborator
Author
|
/review |
shba24
force-pushed
the
stack/ep3-helm-graceful-shutdown
branch
from
October 28, 2026 01:18
dc6a808 to
0ca0630
Compare
Collaborator
Author
|
/review |
shba24
force-pushed
the
stack/ep3-helm-graceful-shutdown
branch
from
October 28, 2026 01:22
0ca0630 to
85298ae
Compare
Collaborator
Author
|
/review |
shba24
force-pushed
the
stack/ep3-helm-graceful-shutdown
branch
3 times, most recently
from
October 28, 2026 01:46
a24b172 to
0642e5d
Compare
The deployment page covers only the tarball, and there are no steps for publishing the chart. - Add docs/server/helm.md: install from the OCI registry, open the API and the optional UI, use PostgreSQL, upgrade and uninstall. Link it from the deployment page and the docs nav. - Add helm/RELEASING.md: publish the server and UI images with the release version before the chart, package with helm/package-chart.sh, push to Docker Hub, and check that every image the published chart runs exists. Only the release managers can push to the Docker Hub organization. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
The release check now renders the chart with the UI on, so it also checks the UI image. The upgrade guide tells source-checkout installs to set nameOverride: unitycatalog, which keeps the old resource names after the chart rename, and ui.enabled: true to keep the UI. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
…efresh The release check now runs Helm with empty Helm and Docker credential files. helm registry logout alone left the docker login credentials in use, so a private chart could pass the check. The guide uses X.Y.Z instead of a fixed release, and says that several replicas with authentication on need server.authorization.policy-refresh. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
With PostgreSQL the chart does a rolling update, so even one replica runs next to its replacement during an upgrade; the guide now asks for policy refresh whenever authentication is on with PostgreSQL. RELEASING.md states who pushes to Docker Hub as a rule, since the access is granted outside the repository. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
…images The chart keeps its resource names, so the guide's port-forward commands use them and the upgrade section no longer needs nameOverride. Releasing now checks the digest-pinned helper images for newer patch releases. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
…managers Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
…ers team Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
shba24
force-pushed
the
stack/ep3-helm-graceful-shutdown
branch
from
October 28, 2026 16:55
4e3e47c to
f8aba28
Compare
…upgrades and hostnames Exporting an empty DOCKER_CONFIG also hid a per-user docker buildx plugin, so every image read as missing. The empty credential files now apply only to helm template, which fetches the chart; the images are inspected with the usual Docker setup. Also: say why a floating tag such as alpine:3 is wrong (it can move to a newer release), show the policy-refresh setting as YAML, pass the same --values file on upgrade, and note that the API needs a bearer token with authentication on and that ingress and httpRoute need a host and turn off the UI's API forwarding. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
… pod Kubernetes can route requests to a pod for a few seconds after it starts terminating. A preStop sleep keeps the server serving until they stop, and the grace period leaves room for that plus server.shutdown-timeout. Both are unset by default, so the rendered chart doesn't change. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
The template used 'with', which skips 0, so the pod fell back to the Kubernetes default of 30s. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
…owntime server.shutdown-timeout is a server property (PT5S, set under server.config.extraProperties), not a chart value. A preStop sleep avoids downtime only with a rolling update; the default single replica on the file database is recreated. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
…wn timeout server.shutdown-timeout is not the total shutdown time, so the grace period needs a few seconds more than the preStop sleep plus the timeout. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
shba24
force-pushed
the
stack/ep3-helm-graceful-shutdown
branch
from
October 29, 2026 22:06
f8aba28 to
34160b1
Compare
Collaborator
|
/review |
… on helm upgrade Without --values or --set, helm upgrade reuses the previous release's values. The trap is the other way: once any --values or --set is passed, earlier values that are not passed again go back to the chart defaults. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
…nto stack/ep3-helm-graceful-shutdown Co-authored-by: Isaac <[email protected]>
shba24
added a commit
to shba24/unitycatalog
that referenced
this pull request
Oct 29, 2026
…ade wording into stack/ep14-helm-readyz Co-authored-by: Isaac <[email protected]>
Collaborator
|
/review |
yili-db
pushed a commit
that referenced
this pull request
Oct 29, 2026
## 🥞 Stacked PR Use this [link](https://github.com/unitycatalog/unitycatalog/pull/2021/files) to review incremental changes. - [**stack/ep3-helm-docs**](#2021) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2021/files)] ← _this PR_ - [stack/ep3-helm-graceful-shutdown](#2060) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2060/files/847c39b97e269316e547121f6a3a2286c0f7feab..34160b156781ecb49f4502466165f73e738d54e2)] - [stack/ep14-helm-readyz](#2063) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2063/files/34160b156781ecb49f4502466165f73e738d54e2..e4efa5c77c00af037d53770caf3b299aece3f46d)] --------- **Description of changes** The deployment page covers only the tarball, and there are no steps for publishing the chart. This PR adds: - **`docs/server/helm.md`** (in the docs nav, linked from the deployment page). It covers installing the chart from the OCI registry, opening the API and the UI, running `helm test`, switching to PostgreSQL, and upgrading and uninstalling. With authentication on, the PostgreSQL section says to set `server.authorization.policy-refresh`, because replicas share the database and even one replica runs next to its replacement during a rolling update. - **`helm/RELEASING.md`**, the maintainer steps for each release: 1. Publish the server and UI images, both tagged with the release version, before the chart, patch releases included. 2. Update the digest-pinned Alpine and busybox helper images to their latest stable release. 3. Package the chart with `helm/package-chart.sh` and push it to Docker Hub. 4. Check that every image the published chart runs exists, including the UI image. Publishing stays manual, as it is for the images today, and only the release managers (@tdas, @yili-db) push to the `unitycatalog` Docker Hub organization. Their write access is set up in Docker Hub (see the setup steps below). **Tests:** `mkdocs build --strict` and markdownlint pass. I rehearsed every RELEASING.md step against a local registry standing in for Docker Hub (details below): the chart installed from the registry, ran both images at the stamped version, and passed `helm test`, and the image check caught a release with the UI image missing. I also ran the check against Docker Hub on a chart stamped 0.4.0: it found `unitycatalog:v0.4.0` and reported `Missing: unitycatalog/unitycatalog-ui:v0.4.0`, in bash and zsh. <details><summary><b>📐 Design notes & details</b></summary> **Scope.** This is an install guide for the chart, not the full production guide (#87). Topology and sizing aren't covered. **Verified claims in the guide:** - The service names for release `unitycatalog` come from `helm template`. - H2 supports only one server: the file database sits on a `ReadWriteOnce` claim, and a single replica uses the `Recreate` strategy. - `helm uninstall` keeps the database claim and the token signing key Secret: both use `helm.sh/resource-policy: keep`, and a later install reuses them. - Ingress and HTTPRoute send `/api` to the server and everything else to the UI. **UI access.** By default, the UI proxies the API, and its dev server then checks the `Host` header (see #753). Measured on kind, through a port-forward: | `Host` sent | UI proxies the API (default) | Proxy off (Ingress or HTTPRoute) | |---|---|---| | `localhost:3000`, `127.0.0.1:3000`, the Service IP | page | page | | the Service name, `uc.example.com` | `Invalid Host header` | page | So the guide uses `kubectl port-forward` for the default mode, and Ingress or HTTPRoute for a hostname. **Why the verify snippet reads line by line.** On macOS, `xargs` doesn't run the command for empty input, so piping to it would print success when `helm template` failed, for example with a wrong version. zsh, the macOS default shell, doesn't split an unquoted variable into words, so `for image in $images` would check one multi-line string. A `while read` loop works the same in bash and zsh; I ran the snippet in both. The check runs Helm with empty Helm and Docker credential files, so it fetches the chart logged out and catches a chart that was pushed as private. Only `helm template` gets the empty files: `DOCKER_CONFIG` also sets where Docker looks for CLI plugins, so an empty one would hide a per-user `buildx` and report every image as missing. The images are inspected with your usual Docker setup. `helm registry logout` alone isn't enough: against a stub registry, Helm sent the saved credentials from either file, and sent none only when both were empty. With both empty, an anonymous pull of a public chart from Docker Hub worked. **Release rehearsal.** I ran the RELEASING.md steps on this branch, with a local `registry:2` at `localhost:5001` in place of `registry-1.docker.io` and a kind cluster pulling from it: 1. Built the server image from source and pushed it with the UI image as `localhost:5001/unitycatalog/unitycatalog:v0.8.0-rc0` and `.../unitycatalog-ui:v0.8.0-rc0`. 2. `helm/package-chart.sh 0.8.0-rc0`, then `helm push --plain-http unitycatalog-chart-0.8.0-rc0.tgz oci://localhost:5001/unitycatalog`. `helm show chart` read back version `0.8.0-rc0` and app version `v0.8.0-rc0`. 3. `helm install` from `oci://localhost:5001/unitycatalog/unitycatalog-chart --version 0.8.0-rc0`, overriding only the image repositories. The pods pulled both images from the registry at `v0.8.0-rc0`, and `helm test --logs` passed. 4. The image check, in bash and zsh: "All images exist" for `0.8.0-rc0`, and `Missing: localhost:5001/unitycatalog/unitycatalog-ui:v0.8.0-rc1` for a chart `0.8.0-rc1` whose UI image wasn't pushed. Not covered by the rehearsal: the Docker Hub login, public visibility on Docker Hub (the check runs logged out to catch a private chart), and the multi-platform build. On the default `docker` builder, the build command fails with "Multi-platform build is not supported", which is why RELEASING.md says to run `docker buildx create --use`. **Docker Hub setup before the first release.** Push access lives in the `unitycatalog` Docker Hub organization, not this repository. An organization Owner needs to: 1. Create `unitycatalog/unitycatalog-chart` as a **public** repository, so `helm install` works without a login. 2. Give @tdas and @yili-db write (publish) access to `unitycatalog/unitycatalog`, `unitycatalog/unitycatalog-ui` and `unitycatalog/unitycatalog-chart`, either as Owners or through a team with Read & Write on those three repositories. No one else needs write access. They log in with a Docker Hub personal access token (`docker login`, `helm registry login registry-1.docker.io`). No GitHub secrets are involved. **Security review: Docker Hub credentials in GitHub.** `secrets.DOCKERHUB_USERNAME` and `secrets.DOCKERHUB_TOKEN` appear only in `disabled_docker-build.yml` and `disabled_ui-docker-build.yml`, and every job in those files is `if: false`. No active workflow reads them, including this stack's. I can't see whether the secrets still exist: only repository and organization admins can list secrets. If they do exist as repository secrets, anyone with write access can read them by pushing a workflow to a branch of this repository, so more people than the release managers could push to Docker Hub. Pull requests from forks can't read them. An admin should check and delete them: publishing is manual, so nothing needs them. **Optional: immutable release tags.** Docker Hub can make tags immutable per repository. With a rule such as `v.*` on `unitycatalog/unitycatalog` and `unitycatalog/unitycatalog-ui`, a pushed `vX.Y.Z` can never be replaced, so the tag pins the image the chart runs. </details> **PR Checklist** - [x] A description of the changes is added to the description of this PR. - [ ] If there is a related issue, make sure it is linked to this PR. - [ ] If you've fixed a bug or added code that should be tested, add tests! - [x] If you've added or modified a feature, documentation in `docs` is updated This pull request and its description were written by Isaac. --------- Signed-off-by: Shubham Bansal <[email protected]> Co-authored-by: Isaac <[email protected]>
Main squashed unitycatalog#2021, which this branch already contains; keep this branch's version of the file both sides changed. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
yili-db
reviewed
Oct 29, 2026
yili-db
left a comment
Collaborator
There was a problem hiding this comment.
[AI Assisted] Small and correct: the image has sleep, kindIs "invalid" keeps an explicit 0, and both values are unset by default so existing installs render the same. Two comments: CI coverage for the new branches, and a nit on the grace-period guidance. FYI, the "Merge after #2059" note in the description is stale now that #2059 is merged.
…e docs at the timeout entry Add helm/ci/graceful-shutdown-values.yaml so ct lint renders lifecycle and terminationGracePeriodSeconds, and keep ci/ out of the packaged chart. Give the shutdown guidance its own docs section, name the two values and updateStrategy, link the server.shutdown-timeout entry instead of restating its default, and show that the example fits (10 + 5 + 7 = 22 seconds within 30). Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
shba24
added a commit
to shba24/unitycatalog
that referenced
this pull request
Oct 30, 2026
…review fixes into stack/ep14-helm-readyz Co-authored-by: Isaac <[email protected]>
Collaborator
|
/review |
yili-db
reviewed
Oct 30, 2026
…wn values Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
yili-db
approved these changes
Oct 30, 2026
shba24
added a commit
to shba24/unitycatalog
that referenced
this pull request
Oct 30, 2026
…alues chart lint into stack/ep14-helm-readyz Co-authored-by: Isaac <[email protected]>
shba24
added a commit
to shba24/unitycatalog
that referenced
this pull request
Oct 31, 2026
…/ep14-helm-readyz Co-authored-by: Isaac <[email protected]>
yili-db
pushed a commit
that referenced
this pull request
Nov 4, 2026
…#2063) **PR Checklist** - [x] A description of the changes is added to the description of this PR. - [ ] If there is a related issue, make sure it is linked to this PR. - [x] If you've fixed a bug or added code that should be tested, add tests! - [x] If you've added or modified a feature, documentation in `docs` is updated **Description of changes** The server's health endpoints (`/livez`, `/readyz`) are only served when it starts with `--obs-port`, and the chart had no way to pass it. The chart's probes only checked that the API port accepted a TCP connection, so a pod could receive traffic while the server couldn't reach its database. This PR: - adds `server.deployment.obsPort`. It is unset by default, like the server's `--obs-port` flag. When set, the server starts with `--obs-port` on that port, and the readiness and liveness probes, when turned on, check `/readyz` and `/livez`; - passes `server.deployment.port` to the server as `--port`. The chart used it only for the container port, so with any value other than 8080 the server kept listening on 8080 and the pod failed its startup probe; - adds `server.deployment.command`, defaulting to `./bin/start-uc-server`. Kubernetes runs it instead of the image's `ENTRYPOINT`, so an image that starts through its own wrapper can set it; - makes the create-users job call the server on `server.service.port`. It reached the server through the Service but used `server.deployment.port`, which only worked while both were 8080; - keeps the readiness and liveness probes off by default, as before. Without `obsPort` they check the API port, as they already did; - fixes custom `livenessProbe`, `readinessProbe` and `startupProbe` values (server and UI). Until now they rendered the whole chart context instead of the probe; - adds a CI step that renders non-default values, and installs the chart in CI with `obsPort=8090` and the readiness probe on, so the kind test exercises `/readyz`. <details><summary><b>📐 Design notes & details</b></summary> **Why `obsPort` is optional.** The observability endpoints are off unless the server is given `--obs-port`, and the chart follows that. It also keeps a chart installed from a source checkout working: its default image tag `main` points to a Docker Hub image older than v0.7.0, which rejects `--obs-port`. A `helm upgrade --reuse-values` from a release without the value also keeps working, with observability off. **Example.** ```yaml server: deployment: obsPort: 8090 enableReadinessProbe: true ``` This renders `command: ./bin/start-uc-server` with `args: --port "8080" --obs-port "8090"`, an `obs` container port, and a readiness probe on `/readyz` (period 10s, `failureThreshold: 3`). The startup probe already covers slow starts, so readiness can react within about 30s when the database becomes unreachable. Without `obsPort`, the probes keep their earlier TCP checks and timings. **Compatibility.** - With default values, the server container now gets `command: ./bin/start-uc-server` and `args: --port "8080"`. That is the image's own `CMD` plus its default port, so it starts the same way. Because a pod's `command` replaces the image's `ENTRYPOINT`, an image with its own `ENTRYPOINT` wrapper should set `server.deployment.command` to it. When the value is null or empty, as after a `helm upgrade --reuse-values` from a release made before it existed, the chart falls back to `./bin/start-uc-server`. - With `obsPort` set, the server image must be v0.7.0 or later. **Network exposure.** The observability endpoints are unauthenticated, and the server binds the port on all interfaces. The value's description says that other pods can reach it on the pod IP, suggests a NetworkPolicy, and notes that the kubelet must be allowed through for the probes. The Service doesn't expose the port. **Precedent.** Apache Polaris's chart runs a management port with health and metrics endpoints, and its probes check it. **Probe override fix.** The templates read `{{- if .Values.server.deployment.readinessProbe }} readinessProbe: {{- toYaml . }}`. `if` doesn't rebind `.`, so `toYaml .` dumped the whole render context. They now use `with`, in all six places (server and UI). **CI render step** (in `helm-chart-tests.yml`) checks: - without `obsPort`: `--port` follows `port`, there is no `--obs-port`, and the readiness probe, when on, checks the API port; - with `obsPort=9099`: the `--obs-port` arg, the `containerPort`, and `/readyz` and `/livez` probes on port `obs`; - `obsPort` equal to `port` fails the render with the guard's message; - the default `command` is `./bin/start-uc-server`, `server.deployment.command` replaces it, and a null value falls back to the default; - the create-users job uses the Service port when `port` differs from it; - all six custom probes (server and UI) render as given, with no `Capabilities`, `Release` or `Values` keys; - `terminationGracePeriodSeconds: 0` is kept (#2060). I ran it locally with Helm 3.20.0. It passes on this chart and fails when each bug is put back: an always-on `--obs-port`, no `--port` or `--port` only with `obsPort`, no `obsPort` guard, a default probe on `api`, `if` instead of `with` in any of the six probes, a hard-coded `command`, the job on `server.deployment.port`, or `with` for the grace period. **Docs and validation.** `docs/server/helm.md` gets a short Health checks section, which notes the v0.7.0 requirement. The chart fails at render if `obsPort` equals `port`, since the server would refuse to start. **Other checks.** - `helm lint` passes. - `helm/README.md` was regenerated with helm-docs v1.14.2. - The v0.7.0 server image started with `--obs-port 8090` answers `/readyz` and `/livez` with 200 on 8090, and `/readyz` with 404 on the API port. **Not changed here.** The `nameOverride` row in `helm/README.md` shows `null`: that is what helm-docs v1.14.2 renders for the annotation from #2020, and CI's README freshness check passes. </details> This pull request and its description were written by Isaac. --------- Signed-off-by: Shubham Bansal <[email protected]> Co-authored-by: Isaac <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🥞 Stacked PR
PR Checklist
docsis updatedDescription of changes
When Kubernetes stops a server pod (an upgrade, a scale-down), it can keep routing requests to the pod for a few seconds after sending SIGTERM. This adds two optional values so operators can roll out with zero downtime:
server.deployment.lifecycle, for apreStopsleep that keeps the server serving until traffic stops arriving;server.deployment.terminationGracePeriodSeconds, so that sleep plusserver.shutdown-timeoutfits before Kubernetes kills the pod.Both are unset by default, so the rendered chart doesn't change.
helm/ci/graceful-shutdown-values.yamlsets both so that chart lint renders them.Relies on #2059 (merged). The graceful drain needs the server to receive SIGTERM. #2059 makes
bin/start-uc-serverexecthe JVM; without it, the shell launcher doesn't forward the signal.📐 Design notes & details
Why. Kubernetes removes a terminating pod from Service endpoints asynchronously, so requests can still reach it after SIGTERM. UC's drain on SIGTERM (#2059) has a 1ms quiet period, so it turns those late requests away. A
preStopsleep delays the SIGTERM until routing has caught up.Precedent. Apache Polaris's chart has the same pair (
containerLifecycle,terminationGracePeriodSeconds). Both are unset by default there too, with apreStopsleep given as the example.Example, also added to
docs/server/helm.md:Checks.
helm lintpasses.helm templaterenders the same output as the PR below, apart from the randomly generated signing key.terminationGracePeriodSecondslands in the pod spec andlifecyclein theservercontainer.helm/README.mdwas regenerated with helm-docs; only the two new rows were added.This pull request and its description were written by Isaac.