Skip to content

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

  1. A product's release workflow pushes a new image, for example elixircloud/tesk-api:2.1.1, and then notifies Pubgrade of it.
  2. 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.
  3. 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 as latest, dev or sha-<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 get and patch the 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, curl and jq.

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 example tesk-api.
  • <ALLOWED_TAGS>: the tags that the sidecar may roll out (see the next section), for example 2\.1\.[0-9]+.
  • <SIDECAR_HOST>: the address of the sidecar, for example sidecar.example.org.

Tutorial: Onboard a Node shows the same steps with the values for TESK.

  1. Check out the release of the sidecar:

    git clone --depth 1 --branch v0.3.1 https://github.com/elixir-cloud-aai/Pubgrade-Sidecar.git
    cd Pubgrade-Sidecar
    
  2. 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.

  3. 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.

  4. 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).

  5. 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-tls
    

    On clusters that reject pods asking for the RuntimeDefault seccomp profile, add podSecurityContext: {seccompProfile: null}. If your namespace has a LimitRange, check the sidecar's requests and limits against it (see Resources).

  6. Install the chart:

    helm install pubgrade-sidecar deployment/ -n <NAMESPACE> -f sidecar-values.yaml
    
  7. 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 ok line per check, and no FAIL.

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.

  • allowedTags is 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: true accepts 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

  1. 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_TOKEN
    

    The token goes to curl on its standard input, never on the command line. The answer names the image and the status of the rollout.

  2. 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 out and the new tag.

  3. 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:

  1. Stop the sidecar, and wait until its pod is gone; a delivery in progress ends with it:

    kubectl -n <NAMESPACE> scale deployment/pubgrade-sidecar --replicas=0
    kubectl -n <NAMESPACE> wait --for=delete pod -l app=pubgrade-sidecar --timeout=120s
    
  2. 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.tag for TESK or image.tag for many other charts.

  3. Upgrade from that file, not with --reuse-values.
  4. Start the sidecar again:

    kubectl -n <NAMESPACE> scale deployment/pubgrade-sidecar --replicas=1
    
  5. 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

  1. Stop the sidecar, as in step 1 of Keep upgrades across Helm upgrades.
  2. 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.
  3. Change allowedTags in sidecar-values.yaml to the new minor release, for example from 2\.1\.[0-9]+ to 2\.2\.[0-9]+, and upgrade the sidecar, which starts it again:

    helm upgrade pubgrade-sidecar deployment/ -n <NAMESPACE> -f sidecar-values.yaml
    
  4. Check the sidecar again, as in step 7 of the install.

  5. 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:

  1. 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:

    kubectl -n <NAMESPACE> scale deployment/pubgrade-sidecar --replicas=0
    kubectl -n <NAMESPACE> wait --for=delete pod -l app=pubgrade-sidecar --timeout=120s
    
  2. Go back with Helm to the last good release: set its tag in the image value of your values file and run helm upgrade with that file. Don't use kubectl rollout undo or a fixed Helm revision number: later rollouts and upgrades move both.

  3. Check the service, as after any upgrade.
  4. Start the sidecar again before the fixed release is published:

    kubectl -n <NAMESPACE> scale deployment/pubgrade-sidecar --replicas=1
    

    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-info of 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