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:
user@host:~$ charmcraft list-extensionsExtension name Supported bases Experimental bases
--------------------- -------------------------- --------------------------
django-framework ubuntu@22.04, ubuntu@24.04 ubuntu@26.04
expressjs-framework ubuntu@24.04 ubuntu@26.04
fastapi-framework ubuntu@24.04 ubuntu@26.04
flask-framework ubuntu@22.04, ubuntu@24.04 ubuntu@26.04
go-framework ubuntu@24.04 ubuntu@26.04
spring-boot-framework ubuntu@24.04, ubuntu@26.04
View details about the extension in use¶
Suppose you’ve initialised a rock / charm with a profile that comes with
an extension, and your
rockcraft.yaml / charmcraft.yaml > extensions lists this
extension.
Example
name: my-flask-app-k8s
type: charm
base: ubuntu@24.04
platforms:
amd64:
# (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:
Expanding an extension
user@host:~$ CHARMCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=1 charmcraft expand-extensionsname: my-flask-app-k8s
summary: A very short one-line summary of the Flask application.
description: |
A comprehensive overview of your Flask application.
base: ubuntu@24.04
platforms:
amd64:
build-on:
- amd64
build-for:
- amd64
parts:
charm:
plugin: charm
source: .
build-snaps:
- rustup
override-build: |-
rustup default stable
craftctl default
type: charm
charm-libs:
- lib: traefik-k8s.ingress
version: '2'
- lib: observability-libs.juju_topology
version: '0'
- lib: grafana-k8s.grafana_dashboard
version: '0'
- lib: loki-k8s.loki_push_api
version: '1'
- lib: data-platform-libs.data_interfaces
version: '0'
- lib: prometheus-k8s.prometheus_scrape
version: '0'
- lib: data-platform-libs.s3
version: '0'
- lib: saml-integrator.saml
version: '0'
- lib: smtp-integrator.smtp
version: '0'
- lib: squid-forward-proxy.http_proxy
version: '0'
- lib: redis-k8s.redis
version: '0'
- lib: tempo-coordinator-k8s.tracing
version: '0'
- lib: openfga-k8s.openfga
version: '1'
- lib: hydra.oauth
version: '0'
actions:
rotate-secret-key:
description: Rotate the secret key. Users will be forced to log in again. This
might be useful if a security breach occurs.
assumes:
- k8s-api
containers:
flask-app:
resource: flask-app-image
peers:
secret-storage:
interface: secret-storage
provides:
metrics-endpoint:
interface: prometheus_scrape
grafana-dashboard:
interface: grafana_dashboard
requires:
logging:
interface: loki_push_api
ingress:
interface: ingress
limit: 1
resources:
flask-app-image:
type: oci-image
description: flask application image.
config:
options:
webserver-keepalive:
type: int
description: Time in seconds for webserver to wait for requests on a Keep-Alive
connection.
webserver-threads:
type: int
description: Run each webserver worker with the specified number of threads.
webserver-timeout:
type: int
description: Time in seconds to kill and restart silent webserver workers.
webserver-workers:
type: int
description: The number of webserver worker processes for handling requests.
webserver-worker-class:
type: string
description: The webserver worker process class for handling requests. Can
be either 'gevent' or 'sync'.
flask-application-root:
type: string
description: Path in which the application / web server is mounted. This configuration
will set the FLASK_APPLICATION_ROOT environment variable. Run `app.config.from_prefixed_env()`
in your Flask application in order to receive this configuration.
flask-debug:
type: boolean
description: Whether Flask debug mode is enabled.
flask-env:
type: string
description: What environment the Flask app is running in, by default it's 'production'.
flask-permanent-session-lifetime:
type: int
description: Time in seconds for the cookie to expire in the Flask application
permanent sessions. This configuration will set the FLASK_PERMANENT_SESSION_LIFETIME
environment variable. Run `app.config.from_prefixed_env()` in your Flask application
in order to receive this configuration.
flask-preferred-url-scheme:
type: string
default: HTTPS
description: Scheme for generating external URLs when not in a request context
in the Flask application. By default, it's "HTTPS". This configuration will
set the FLASK_PREFERRED_URL_SCHEME environment variable. Run `app.config.from_prefixed_env()`
in your Flask application in order to receive this configuration.
flask-secret-key:
type: string
description: The secret key used for securely signing the session cookie and
for any other security related needs by your Flask application. This configuration
will set the FLASK_SECRET_KEY environment variable. Run `app.config.from_prefixed_env()`
in your Flask application in order to receive this configuration.
flask-secret-key-id:
type: secret
description: 'This configuration is similar to `flask-secret-key`, but instead
accepts a Juju user secret ID. The secret should contain a single key, "value",
which maps to the actual Flask secret key. To create the secret, run the following
command: `juju add-secret my-flask-secret-key value=<secret-string> && juju
grant-secret my-flask-secret-key flask-k8s`, and use the output secret ID
to configure this option.'
flask-session-cookie-secure:
type: boolean
description: Set the secure attribute in the Flask application cookies. This
configuration will set the FLASK_SESSION_COOKIE_SECURE environment variable.
Run `app.config.from_prefixed_env()` in your Flask application in order to
receive this configuration.
With base: ubuntu@26.04, the main differences in the expanded output are:
Expanding an extension on Ubuntu 26.04 LTS
base: ubuntu@26.04
parts:
charm:
plugin: uv
source: .
uv-groups:
- charmlibs-pydeps
build-snaps:
- astral-uv
- rustup
override-build: |-
rustup default stable
craftctl default
charm-libs:
# The Redis, tracing, OpenFGA and OAuth libraries are not included.
- lib: traefik-k8s.ingress
version: '2'
# ...
# Set by default in the charmcraft.yaml file that charmcraft init generates.
charm-user: non-root
containers:
app:
resource: app-image
peers:
peers:
interface: peers
resources:
app-image:
type: oci-image
description: flask application image.
config:
options:
# ...
# The flask-secret-key and flask-secret-key-id options are replaced by:
app-secret-key:
type: secret
description: 'Long secret you can use for sessions, csrf or any other thing
where you need a random secret shared by all units. The secret should contain
a single key, "value", which maps to the actual application secret key. To
create the secret, run the following command: `juju add-secret my-app-secret-key
value=<secret-string> && juju grant-secret my-app-secret-key my-app`, and
use the output secret ID to configure this option.'
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.