LinuxCommandLibrary

charm

Deploy and manage applications with Juju

TLDR

Backup your Charm account keys

$ charm backup-keys
copy

Backup Charm account keys to a specific location
$ charm backup-keys [[-o|--output]] [path/to/output_file.tar]
copy

Import previously backed up Charm account keys
$ charm import-keys "[charm-keys-backup.tar]"
copy

Find where your cloud.charm.sh folder resides on your machine
$ charm where
copy

Start your Charm server
$ charm serve
copy

Print linked SSH keys
$ charm keys
copy

Print your Charm ID
$ charm id
copy

SYNOPSIS

The term 'charm' refers to a software package managed by the juju command-line tool. It is not a standalone command. To interact with charms, one typically uses the juju command. For example:

juju deploy <charm-name> [options]

This command deploys an application using a specified charm.

Another common interaction is building charms:

juju build <charm-path> [options]

This command builds a charm bundle from a local directory.

To explore available charms:

juju charms [options]

PARAMETERS

--channel <track>/[risk]/[branch]
    Specifies the release channel for the charm (e.g., stable, beta, edge). Used with juju deploy.

--series <series>
    Defines the operating system series (e.g., focal, jammy) on which to deploy the charm. Used with juju deploy or juju build.

--config <key>=<value>
    Sets configuration options for the deployed charm. Can be specified multiple times. Used with juju deploy.

--resource <resource-name>=<resource-path-or-id>
    Specifies a resource for the charm, typically for bundled files. Used with juju deploy or juju build.

--storage <name>=<pool>,<size>,<count>
    Attaches storage to the deployed charm. Used with juju deploy.

--force
    Forces an action, such as building a charm even if warnings are present. Used with juju build.

--search <keywords>
    Searches for charms in the Charmhub based on keywords. Used with juju charms.

--format <format>
    Specifies the output format (e.g., json, yaml, tabular). Used with juju charms.

DESCRIPTION

In the Linux ecosystem, 'charm' primarily refers to a Juju Charm, a powerful concept within Canonical's Juju orchestration tool. Juju Charms are essentially bundles of operational knowledge, scripts, and metadata that encapsulate how to deploy, configure, connect, scale, and upgrade a specific software application. They abstract away the complexity of managing applications across various cloud environments, Kubernetes, or bare-metal servers. A charm defines the application's lifecycle and its relationships with other applications, enabling automated deployment and management. Developers create charms to make their software easily deployable and maintainable, while operators use them to deploy and manage complex multi-application topologies with simple commands, ensuring best practices and reducing operational burden. They are written using a framework, typically in Python, and provide hooks that Juju executes during different lifecycle events.

CAVEATS

The term 'charm' itself is not an executable Linux command. It refers to a specific type of application package managed by the juju orchestration tool. Therefore, direct execution of 'charm' in a terminal will result in 'command not found'. All interactions with charms are performed through the juju command and its subcommands. Juju and its charms require proper setup of a Juju controller and a cloud/Kubernetes environment.

JUJU CHARMHUB

The Charmhub (charmhub.io) is the official store and repository for Juju Charms. It provides a vast collection of ready-to-deploy charms for popular software, developed by Canonical, vendors, and the community. Operators can search for, download, and deploy charms directly from Charmhub using the juju deploy command. It serves as a central point for discovering and sharing operational knowledge encapsulated in charms.

CHARMED OPERATORS

While 'charm' is a general term, specifically when deployed on Kubernetes, they are often referred to as 'Charmed Operators' or 'K8s Charms'. These leverage the Kubernetes Operator pattern but add Juju's unique orchestration capabilities, providing more sophisticated lifecycle management, cross-application relations, and multi-cloud portability beyond what a typical Kubernetes Operator might offer.

HISTORY

The concept of Juju Charms was introduced by Canonical as part of its Juju orchestration framework. Juju (originally called 'Ensemble') was first released around 2010. Charms were designed to encapsulate operational best practices and automate the deployment and management of applications across various infrastructures. Over time, charms have evolved significantly, moving from an older 'hooks' based system to a more modern 'Operator Framework' paradigm, which allows for more complex and robust operational logic. This evolution has made charms highly versatile, capable of managing applications not only on traditional cloud instances and bare metal but also extensively on Kubernetes clusters (where they are known as Charmed Operators). The Charmhub, an online store for charms, was launched to provide a centralized repository for community and vendor-published charms.

SEE ALSO

juju(1), snap(1), kubectl(1)

Copied to clipboard