This is just a braindump, not official guidelines!
Wdyt so far?
Juju deployments can be complex. We have juju relations between charms, but also tcp/http/whatever traffic between workloads. We also have multiplicity. We also have models, controllers and clouds.
Diagrams can be very useful for making sure everyone is on the same page.
“Freestyle” mermaid diagrams
Pros and cons
Pros:
Mermaid diagrams are plain-text so can be conveniently version-controlled.
GitHub, PyCharm, Obsidian, … can render mermaid diagrams natively.
“Freestyling” diagrams means there is no common language and it is therefore difficult to produce diagrams that are inherently consistent and/or that everyone will understand.
Little control over how diagrams are rendered, and sometimes it’s quite off.
Not (yet) supported in discourse.
Relation view
Technically, relations are between charms, not between units.
When the focus is on relations, do not draw units, only apps.
TODO: how to depict that one of the charms in the diagram is a subordiante?
Love the direction this is taking!
I think there should be one more level you can drill down to: the ‘databag view’.
We can use as inspiration jhack’s show-relation view, which I think is quite intuitive.
The arrows in that case should link databag to unit, not unit to unit.
It is not freestyle. Rather, it is very opinionated in a way that promotes clarity. (I can elaborate.)
It’s code-based and, in fact, model based. Individual diagrams are disposable artifacts – what matters, and what you can version-control etc etc., is the model. (I can elaborate.) PS You can export to Mermaid, PlantUML, and other formats.
We’ve started using this combination for Juju docs:
I’m thinking we can keep the source in juju/docs (where we currently keep no docs but where I’d like us to start tracking all issues related to juju.is docs).
The structurizr tool does allow some control over rendering. And we can export to other formats and then process further with other tools, if necessary (though for simplicity etc. I’d personally stick to just one tool and format, namely, structurizr, because I like the c4model it implements and the model-driven way in which it implements it).