UPDATED (May 8, 2020 @ 0930 UTC): I’ve updated the document to reflect a slight change in the architecture. It still uses the Ports and Adapters architectural pattern but is now more faithful in its implementation of it. Namely the business logic are no longer named “handlers” but just functions whereas the “handler” term is used exclusively within the charm module as it should be.
I just revisited my work on charm-k8s-prometheus which I wrote with the help of the Operator Framework. For this pass I wanted to focus on its design architecture rather than its functionality. I wanted to ensure ease of code maintenance so I doubled down on adopting Alistair Cockburn’s Ports and Adapters Pattern.
Here is a short discussion on the design decisions I made: Google Doc.
I’m looking for some feedback on this architectural decision as well as notes from others who’ve worked with the Operator Framework about their own architecture.