Introducing `jhack pull-cmr`

If you often deal with cross-model relations (CMRs), but not often enough to be able to blindly type the sequence of commands you need to type, this is for you. If you deal with CMRs and can never remember when you need to offer something, which is not expose, and when you need to consume… this is also for you.

This is a simple utility to guide you through selecting a CMR through all possible alternatives and activating it.

Setup:

  • Deploy cos-lite to a 'cos' model.
  • Deploy traefik to a 'foo' model.
  • Switch to model foo.
  • jhack pull-cmr cos

image

The command shows all the CMRs you can activate, in the following format: local app, interface name, remote app. The default choice is the first: to relate trfk (local Traefik app) to cos-lite’s alertmanager app via ingress (the names of the endpoints are not shown).

  • type 4.1 and press enter to relate local traefik and remote prometheus via prometheus_scrape.

You’ll see:

And ta-da!

Gimme!

Get it from the Snap Store

This command is available on latest/candidate at the time of writing.

Future plans:

  • Add an ‘educational’ option to output the juju commands used to setup the relation, so that you know what’s happening on the background.
  • Add a ‘remove’ feature to destroy and clean up all traces of a CMR (remove-offer, remove-saas, etc…)
3 Likes

This is awesome!

1 Like