How-to guides¶
These guides walk you through writing charms using Ops.
Managing charms¶
As you write your charm, you’ll use tools and resources from around the charming ecosystem.
Once your charm is ready for wide production use, your next goal should be to get it publicly listed on Charmhub, so that it is visible in searches.
Writing charm code and tests¶
Your charm is Python code that depends on Ops, with standard structures for handling events, status, and errors. As you write your charm, make sure to follow best practices.
Unit tests check that your charm correctly handles simulated events from Juju.
Integration tests check that your charm works correctly when deployed to a real Juju model.
Ops enables your charm to output logs to the Juju logs.
Running workloads¶
Your charm is responsible for interacting with a workload.
Kubernetes charms use Pebble to manage containers. Your charm can configure Pebble so that you can access metrics for services and health checks.
Managing features¶
Ops features broadly map to Juju features.
Tracing¶
Ops enables you to trace your charm code and send data to sources such as the Canonical Observability Stack.
Legacy guides¶
Harness is a deprecated framework for writing unit tests. You should migrate to state-transition tests.
Hooks-based charms use script files instead of Python code with Ops. You should migrate to Ops.