Content-cache

  • Canonical IS DevOps
Channel Revision Published Runs on
latest/stable 37 30 Nov 2023
Ubuntu 22.04
latest/edge 49 11 Jul 2024
Ubuntu 22.04 Ubuntu 20.10
latest/edge 2 21 Jun 2021
Ubuntu 22.04 Ubuntu 20.10
juju deploy content-cache-k8s --channel edge
Show information

Platform:

Quick guide

What you’ll do

Through the process, you’ll inspect the Kubernetes resources created, verify the workload state and assign the Content-cache-k8s to serve your Hello-kubecon instance.

Requirements

  • 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 Addon: 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 Hello-kubecon as an example.

Deploy the charms:

juju deploy content-cache-k8s
juju deploy hello-kubecon

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
hello-kubecon/0*      active    idle   10.1.97.193   

This is because the Content-cache-k8s charm isn’t integrated with Hello-kubecon yet.

Relate to the hello-kubecon charm

Provide integration between Content-cache-k8s and Hello-kubecon by running the following juju relate command:

juju relate content-cache-k8s:ingress-proxy hello-kubecon

Run juju status to see that the message has changed:

content-cache-k8s/0*  active    idle   10.1.97.227         Ready
hello-kubecon/0*      active    idle   10.1.97.193

Note: ingress-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

The default hostname for the Hello-kubecon application is hello-kubecon. To be able to browse to this site, that hostname will need to resolve to the IP address of your Ingress. You can achieve this by editing /etc/hosts file and adding the following line:

127.0.0.1 hello-kubecon

After that, visit http://hello-kubecon in a browser and you’ll be presented with the home screen of the Hello-kubecon application.


Help improve this document in the forum (guidelines). Last updated 1 year, 6 months ago.