Manage extensions¶
This guide shows how to view available extensions and view details about extensions in use.
View all the available extensions¶
To view all the available Rockcraft or Charmcraft extensions, run the rockcraft list-extensions or charmcraft list-extensions command. For example:
$ charmcraft list-extensions
Extension name Supported bases Experimental bases
---------------- ----------------- --------------------
flask-framework ubuntu@22.04
View details about the extension in use¶
Suppose you’ve initialised a rock / charm with a profile that comes with
an extension (currently, flask-framework), and your
rockcraft.yaml / charmcraft.yaml > extensions lists this
extension.
Example
mkdir my-flask-app-k8s cd my-flask-app-k8s/ charmcraft init --profile flask-framework
user@host:~$ Charmed operator package file and directory tree initialised.
Now edit the following package files to provide fundamental charm metadata
and other information:
charmcraft.yaml
src/charm.py
README.md
ls -R
user@host:~$ .:
charmcraft.yaml requirements.txt src
./src:
charm.py
cat charmcraft.yaml
name: my-flask-app-k8s
type: charm
bases:
- build-on:
- name: ubuntu
channel: "22.04"
run-on:
- name: ubuntu
channel: "22.04"
# (Required)
summary: A very short one-line summary of the flask application.
# (Required)
description: |
A comprehensive overview of your Flask application.
extensions:
- flask-framework
# Uncomment the integrations used by your application
# requires:
# mysql:
# interface: mysql_client
# limit: 1
# postgresql:
# interface: postgresql_client
# limit: 1
To view details about what that extension is adding to your charm, set the
CHARMCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS environment variable to 1,
then run charmcraft expand-extensions. For example:
To expand charmcraft.yaml using the extensions specified in the file
and output the resulting configuration to the terminal, run
expand-extensions. To expand the
extensions listed in rockcraft.yaml, run expand-extensions.