Discourse

  • By Discourse Charm Maintainers
juju deploy discourse-charmers-discourse-k8s
Show information
You will need Juju 2.9 to be able to run this command. Learn how to upgrade to Juju 2.9.
Channel Version Revision Published Base
latest/stable 28 28 08 Apr 2021
20.04

Platform:

The charm will not function without a connection to a PostgreSQL database and Redis, so you will need to deploy these somewhere.

Deploying Redis to another Juju model on IaaS

Create a suitable model on a different cloud, for example, LXD or OpenStack.

juju switch database
juju deploy cs:~redis-charmers/redis  # Note the IP as ${REDIS_IP}

Then set the appropriate juju config in your k8s model:

juju switch discourse-test
juju config discourse redis_host=${REDIS_IP}

Deploying PostgreSQL to the same model on Kubernetes

To deploy PostgreSQL to the same kubernetes model as Discourse:

juju switch discourse-test
juju deploy cs:~postgresql-charmers/postgresql-k8s postgresql

Then simply use juju relate discourse postgresql:db-admin . This deployment style is recommended for testing purposes only.

Deploying PostgreSQL to another Juju model on IaaS

Cross-model relations are also supported. Create a suitable model on a different cloud, for example, LXD or OpenStack.

juju switch database
juju deploy cs:postgresql
juju offer postgresql:db-admin

In most k8s deployments, traffic to external services from worker pods will be SNATed by some part of the infrastructure. You will need to know what the source addresses or address range is for the next step.

juju switch discourse-test
juju find-offers  # note down offer URL; example used below:
juju relate discourse admin/database.postgresql --via 10.9.8.0/24

(In the case of postgresql, --via is needed so that the charm can configure pga_hba.conf to let the k8s pods connect to the database.)


Help us improve this documentation

Most of this documentation can be collaboratively discussed and changed on the respective topic in the doc category of the Charmhub forum. See the documentation guidelines if you’d like to contribute.

Last updated 7 months ago. Help improve this document in the forum.