How to deploy on Canonical K8s

k8s

Canonical Kubernetes is a Kubernetes service built on Ubuntu and optimised for most major public clouds.

Prerequisites

  • A physical or virtual machine running Ubuntu 24.04+

  • Juju 3.6+ installed via snap


Install Canonical Kubernetes

Follow the instructions in the official Canonical Kubernetes documentation

Once Canonical K8s is up and running, enable local storage (or any another persistent volume provider, to be used by Juju storage later):

user@host:~$
sudo k8s enable local-storage
user@host:~$
sudo k8s status --wait-ready

See also: Canonical Kubernetes | Enable local storage

Bootstrap Juju on Canonical K8s

Add a Juju K8s cloud:

user@host:~$
juju add-k8s ck8s --client --context-name="k8s"

Bootstrap a Juju controller:

user@host:~$
juju bootstrap ck8s

Deploy Charmed PostgreSQL

Create a Juju model:

user@host:~$
juju add-model <model-name>

Deploy the PostgreSQL charm for K8s:

user@host:~$
juju deploy postgresql-k8s --channel 16/stable --trust

For more information, see the official Canonical Kubernetes documentation