Port HelloWorld charms to Operator Framework

There are two HelloWorld charms at Charmhub - The Open Operator Collection

One is using the Reactive Framework and does not require Kubernetes.
The other uses the new Operator Framework but requires Kubernetes.

Is there a HelloWorld for the Operator Framework that does not require Kubernetes?

I am not against Kubernetes; for the purposes of getting to know the Operator Framework, it is good to simplify as much as possible. A new user would encounter the HelloWorld+OperatorFramework+Kubernetes a few stages later.

2 Likes

Hi @simos - nice catch on the “Hello, World” style charms. I’ll see about getting that Reactive charm replaced with an Operator Framework machine charm shortly. Thanks!

Thanks @jnsgruk - I looked at Charmhub - The Open Operator Collection which lists the machine charms, while trying to identify those that are also based on the Operator Framework.
It lists 334 charms but I could not notice a way to filter the Operator Framework charms.
I searched in the Web page (Search in Page) for Operator Framework and clicked on the Highlight All in my browser. I found five such charms.

Four of them mention Kubernetes charm in the About section or ask to install microk8s in the README.md, and appear to be miscategorised. That is, they look like charms that require Kubernetes.

  1. Deploy Prometheus using Charmhub - The Open Operator Collection
  2. Deploy Graylog using Charmhub - The Open Operator Collection
  3. Deploy Alertmanager using Charmhub - The Open Operator Collection
  4. Deploy Grafana using Charmhub - The Open Operator Collection

The fifth, https://github.com/canonical/elasticsearch-operator appears to be a charm for Kubernetes as well, https://github.com/canonical/elasticsearch-operator/blob/master/src/charm.py#L336
Is that the case?

I would need a sample machine charm for the Operator Framework if I were to complete the set of three introductory tutorials that I describe above.

3 Likes

Hi @simos!

Yes, they do appear to be miscategorised, thanks for spotting that! @roadmr or @toto can probably help there (these are actually Operator Framework Kubernetes charms)

As for example machine charms using Operator Framework:

  • This week I’ll continue work on porting the hello-juju charm. I’ve started work in this branch. I still need to write a decent README and implement the relation and some tests. The relation should be done today! This will get published to Charmhub when complete.

  • You could check out the Ubuntu Advantage charm (it’s a subordinate charm). See source code / charm store .

  • Another is the MicroK8s charm source code / charm store.

Looks like those last two haven’t been pulled across into Charmhub yet. I guess @mthaddon may also know of some more Operator Framework machine charms.

Those three tutorials sound great! Have you seen the latest developer docs? They don’t cover everything you mentioned, but there is definitely a start on the basic constructs of Juju. You can also contribute directly to those docs through Discourse if there is anything specific missing :slight_smile:

(Forgot to include a link that documents how to contribute great tutorials :slight_smile:)

1 Like

I’m not actually aware of other machine operator framework charms than the ones you mentioned above, but it’s possible there are more and I just don’t know about them.

Fwiw, both of those charms have been pulled into charmhub, it’s just you need to translate the old ~user/charm-name URL on the charm store to user-charm-name on charmhub, so Deploy Ubuntu Advantage Charmers Ubuntu Advantage using Charmhub - The Open Operator Collection and Deploy Pjdc Microk8S using Charmhub - The Open Operator Collection.

1 Like

@simos An update, I’ve ported the Hello, Juju charm to Operator Framework, just waiting for it to be reviewed/merged/published :slight_smile: https://github.com/juju/hello-juju-charm/pull/2

1 Like

Hey folks, I took the liberty to move this conversation to a new post so people can easily find it :wink:

1 Like

Just a quick update, this is now merged and published :slight_smile:

1 Like

Nice work! Looks really good.

The preview unfortunately seems to say juju is a Kubernetes thing.

Oh that’s odd… thanks for spotting!

@jkfran any reason why the link preview above displays “Kubernetes Operator” for the charm – this particular charm is a machine charm! :slight_smile:

@jnsgruk I think we have a default one, I am sure we could differentiate it. Let me ask what should be the description for a machine charm.

3 Likes