Comment 14 for bug 2013084

Revision history for this message
Andreas Hasenack (ahasenack) wrote (last edit ):

Ignore microk8s, it's not necessary for this.

These were my steps:
- create jammy VM. I used 2Gb of RAM, and 20GB of disk
ubuntu@j-pgsql:~$ free -h
               total used free shared buff/cache available
Mem: 1.9Gi 175Mi 1.2Gi 1.0Mi 572Mi 1.6Gi
Swap: 0B 0B 0B
ubuntu@j-pgsql:~$ df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 198M 1.1M 197M 1% /run
/dev/vda1 20G 1.7G 18G 9% /
tmpfs 988M 0 988M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/vda15 105M 6.1M 99M 6% /boot/efi
tmpfs 198M 4.0K 198M 1% /run/user/1000

Then:
ubuntu@j-pgsql:~$ sudo lxd init --auto
ubuntu@j-pgsql:~$ lxc network set lxdbr0 ipv6.address none
ubuntu@j-pgsql:~$ sudo snap install juju --classic
juju (2.9/stable) 2.9.43 from Canonical✓ installed

$ juju clouds
Since Juju 2 is being run for the first time, it has downloaded the latest public cloud information.
Only clouds with registered credentials are shown.
There are more clouds, use --all to see them.
You can bootstrap a new controller using one of these clouds...

Clouds available on the client:
Cloud Regions Default Type Credentials Source Description
localhost 1 localhost lxd 0 built-in LXD Container Hypervisor

Now bootstrap (I didn't give the model a name, i.e., no "tutorial-controller". That doesn't matter):
(this takes a few minutes)

ubuntu@j-pgsql:~$ juju bootstrap localhost
Creating Juju controller "localhost-localhost" on localhost/localhost
Looking for packaged Juju agent version 2.9.43 for amd64
Located Juju agent version 2.9.43-ubuntu-amd64 at https://streams.canonical.com/juju/tools/agent/2.9.43/juju-2.9.43-linux-amd64.tgz
To configure your system to better support LXD containers, please see: https://linuxcontainers.org/lxd/docs/master/explanation/performance_tuning/
Launching controller instance(s) on localhost/localhost...
 - juju-3b04ae-0 (arch=amd64)
Installing Juju agent on bootstrap instance
Fetching Juju Dashboard 0.8.1
Waiting for address
Attempting to connect to 10.154.44.244:22
Connected to 10.154.44.244
Running machine configuration script...
Bootstrap agent now started
Contacting Juju controller at 10.154.44.244 to verify accessibility...

Bootstrap complete, controller "localhost-localhost" is now available
Controller machines are in the "controller" model
Initial model "default" added

Now we are ready to deploy apps. Let's deploy postgresql in HA mode:

$ juju deploy postgresql -n 2
Located charm "postgresql" in charm-hub, revision 288
Deploying "postgresql" from charm-hub charm "postgresql", revision 288 in channel 14/stable on jammy

And monitor its progress with:
ubuntu@j-pgsql:~$ juju status --watch 5s
Model Controller Cloud/Region Version SLA Timestamp
default localhost-localhost localhost/localhost 2.9.43 unsupported 12:38:26Z

App Version Status Scale Charm Channel Rev Exposed Message
postgresql waiting 0/2 postgresql 14/stable 288 no waiting for machine

Unit Workload Agent Machine Public address Ports Message
postgresql/0 waiting allocating 0 waiting for machine
postgresql/1 waiting allocating 1 waiting for machine

Machine State Address Inst id Series AZ Message
0 pending pending jammy acquiring LXD image
1 pending pending jammy Retrieving image: rootfs: 6% (782.72kB/s)

After the workload in both units is active, and nothing else is going on in the status output, you can do "juju ssh <unitname>" to enter a unit. For example, "juju ssh postgresql/1" or "juju ssh postgresql/0".