How to upgrade an application

See also: Upgrading things, Application, Juju SDK | Channel, Juju SDK | Upgrading a charm

To upgrade an application, you need to upgrade the channel of its deployed charm.

This always involves the refresh command, but the exact way to use it differs a little bit depending on whether you are dealing with a Charmhub charm or rather a local charm.

Contents:

Upgrade a Charmhub charm

See also: juju status, juju info, juju refresh

Run status to find the current channel.

Run info followed by the charm name to find out all the available channels.

Finally, run refresh followed by the charm name and the channel option to change the charm to the desired channel.

Upgrade a local charm

See also: juju refresh

To upgrade a local charm, run the refresh command followed by the name of the charm and the local path to the charm:

juju refresh juju-test --path ./path/to/juju-test

The command offers many other options, for example, the possibility to replace a charm completely with another charm by using the --switch option followed by a different path (a process known as ‘crossgrading’). (Note: --path and --switch are mutually exclusive. Use --switch if you want to replace your existing charm with a completely new charm.)

Thank you for this doc. What I am missing is what triggers the upgrade. Sure I can do juju upgrade-charm wordpress but how would I know that a new revision is available? I think this info deserves to be part of the documentation even if it reads “it is up to the application to signal the existence of new releases”.

In the section "Applications deployed via Charmhub, you mention “juju info” as a command to use. Thjis command does not exist with juju 2.9.12 (latest/stable as of today). Did you mean “snap info” ?

The command “juju refresh” also does not exist. Can this doc be updated ?

I have juju 2.9.12 installed:

$ juju info slurmd
name: slurmd
charm-id: PNY1jWPbggzG1NZvpftYqLgg86qKyNtd
summary: |
  Slurmd, the compute node daemon of Slurm.
publisher: Omnivector Solutions
supports: focal, centos7
[...]

And juju refresh also exists (see juju refresh --help).

How do I upgrade the jujud image for a running application?

I’d like to read here some information about what happens to resources (or how to upgrade them). suppose I have a charm using an oci image at version 1.0. I re-pack the charm (or publish it to ch) only changing the upstream-image to version 1.1, then I juju refresh the charm. Does the resource get updated automatically?

1 Like