
Juju is an open source application orchestration engine that enables any application operation (deployment, integration, lifecycle management) on any infrastructure (Kubernetes or otherwise) at any scale (development or production) in the same easy way (typically, one line of code), through special operators called ‘charms’.
Let's use Juju to deploy, configure, and integrate some Kubernetes charms:
You will need a cloud and Juju. The quickest way is to use a Multipass VM launched with the charm-dev
blueprint.
Install Multipass. On Linux:
sudo snap install multipass
Use Multipass to launch an Ubuntu VM with the charm-dev
blueprint:
multipass launch --cpus 4 --memory 8G --disk 50G --name tutorial-vm charm-dev
Open a shell into the VM:
multipass shell tutorial-vm
Verify that you have Juju and two localhost clouds:
juju clouds
Bootstrap a Juju controller into the MicroK8s cloud:
juju bootstrap microk8s tutorial-controller
Add a workspace, or 'model':
juju add-model tutorial-model
Deploy Mattermost:
juju deploy mattermost-k8s
See more: Charmhub |
mattermost-k8s
Deploy PostgreSQL:
juju deploy postgresql-k8s --channel 14/stable --trust
See more: Charmhub |
postgresql-k8s
Enable security in your PostgreSQL deployment:
juju deploy tls-certificates-operator
juju config tls-certificates-operator generate-self-signed-certificates="true" ca-common-name="Test CA"
juju integrate postgresql-k8s tls-certificates-operator
Integrate Mattermost with PostgreSQL:
juju integrate mattermost-k8s postgresql-k8s:db
Watch your deployment come to life:
watch -n 1 -c juju status --color
Use the --relations
flag to view more information about your integrations.
Use the --storage
flag to view more information about your storages.
When everything is in active
or idle
status, note the IP address and port of Mattermost and pass them to curl
:
curl <IP address>:<port>/api/v4/system/ping
You should see the output below:
{"AndroidLatestVersion":"","AndroidMinVersion":"","IosLatestVersion":"","IosMinVersion":"","status":"OK"}
You now have a Kubernetes deployment consisting of a Mattermost backed by PosgreSQL with TLS-encrypted traffic!
Delete your Multipass VM:
multipass delete --purge tutorial-vm
Uninstall Multipass. On Linux:
snap remove multipass
- Read the docs.
- Read our Code of conduct and join our chat and forum or open an issue.
- Read our CONTRIBUTING guide and contribute!