Using charmcraft to build an application with subordinate charm “docker charm”

I am working on packing an application using charmcarft tool. The application, named Concourse CI is running in a docker-composed way. After reading quite a few documents online, I guess I can use the subordinate charm-docker to complete my job. I have followed the hello-operator tutorial to come out with a template for my principal charm. But I still have hard time to bring things together. There are 2 main questions:

  1. To charcraft build my docker-compose application, what need to be verified in meta.yaml, config.yaml, and charm.py? I need an example but I can hardly got one.
  2. How to connect principal charm with subordinate charm when deploying the application using juju?

Thank you.

This question is also been asked here:
https://askubuntu.com/questions/1345178/using-charmcraft-to-build-an-application-with-subordinate-charm-docker-charm

Hi Jason,

I’ve also been looking at Concourse CI, and have two charms:

These are k8s charms using the new sidecar pattern, and can be deployed on MicroK8s (for instance) in a juju k8s model as follows:

juju deploy concourse-web
juju deploy concourse-worker
juju deploy postgresql-k8s
juju deploy nginx-ingress-integrator
# Add our relations
juju relate concourse-web concourse-worker
juju relate postgresql-k8s:db concourse-web
juju relate nginx-ingress-integrator concourse-web

You can now visit http://concourse-web in a browser, assuming concourse-web resolves to the IP of your k8s ingress provider (if you’re on MicroK8s and have the ingress addon enabled this will be 127.0.0.1).

I’ve only started working on this recently, and there’s currently an issue with concourse-worker connecting to concourse-web on port 2222 which I need to work through. I’ll try to find time to look at that soon, but any help with that would be appreciated!

Thanks, Tom

1 Like

I have tried your charms and deploy upon my microk8s, and I can see the front page. :grinning:

Something worth mention is when I was deploying “postgresql-k8s” there was an error:

Located charm “postgresql-k8s” in charm-hub, revision 3
ERROR refreshing charm “ch:amd64/focal/postgresql-k8s-3”: unexpected content-type from server “text/html”

But it is an intermittent issue like this one:

I tried it again like an instance afterward and it works again.

It is helpful for the first version of that charms, and I hope I can contribute some a bit on your good starting.

Thx, would you mind adding a note to that bug just to mention that you’ve experienced this too?

Sure. I will do.