Merge ~jk0ne/charm-k8s-discourse/+git/charm-k8s-discourse:master into charm-k8s-discourse:master

Proposed by Jay Kuri
Status: Merged
Approved by: Tom Haddon
Approved revision: b07e944954a621333f38f9bfd792a2ed9cf7da8d
Merged at revision: a5ef3d4ed786b2eb953e2fd7c26b3cfc4ce1fc32
Proposed branch: ~jk0ne/charm-k8s-discourse/+git/charm-k8s-discourse:master
Merge into: charm-k8s-discourse:master
Diff against target: 102 lines (+82/-9)
1 file modified
README.md (+82/-9)
Reviewer Review Type Date Requested Status
Tom Haddon Approve
Canonical IS Reviewers Pending
Discourse Charm Maintainers Pending
Review via email: mp+392731@code.launchpad.net

Commit message

Update Readme.md with useful content.

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Tom Haddon (mthaddon) wrote :

Lgtm, thx

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision a5ef3d4ed786b2eb953e2fd7c26b3cfc4ce1fc32

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/README.md b/README.md
2index 7463e80..fcaa8ea 100644
3--- a/README.md
4+++ b/README.md
5@@ -1,15 +1,88 @@
6-# Discourse k8s charm
7-
8-A juju operator charm for a Kubernetes deployment of Discourse.
9+# Discourse Charm
10
11 ## Overview
12
13-This is a k8s charm and can only be deployed to a k8s cloud via
14-juju that has been attached to a k8s cloud.
15+This charm deploys the Discourse discussion forum. Discourse is the 100% open
16+source discussion platform built for the next decade of the Internet. Use it
17+as a mailing list, discussion forum, long-form chat room, and more!
18+
19+This is a k8s workload charm and can only be deployed to to a Juju k8s
20+cloud, attached to a controller using `juju add-k8s`.
21+
22+## Usage
23+
24+See config option descriptions in config.yaml.
25+
26+After deploying this charm, you will need to create a relation to a PostgreSQL
27+database to provide backend storage for Discourse. You will also need to
28+deploy Redis and set your configuration to point to it.
29+
30+### Static content and uploads
31+
32+Discourse supports post uploads. When using this charm you need to make
33+use of the S3 storage option built in to discourse for file uploads.
34+
35+You do this by accessing the Files option in the discourse settings
36+web admin panel. Enter your S3 options here and check the 'enable s3
37+uploads' option. This will push any uploads made into the S3 system and
38+will serve them from there as well, eliminating the need for any persistent
39+local storage.
40+
41+### Developing
42+
43+Notes for deploying a test setup locally using microk8s:
44+
45+ sudo snap install juju --classic
46+ sudo snap install juju-wait --classic
47+ sudo snap install microk8s --classic
48+ sudo snap alias microk8s.kubectl kubectl
49+ sudo snap install charmcraft
50+ git clone https://git.launchpad.net/charm-k8s-discourse
51+ cd charm-k8s-discourse
52+ make discourse.charm
53+
54+ microk8s.reset # Warning! Clean slate!
55+ microk8s.enable dns dashboard registry storage
56+ microk8s.status --wait-ready
57+ microk8s.config | juju add-k8s myk8s --client
58+
59+ # Build your Discourse image
60+ make build-image
61+ docker push localhost:32000/discourse
62+
63+ juju bootstrap myk8s
64+ juju add-model discourse-test
65+ juju deploy ./discourse.charm --config discourse_image=localhost:32000/discourse:latest discourse
66+ juju wait
67+ juju status
68+
69+The charm will not function without a database, so you will need to
70+deploy `cs:postgresql` somewhere. You will also need a redis application
71+to connect to, such as `cs:~redis-charmers/redis`.
72+
73+If postgresql is deployed in the same model you plan to use for
74+discourse, simply use `juju relate discourse postgresql:db`. (This
75+deployment style is recommended for testing purposes only.)
76+
77+Cross-model relations are also supported. Create a suitable model on
78+a different cloud, for example, LXD or OpenStack.
79+
80+ juju switch database
81+ juju deploy cs:postgresql
82+ juju deploy cs:~redis-charmers/redis # Use the IP address for the `redis_host` config option to discourse
83+ juju offer postgresql:db
84+
85+In most k8s deployments, traffic to external services from worker pods
86+will be SNATed by some part of the infrastructure. You will need to
87+know what the source addresses or address range is for the next step.
88+
89+ juju switch discourse-test
90+ juju find-offers # note down offer URL; example used below:
91+ juju relate discourse admin/database.postgresql --via 10.9.8.0/24
92
93-To deploy this charm, run:
94+(In the case of postgresql, `--via` is needed so that the charm can
95+configure `pga_hba.conf` to let the k8s pods connect to the database.)
96
97- charmcraft build
98- juju deploy discourse.charm
99+## Testing
100
101-... More to come...
102+Just run `make test`.

Subscribers

People subscribed via source and target branches