How to deploy an application with a specific series

Contents:

Charmed operators and series

Charmed operators can be created that support more than one release of a given operating system distro, such as the multiple Ubuntu releases shown below. It is not possible to create a charmed operator to support multiple distros, such as one charmed operator for both Ubuntu and CentOS. Supported series are added to the charmed operator metadata like this:

    name: mycharm
    summary: "Great software"
    description: It works
    maintainer: Some One <some.one@example.com>
    categories:
       - databases
    series:
       - jammy
       - focal
    provides:
       db:
         interface: pgsql
    requires:
       syslog:
         interface: syslog
         optional: true

The default series for the charmed operator is the first one listed. So, in this example, to deploy mycharm on jammy, all you need is:

juju deploy mycharm

You can specify a different series using the --series flag:

juju deploy mycharm --series focal

You can force the charmed operator to deploy using an unsupported series using the --force flag:

juju deploy mycharm --series bionic --force

Here is a more complete example showing a new machine being added that uses a different series than is supported by our mycharm example and then forcing the charmed operator to install:

juju add-machine --series bionic
juju deploy mycharm --to 1 --series  bionic --force

Multi-series charmed operators may encounter upgrade difficulties if support for the installed series is dropped. See Forced upgrades for details.

The series resolution order for charms:

  • the ‘–series’ option provided with the juju deploy command
  • the series stated in the charmed operator URL, e.g. bionic/postgresql
  • the ‘default-series’ model key
  • the top-most series specified in the charm’s metadata file

Bundles and series

The series resolution order for bundles:

  • the ‘–series’ option provided with the juju deploy command
  • the series stated in each charmed operator URL in the bundle file
  • the series given at the top level in the bundle file
  • the ‘default-series’ model key

Last updated 5 months ago.