
Content-cache
Channel | Revision | Published | Runs on |
---|---|---|---|
latest/stable | 49 | 17 Dec 2024 | |
latest/edge | 69 | 28 Aug 2025 | |
latest/edge | 2 | 21 Jun 2021 |
juju deploy content-cache-k8s
Deploy Kubernetes operators easily with Juju, the Universal Operator Lifecycle Manager. Need a Kubernetes cluster? Install MicroK8s to create a full CNCF-certified Kubernetes system in under 60 seconds.
Platform:
Basic deployment of the content-cache-k8s charm
In this tutorial, we will deploy and integrate the Content Cache K8s charm using Juju.
What you’ll do
- Deploy the Content-cache-k8s charm.
- Deploy any-charm as a backend application.
- Relate both.
- Relate
content-cache-k8s
to Ingress by using NGINX Ingress Integrator.
Through the process, you’ll inspect the Kubernetes resources created, verify the workload state and assign the Content-cache-k8s to serve your any-app
instance.
What you’ll need
- Juju 3 installed.
- Juju controller and model created.
- NGINX Ingress Controller. If you’re using MicroK8s, this can be done by running the command
microk8s enable ingress
. For more details, see Add-on: Ingress.
For more information about how to install Juju, see Get started with Juju.
Deploy the content-cache-k8s charm
Since Content-cache is meant to serve as cache for another charm, we’ll use any-charm
as an example.
Deploy the charms:
juju deploy content-cache-k8s
juju deploy any-charm backend-app --channel beta --config src-overwrite="$(curl -L https://github.com/canonical/content-cache-k8s-operator/releases/download/rev62/any_app_backend_src.json))"
Run juju status
to see the current status of the deployment. In the Unit list, you can see that Content-cache-k8s is blocked:
content-cache-k8s/0* blocked idle 10.1.97.227 Required config(s) empty: backend, site
backend-app/0* active idle 10.1.97.193
This is because the Content-cache-k8s charm isn’t integrated with our backend-app
yet.
Relate to the backend application
Provide the relation between content-cache-k8s
and backend-app
by running the following juju integrate
command:
juju integrate content-cache-k8s:nginx-proxy backend-app
Run juju status
to see that the message has changed:
content-cache-k8s/0* active idle 10.1.97.227 Ready
backend-app/0* active idle 10.1.97.193
Note: nginx-proxy
is the name of the relation. You can run juju info content-cache-k8s
to check what are the relation names provided by the Content-cache-k8s application and juju status --relations
to see the relations currently established in the model.
The deployment finishes when the status shows “Active”.
Relate to ingress by using NGINX ingress integrator
The NGINX Ingress Integrator charm can deploy and manage external access to HTTP/HTTPS services in a Kubernetes cluster.
If you want to make Content-cache-k8s charm available to external clients, you need to deploy the NGINX Ingress Integrator charm and integrate Content-cache-k8s with it.
See more details in What is Ingress?.
Deploy the charm NGINX Ingress Integrator:
juju deploy nginx-ingress-integrator
If your cluster has RBAC enabled, you’ll be prompted to run the following:
juju trust nginx-ingress-integrator --scope cluster
Run juju status
to verify the deployment.
Provide integration between Content-cache-k8s and NGINX Ingress Integrator:
juju relate content-cache-k8s nginx-ingress-integrator
Run juju status
to see the same Ingress IP in the nginx-ingress-integrator
message:
nginx-ingress-integrator active 1 nginx-ingress-integrator stable 45 10.152.183.233 no Ingress IP(s): 127.0.0.1, Service IP(s): 10.152.183.66
Test the whole thing
The hostname of the backend application is backend-app
.
You can access it through your ingress IP with the following command:
curl http://127.0.0.1
It should return a 404 as the backend-app
is not answering to requests yet.
Start the web server with:
juju run backend-app/0 rpc method=start_server
And try again:
curl http://127.0.0.1
This time you should get a HTML page containing: ok
.