This repo collects example charms built with the juju ops framework. Contributions with your examples is much appreciated!
Ops is a Python framework for developing charms. It uses standard Python structures to make charm development simple.
Charmcraft is a command line tool used alongside Ops to simplify the creation, building, and publication of a charm.
When testing the charms, see more logs with:
juju model-config logging-config="<root>=WARNING;unit=DEBUG"
Below you find a set of charms to assist in creating your own charms covering a number of useful use-cases.
Implements the core hooks in the setup phase of a charm: install, config-changed, start. This is a great starting point for charming up a new software before adding in more features.
This charm implements all core juju hooks to deploy the hello package via apt. systemd is used with a /etc/default/hello config file to manage service startup parameters. A good reference charm which also covers a systemd tactic you might use.
This charm shows a reference implementation for the juju storage hooks: xxx_storage_attached and xxx_storage_detaching
Uses a separate disk (type: filesystem) for storing log files. Useful for charms which needs to have permanent or re-usable data on separate disk.
This charm demonstrates how you can ship a lxd-profile.yaml to tweak lxd container settings. The example deploys privileged containers. It is also specific to LXD clouds/containers.
This charm demonstrates use of metrics in juju charms. It loads some metrics on cpu and memory.
This charm demonstrates use nagios nrpe (and charmhelpers) for monitoring a service. It uses the the local-monitors interface.
This charm can form an relation/integration to haproxy to automatically configure it as a reverse proxy. Very useful for deploying custom web-services.
This charm shows how to pass a custom grafana dashboard over a integration to monitor prometheus metrics. If you look to monitor your application with a full Canonical Observability Stack (COS), you should study the much more mature observed.
This charm implements a hello-world action.
This charm shows how to integrate with the grafana-agent subordinate-charm and how to add advanced observability/monitoring to your own charms and integrate with the Canonical Observability Stack (COS).
Please contribute by creating own examples, trying existing ones out, document, give feedback and support!