Charmed PostgreSQL VM

Channel Revision Published Runs on
latest/stable 345 09 Nov 2023
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04 Ubuntu 14.04
latest/stable 239 09 Feb 2022
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04 Ubuntu 14.04
latest/stable 226 01 Apr 2021
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04 Ubuntu 14.04
14/stable 468 11 Sep 2024
Ubuntu 22.04
14/stable 467 11 Sep 2024
Ubuntu 22.04
14/candidate 468 02 Sep 2024
Ubuntu 22.04
14/candidate 467 02 Sep 2024
Ubuntu 22.04
14/beta 516 19 Nov 2024
Ubuntu 22.04
14/beta 515 19 Nov 2024
Ubuntu 22.04
14/edge 518 19 Nov 2024
Ubuntu 22.04
14/edge 517 19 Nov 2024
Ubuntu 22.04
juju deploy postgresql --channel 14/edge
Show information

Platform:

Ubuntu
22.04 20.04 18.04 16.04 14.04

How to deploy on Sunbeam

Duration : Up to 60 minutes depending on internet download speed.

This guide goes through the steps for setting up Sunbeam and deploying Charmed PostgreSQL.

Prerequisites

  • A physical or virtual machine running Ubuntu 22.04+
    • If you’d like to follow this guide in an isolated test environment, you can launch a Multipass instance.
  • Hardware requirements depend on planned deployment size.
    • Recommended: 8 CPU cores, 32GB RAM, 100GB of storage
    • Minimum: See the requirements listed in the Sunbeam documentation

Steps


Install and bootstrap Sunbeam

Follow the official OpenStack guide: Single-node deployment.

Pay attention to the Caution and Note sections - the /etc/hosts will require a manual fqdn fix.

Enable OpenStack Images Auto-sync

Follow the official Images Sync guide to enable auto-sync and wait for the image 22.04 to be downloaded.

Set up Juju inside an OpenStack bastion

Follow the MicroStack guide Manage workloads with Juju from the beginning, and stop after the section “Create a Juju controller”.

To summarize, the relevant sections are:

  • Set up the bastion
  • Install and configure the Juju client
  • Create a Juju controller

Deploy Charmed PostgreSQL

Add a model if you don’t have one already, and deploy a PostgreSQL cluster. Use the -n flag to specify number of units.

juju add-model postgresql
juju deploy postgresql --base ubuntu@22.04 -n 3

Sample output of juju status --watch 1s:

Model       Controller     Cloud/Region       Version  SLA          Timestamp
postgresql  my-controller  sunbeam/RegionOne  3.5.4    unsupported  19:42:44Z

App         Version  Status  Scale  Charm       Channel    Rev  Exposed  Message
postgresql  14.12    active      3  postgresql  14/stable  468  no       

Unit           Workload  Agent  Machine  Public address   Ports     Message
postgresql/0*  active    idle   0        192.168.122.211  5432/tcp  Primary
postgresql/1   active    idle   1        192.168.122.226  5432/tcp  
postgresql/2   active    idle   2        192.168.122.14   5432/tcp  

Machine  State    Address          Inst id                               Base          AZ    Message
0        started  192.168.122.211  3f0a331c-bc08-4bae-af22-44087a7b74d6  ubuntu@22.04  nova  ACTIVE
1        started  192.168.122.226  e6e908f8-0da1-4440-9bbd-9f1c1bc780df  ubuntu@22.04  nova  ACTIVE
2        started  192.168.122.14   6f9ad7cd-2a9d-435e-a6d8-3e39bf2218cd  ubuntu@22.04  nova  ACTIVE

(Optional) Access the OpenStack dashboard

Follow the official guide: Accessing the OpenStack dashboard.

When using a Multipass VM, you may need to manually route OpenStack IPs. For example:

sudo ip route add 10.10.10.0/24 via 10.76.203.210 

where 10.76.203.210 is the IP of the Multipass VM and 10.10.10.0 is the network returned by sunbeam dashboard-url.

The image below is an example of the OpenStack dashboard view (bastion + juju controller + 3 postgresql nodes):

To learn more about deploying and operating PostgreSQL, see the Charmed PostgreSQL tutorial.