How to create a charm bundle

From a technical point of view, a charm bundle is fundamentally just a YAML file. This document shows you a few ways in which you can generate this file to create a charm bundle.


From a Juju model

The simplest way to create a charm bundle is to generate it automatically from a Juju model. This is done with the export-bundle command, which exports a single model configuration. For example, to export the currently active model into file mymodel.yaml:

juju export-bundle --filename mymodel.yaml

This will create the YAML file for your bundle.

If Juju detects that the model uses deployment-specific parameters, it will output a multi-document bundle consisting of a base bundle and an overlay document for the deployment-specific settings.

From an existing bundle

The charm store, Charmhub, contains hundreds of bundles. Download the contents of a bundle similar to what you want. Then modify it to add your own custom functionality.

From scratch

You can, of course, also create a bundle from scratch: First, create the bundle YAML file. Then, start populating it to suit your needs.

Last updated a month ago.