How to define a resource for your charm

This document shows how to define a resource (or more) for your charm.

To define a charm’s resources you must edit the metadata.yaml file of the charm.

Similarly with storage, resources is defined as a top-level YAML map, where each key in the map is the name of a resource, that can map to the following fields:

Field Type Default Description
type string file Type of the resource. Supported values are file or oci-image.
description string nil Description of the resource
filename string nil Name of the file resource

Kubernetes charms must declare an oci-image resource for each container they define in the containers map.

An example resource definition:

# ...
    type: file
    filename: superdb.bin
    description: the DB with needed info
    type: oci-image
    description: OCI image for app
# ...

Last updated 7 months ago.