Automatic Upgrades¶
This page is for operators who want a service at their Node to install the patch releases of its product by itself. It explains what Pubgrade and Pubgrade-Sidecar do, how to install the sidecar next to a service, how to restrict it to the releases it may roll out, how it gets subscribed, how to roll back and what to check when an upgrade doesn't arrive. Automatic upgrades are optional (see Upgrades).
How it works¶
- A product's release workflow pushes a new image, for example
elixircloud/tesk-api:2.1.1, and then notifies Pubgrade of it. - Pubgrade notifies every subscription of that product's repository: it sends the image name and tag to each subscriber's callback URL, once, without retries.
- Pubgrade-Sidecar, which runs in the namespace of the service, checks the tag against its settings, waits until the image is in the registry, and changes the image tag of the Deployments that it may update. Kubernetes then rolls out the new pods.
The sidecar changes nothing else: not the Helm release, not the values, not
the other containers. It may only get and patch the Deployments that it
is told to update.
Automatic upgrades cover patch releases of the minor release that you run. Leave these to Helm:
- Minor and major releases. They come with upgrade notes, and often with new values. Install them with Helm, as the product's upgrade notes say, and then move the sidecar to the new minor release (see Move to a new minor or major release).
- Images of other parties, such as MongoDB or PostgreSQL. Their releases don't notify Pubgrade.
- The sidecar itself. Upgrade it with Helm, like any chart.
A product joins automatic upgrades once its release workflow notifies Pubgrade. Products without releases, or with images that you built yourself, can't use them.
Prerequisites¶
- A service on Kubernetes or OpenShift that you installed with its Helm
chart from a release, and whose Deployment runs a version tag of that
release, for example
2.1.0. A sidecar that should refuse downgrades can't compare tags such aslatest,devorsha-<commit>. - A product whose release workflow notifies Pubgrade, for example tesk-api or TRS-Filer. Ask the product's maintainers or the admins if you aren't sure.
- Rights in the namespace of the service to create Secrets, a Deployment, a
Service, a ServiceAccount, a Role and a RoleBinding, and a Route or an
Ingress, and to
getandpatchthe Deployment of the service. The sidecar's Role can only grant what you hold. - An address for the sidecar, with TLS, that Pubgrade can reach, for
example
sidecar.example.org. kubectl,helm,git,openssl,curlandjq.
Install the sidecar¶
Install Pubgrade-Sidecar 0.3.1 into the namespace of the service, as described in Deployment. The steps below use these placeholders:
<NAMESPACE>: the namespace of the service.<DEPLOYMENT>: the Deployment that runs the image, for exampletesk-api.<ALLOWED_TAGS>: the tags that the sidecar may roll out (see the next section), for example2\.1\.[0-9]+.<SIDECAR_HOST>: the address of the sidecar, for examplesidecar.example.org.
Tutorial: Onboard a Node shows the same steps with the values for TESK.
-
Check out the release of the sidecar:
-
Check the tag that the Deployment runs. It must be a version, such as
2.1.0:kubectl -n <NAMESPACE> get deployment <DEPLOYMENT> \ -o jsonpath='{.spec.template.spec.containers[*].image}{"\n"}'If it isn't, upgrade the service with Helm to a release first.
-
Create a Secret with an access token of its own for this sidecar. The token goes through a file that only you can read, never on a command line, where other users of the machine could see it:
TOKEN_FILE="$(mktemp)" openssl rand -hex 32 | tr -d '\n' > "$TOKEN_FILE" kubectl -n <NAMESPACE> create secret generic pubgrade-sidecar \ --from-file=access-token="$TOKEN_FILE" rm -f "$TOKEN_FILE"Pubgrade sends this token with each notification, and the sidecar rejects calls without it.
-
If your cluster shares one egress address with many other pods, as on many hosted clusters, create a Secret with a read-only Docker Hub token for the sidecar's checks of the registry, as in step 3 of the tutorial. Anonymous checks count against a limit per address (see Registries).
-
Write the values into a file of their own, for example
sidecar-values.yaml, not into the values file of the service:targetDeployments: - <DEPLOYMENT> accessToken: existingSecret: pubgrade-sidecar # Only with the Secret of step 4: registryCredentials: existingSecret: registry-credentials # Roll out only higher versions, and only those that match refuseDowngrades: true allowedTags: '<ALLOWED_TAGS>' hostName: <SIDECAR_HOST> # On OpenShift: route: enabled: true # Elsewhere, instead: # ingress: # enabled: true # className: nginx # tlsSecretName: sidecar-tlsOn clusters that reject pods asking for the
RuntimeDefaultseccomp profile, addpodSecurityContext: {seccompProfile: null}. If your namespace has a LimitRange, check the sidecar's requests and limits against it (see Resources). -
Install the chart:
-
Check the sidecar from outside, as in Checking a deployed sidecar. The script only reads, and ends with exit code 0 if all checks passed:
ACCESS_TOKEN="$(kubectl -n <NAMESPACE> get secret pubgrade-sidecar \ -o jsonpath='{.data.access-token}' | base64 -d)" \ tests/check_deployment.sh https://<SIDECAR_HOST> <DEPLOYMENT>Expect one
okline per check, and noFAIL.
Restrict upgrades to allowed tags¶
Always set both refuseDowngrades: true and allowedTags. Without them,
the sidecar rolls out any tag that a notification names.
Without allowedTags, a sidecar can move a service to a new major release
A notification of a new minor or major release would then be rolled
out like a patch release, outside Helm and without its upgrade notes:
the new release may need new values, a migration or other steps, and
the service may stop working. A notification of an old release, or of
a tag that moves, such as latest, could also roll the service back to
an image with known vulnerabilities.
allowedTagsis a regular expression that the whole tag must match. Name the patch releases of the minor release that you run: for tesk-api 2.1.x,2\.1\.[0-9]+; for TRS-Filer 0.6.x,0\.6\.[0-9]+. Escape the dots. Keep the expression simple, without nested repetitions.refuseDowngrades: trueaccepts only a tag that is a higher version than the one the Deployment runs.
The sidecar answers a notification that these settings refuse with
409 Conflict and changes nothing (see Refusing
downgrades). A refused notification of a new minor
release is expected: it reminds you to install that release with Helm.
Get the sidecar subscribed¶
Pubgrade notifies only the callback URLs that are subscribed to a
product's repository. The callback URL of the sidecar is
https://<SIDECAR_HOST>/deployment. Subscribe it once per repository, with
type tag and value *, so that it gets every release, and let
allowedTags decide what it rolls out.
- At the ELIXIR On-Cloud: registration at the central Pubgrade (see Central Addresses) is closed. Write to the admins with the product, the callback URL and the namespace of your sidecar; they subscribe it and agree with you how to pass the sidecar's access token, which is part of the subscription. Never send the token in a plain email.
- With a Pubgrade of your own: register a user, have an admin verify it, and subscribe, as described in Usage of the Pubgrade docs. While registration is closed, the request needs an admin's credentials too (see Register while registration is closed).
For maintainers of a product: the release workflow notifies Pubgrade with
the notify action right after it pushes the image. Run
that step only if both the variables PUBGRADE_URL and
PUBGRADE_REPOSITORY_ID are set, so that forks and repositories that
aren't registered skip it.
Check that upgrades arrive¶
-
Ask the sidecar for the state of its last delivery:
ACCESS_TOKEN="$(kubectl -n <NAMESPACE> get secret pubgrade-sidecar \ -o jsonpath='{.data.access-token}' | base64 -d)" printf 'X-Access-Token: %s\n' "$ACCESS_TOKEN" | curl -sS -H @- https://<SIDECAR_HOST>/deployment/<DEPLOYMENT> | jq . unset ACCESS_TOKENThe token goes to
curlon its standard input, never on the command line. The answer names the image and the status of the rollout. -
After the next patch release of the product, check that the Deployment runs it, and that its pods are ready:
kubectl -n <NAMESPACE> rollout status deployment/<DEPLOYMENT> kubectl -n <NAMESPACE> get deployment <DEPLOYMENT> \ -o jsonpath='{.spec.template.spec.containers[*].image}{"\n"}'Expect
successfully rolled outand the new tag. -
Run one task or request against the service, as after any upgrade, and check that sync updated its entry in the Cloud Registry (see After a deployment or an upgrade).
The canary tests the whole chain every week: a workflow releases a new version of a tiny image, and checks that every canary site rolled it out through Pubgrade and a sidecar of its own. A site of your own needs a small Deployment and a sidecar next to your service; ask the admins if you want one.
Keep upgrades across Helm upgrades¶
A rollout by the sidecar changes the image in the cluster, not in your
Helm release. The next helm upgrade or helm rollback of the service
puts the image of its values back, even if you change something else: the
service goes back to the older release (see Rollouts and
Helm).
So that no rollout of the sidecar runs between reading the tag and the upgrade, pause the sidecar for the upgrade:
-
Stop the sidecar, and wait until its pod is gone; a delivery in progress ends with it:
-
Read the tag that runs (step 2 of Check that upgrades arrive), and write it into the image value of your values file, for example
tesk.image.tagfor TESK orimage.tagfor many other charts. - Upgrade from that file, not with
--reuse-values. -
Start the sidecar again:
-
Pubgrade notifies each release once, without retries: a release published while the sidecar was stopped never reaches it. Check the product's releases, and install a newer patch release with Helm.
Move to a new minor or major release¶
- Stop the sidecar, as in step 1 of Keep upgrades across Helm upgrades.
- Upgrade the service with Helm, following the product's upgrade notes, for example those of TESK. Install the latest patch release of the new minor release.
-
Change
allowedTagsinsidecar-values.yamlto the new minor release, for example from2\.1\.[0-9]+to2\.2\.[0-9]+, and upgrade the sidecar, which starts it again: -
Check the sidecar again, as in step 7 of the install.
- Check whether a newer patch release of the new minor release came out since step 2. Pubgrade doesn't notify the sidecar again of releases that it refused or missed: install such a release with Helm.
Roll back¶
If a patch release breaks the service:
-
Stop the sidecar, and wait until its pod is gone, so that neither a delivery in progress nor a repeated notification can roll the broken release out again:
-
Go back with Helm to the last good release: set its tag in the image value of your values file and run
helm upgradewith that file. Don't usekubectl rollout undoor a fixed Helm revision number: later rollouts and upgrades move both. - Check the service, as after any upgrade.
-
Start the sidecar again before the fixed release is published:
Pubgrade notifies each release once, without retries: a release published while the sidecar is stopped never reaches it. Then install that release with Helm.
Canceling a build at Pubgrade doesn't roll anything back: deployments keep what they already rolled out.
Troubleshooting¶
| What you see | Likely cause | What to do |
|---|---|---|
| The service still runs the old tag after a release | The release is a new minor or major one, or the tag doesn't match allowedTags |
Expected for minor and major releases: install them with Helm. Otherwise, check allowedTags and the sidecar's log (kubectl -n <NAMESPACE> logs deployment/pubgrade-sidecar) |
409 in the sidecar's log or at Pubgrade |
The tag isn't allowed, or isn't a higher version than the one that runs | As above; a 409 for an older release is the sidecar doing its job |
| No notification in the sidecar's log | The sidecar isn't subscribed to the product's repository, wasn't reachable, or the release didn't notify Pubgrade | Check the subscription with the admins; check that https://<SIDECAR_HOST> is reachable from outside (step 7 of the install) |
| The delivery failed with "Image not available" | The registry has no such tag yet, refused the sidecar, or rate-limited it | See Troubleshooting "Image not available"; set registryCredentials on a shared egress address |
The service went back to an older release after a helm upgrade |
The values file pins the old image | See Keep upgrades across Helm upgrades |
| The service info or the registry shows the old version | The chart writes the version into the service info at Helm time | For TESK, a known gap (TESK#354); otherwise, check the product's docs |
| The new pods don't get ready | The release doesn't work in your setup | The old pod keeps serving with a rolling update; see Roll back |
What runs at our Nodes¶
As of 2026-12-02, these services of the ELIXIR On-Cloud upgrade themselves through the central Pubgrade:
| Node | Service | Allowed tags |
|---|---|---|
| Finnish Node (CSC Rahti) | TESK (tesk-api) | 2\.1\.[0-9]+ |
| Czech Node (CERIT-SC) | TESK (tesk-api) | 2\.1\.[0-9]+ |
| Finnish Node (CSC Rahti) | TRS-Filer | 0\.6\.[0-9]+ |
- On 2026-12-02, the patch release tesk-api 2.1.1 reached the TESK of both Nodes through Pubgrade, without a Helm run at either Node: about 22 seconds from the notification to a ready pod at the Finnish Node, and about 30 seconds at the Czech Node (generic-issues#181). Only the tesk-api image changed; the tes-authz sidecar, the taskmaster and the filer follow the chart.
- The canary runs once a week, with a site at the Finnish Node.
- Known gap: after such an upgrade,
/service-infoof TESK still reports the version of the last Helm run, so the Cloud Registry shows the old version too. A fix is in progress (TESK#354). - Other services, such as proTES, Poiesis and the databases, are upgraded with Helm.
What's next¶
- Policies and Requirements: what operators must do with each upgrade.
- Pubgrade-Sidecar docs and Pubgrade docs for all settings.
- Questions: write to cloud-service@elixir-europe.org.