Content caching k8s charm (cs:~content-cache-charmers/content-cache-k8s)

Hi!

I have been working on a k8s charm for content caching and I have something ready for public consumption.

This charm allows deploying your own caching layer in front of your application in a k8s cluster on bare metal, public k8s offerings such as Amazon EKS, or both! It is similar to what we currently have deployed in front of the various Canonical and Ubuntu websites as well as what is used for Snapstore snap downloads.

The charm is published to the charmstore and the code available on Launchpad. The charm has unit tests that verify functionality and has been deployed and tested on MicroK8s.

We would be interested in any feedback on the code or charm itself. Please feel free to file bugs against the project on Launchpad.

Thanks in advance for your time and attention. Special thank you to both John Lenton (@chipaca) and Facundo Batista (@facundo) for their feedback and help during development of this charm.

1 Like

Thanks for working on the charm, it sounds very interesting. As a quick ‘how to deploy’ is it as simple as:

  juju deploy content-caching-k8s

What sort of relations does it have, what services does it expose?

Sorry, forgot to include instructions in my original post. You’ll want to build the image to use first:

git clone https://git.launchpad.net/charm-k8s-content-cache
cd charm-k8s-content-cache
docker build . -t myimage:v<revision>
docker tag myimage:v<revision> localhost:32000/myimage:v<revision>
docker push localhost:32000/myimage:v<revision>

Then deploy pointing it at a site you want it to cache or be in front of:

juju deploy cs:~content-cache-charmers/content-cache-k8s --config image_path=localhost:32000/myimage:v<revision> --config site=mysite.local --config backend=http://mybackend.local:80

Then to scale up/out:

juju scale-application content-cache 3

Then point your clients or applications at the K8s ingress, that’s it!

Just an update, should be able to skip building your own image. I just used Launchpad’s OCI to build and push to https://registry.hub.docker.com/r/contentcachecharmers/content-cache/tags?name=edge.

Also updated the charm so it defaults to the docker image hosted on Docker Hub so it’s now just a juju deploy command away! Thanks @pjdc!

For those interested, here’s the OCI bit on Launchpad

https://launchpad.net/~content-cache-charmers/charm-k8s-content-cache/+oci/content-cache/+recipe/content-cache

1 Like