github.com/juju/charm/v11@v11.2.0/README.md (about) 1 Juju charms 2 =========== 3 4 This package parses juju charms. 5 6 ## Anatomy of a charm 7 8 A bare minimum charm consists of a directory containing a series of files and 9 directories that inform Juju how to correctly handle and execute a charm. 10 11 The [charming docs](https://discourse.juju.is/c/docs/charming-docs) provide more 12 advanced information and tutorials. 13 The following is a very simple basic configuration guide. 14 15 ### `metadata.yaml` 16 17 The `metadata.yaml` is a required charm configuration yaml. It is expected that 18 every charm contains a `metadata.yaml`. 19 20 An example of a very basic `metadata.yaml`: 21 22 ```yaml 23 name: example 24 summary: Example charm 25 description: | 26 A contrived descriptive example of a charm 27 description that has multiple line. 28 tags: 29 - example 30 - misc 31 series: 32 - focal 33 - bionic 34 ``` 35 36 ### `config.yaml` 37 38 `config.yaml` is an optional configuration yaml for a charm. The configuration 39 allows the author to express a series of options for the user to configure the 40 modelled charm software. 41 42 An example of a `config.yaml`: 43 44 ```yaml 45 options: 46 name: 47 default: 48 description: The name of the example software 49 type: string 50 ``` 51 52 It is expected that for every configuration option, there is a name and a type. 53 All the other fields are optional. 54 55 The type can be either a `string`, `int`, `float` or `boolean`. Everything else 56 will cause Juju to error out when reading the charm. 57 58 ### `metrics.yaml` 59 60 `metrics.yaml` represents an optional metrics gathering configuration yaml. For 61 more information about metrics, read up on [Metric collecting charms](https://discourse.juju.is/t/metric-collecting-charms/1125) 62 63 ### `revision` 64 65 The `revision` is used to indicate the revision of a charm. It expects that only 66 an integer exists in that file. 67 68 ### `lxd-profile.yaml` 69 70 The `lxd-profile.yaml` is an optional configuration yaml. It allows the author 71 of the charm to configure a series of LXD containers directly from the charm. 72 73 An example of a `lxd-profile.yaml`: 74 75 ```yaml 76 config: 77 security.nesting: "true" 78 security.privileged: "true" 79 linux.kernel_modules: openvswitch,nbd,ip_tables,ip6_tables 80 devices: 81 kvm: 82 path: /dev/kvm 83 type: unix-char 84 mem: 85 path: /dev/mem 86 type: unix-char 87 tun: 88 path: /dev/net/tun 89 type: unix-char 90 ``` 91 92 ### `version` 93 94 The `version` file is used to indicate the exact version of a charm. Useful for 95 identifying the exact revision of a charm.