Merge ~mthaddon/charm-k8s-mattermost/+git/charm-k8s-mattermost:user-focused into charm-k8s-mattermost:master

Proposed by Tom Haddon
Status: Merged
Approved by: Tom Haddon
Approved revision: 76abad09724b19caa856d2287fae65db3983d446
Merged at revision: 8600461537ee3410944b52ec841ff0c53fa58f25
Proposed branch: ~mthaddon/charm-k8s-mattermost/+git/charm-k8s-mattermost:user-focused
Merge into: charm-k8s-mattermost:master
Diff against target: 198 lines (+22/-131)
3 files modified
README.md (+18/-128)
config.yaml (+3/-1)
metadata.yaml (+1/-2)
Reviewer Review Type Date Requested Status
Thomas Cuthbert (community) Approve
Canonical IS Reviewers Pending
Review via email: mp+395208@code.launchpad.net

Commit message

Make the README more end-user focused, and switch to a specific image version, clarifying how upgrades are initiated

Description of the change

Make the README more end-user focused, and switch to a specific image version, clarifying how upgrades are initiated

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
Thomas Cuthbert (tcuthbert) wrote :

LGTM +1

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

Change successfully merged at revision 8600461537ee3410944b52ec841ff0c53fa58f25

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 b3e6cbe..0d9a28f 100644
3--- a/README.md
4+++ b/README.md
5@@ -1,20 +1,22 @@
6-# Mattermost charm
7+# Mattermost Operator
8
9-A juju charm deploying Mattermost, using [a custom-built built image](https://code.launchpad.net/~mattermost-charmers/charm-k8s-mattermost/+git/mattermost-k8s-image-builder),
10-configurable to use a PostgreSQL backend.
11+A Juju charm deploying and managing Mattermost on Kubernetes, configurable to use a PostgreSQL backend.
12
13 ## Overview
14
15-This is a k8s workload charm and can only be deployed to to a Juju k8s
16-cloud, attached to a controller using `juju add-k8s`.
17-
18-When visiting a fresh deployment, you will first be asked to create an admin
19-account. Further accounts must be created using this admin account, or by
20-setting up an external authentication source, such as SAML.
21-
22+Mattermost offers both [a Team Edition and an Enterprise Edition](https://mattermost.com/pricing-feature-comparison/).
23+This charm supports both, with the default image deploying the Team Edition. Supported
24+features include authentication via SAML, Push Notifications, clustering,
25+the storage of images and attachments in S3, and a Prometheus exporter for
26+performance monitoring. This charm also offers seamless Mattermost version
27+upgrades, initiated by switching to an image with a newer version of
28+Mattermost than the one currently deployed.
29
30 ## Usage
31
32+For details on using Kubernetes with Juju [see here](https://juju.is/docs/kubernetes), and for
33+details on using Juju with MicroK8s for easy local testing [see here](https://juju.is/docs/microk8s-cloud).
34+
35 To get started deploying the charm in a test environment within a Juju
36 Kubernetes model:
37
38@@ -23,122 +25,10 @@ Kubernetes model:
39 juju add-relation mattermost postgresql:db
40 juju expose mattermost
41
42-## Local Development
43-
44-Notes for deploying a test setup locally using MicroK8s:
45-
46- sudo snap install juju --classic
47- sudo snap install juju-wait --classic
48- sudo snap install microk8s --classic
49- sudo snap alias microk8s.kubectl kubectl
50- sudo snap install charmcraft
51- git clone https://git.launchpad.net/charm-k8s-mattermost
52- make -C charm-k8s-mattermost mattermost.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- juju bootstrap myk8s
60- juju add-model mattermost-test
61- juju deploy ./charm-k8s-mattermost/mattermost.charm mattermost
62- juju wait
63- juju status
64-
65-The charm will not function without a database, so you will need to
66-deploy `cs:postgresql` somewhere.
67-
68-If PostgreSQL is deployed in the same model you plan to use for
69-Mattermost, simply use `juju relate mattermost postgresql:db`. (This
70-deployment style is recommended for testing purposes only.)
71-
72-Cross-model relations are also supported. Create a suitable model on
73-a different cloud, for example, LXD or OpenStack.
74-
75- juju switch database
76- juju deploy cs:postgresql
77- juju offer postgresql:db
78-
79-In most k8s deployments, traffic to external services from worker pods
80-will be SNATed by some part of the infrastructure. You will need to
81-know what the source addresses or address range is for the next step.
82-
83- juju switch mattermost-test
84- juju find-offers # note down offer URL; example used below:
85- juju relate mattermost admin/database.postgresql --via 10.9.8.0/24
86-
87-(In the case of PostgreSQL, `--via` is needed so that the charm can
88-configure `pga_hba.conf` to let the k8s pods connect to the database.)
89-
90-## Using a Custom Image
91-
92- git clone https://git.launchpad.net/~mattermost-charmers/charm-k8s-mattermost/+git/image-build mattermost-image-build
93- docker build -t localhost:32000/mattermost ./mattermost-image-build
94- docker push localhost:32000/mattermost
95-
96-Then, to use your new image, either replace the `deploy` step above with
97-
98- juju deploy ./charm-k8s-mattermost/mattermost.charm --config mattermost_image_path=localhost:32000/mattermost:latest mattermost
99-
100-or, if you've already deployed Mattermost:
101-
102- juju config mattermost mattermost_image_path=localhost:32000/mattermost:latest
103-
104-## Authentication
105-
106-This charm supports configuring [Ubuntu SSO](https://login.ubuntu.com)
107-as the authentication method. This requires the following:
108-
109- * a Mattermost Enterprise Edition licence to be obtained and activated
110- * a SAML config for the Mattermost installation to be added to `login.ubuntu.com`
111- * the SAML config will need to have a new certificate generated (refer to "Canonical RT#107985" when requesting this)
112- * this is because the default certificate available via the [SAML metadata URL](https://login.ubuntu.com/+saml/metadata) has expired
113- * the new certificate to be installed in the Mattermost database (see below)
114-
115-### Installing the SAML Identity Provider Certificate
116-
117-Invoke `psql` against the mattermost database on the current primary
118-and use the following query to install the certificate:
119-
120- INSERT INTO configurationfiles (name, createat, updateat, data)
121- VALUES ('saml-idp.crt', (extract(epoch from now()) * 1000)::bigint ,(extract(epoch from now()) * 1000)::bigint, $$-----BEGIN CERTIFICATE-----
122- [...]
123- -----END CERTIFICATE-----$$);
124-
125-## Push Notifications
126-
127-For full information on selecting a push notification server, please
128-[consult the Mattermost documentation](https://docs.mattermost.com/administration/config-settings.html#push-notification-server).
129-
130-## Allowing All Users to Create Personal Access Tokens
131-
132-Setting the "Enable Personal Access Tokens" option in the System
133-Console's "Integrations" panel (or via the `use_canonical_defaults`
134-charm setting) does not give all users the ability to use them.
135-
136-To give access to all new users, add this database trigger:
137-
138- BEGIN;
139- CREATE OR REPLACE FUNCTION grant_system_user_access_token_role() RETURNS TRIGGER AS $$
140- BEGIN
141- IF position('system_user_access_token' in NEW.roles) = 0 THEN
142- NEW.roles = NEW.roles || ' system_user_access_token';
143- END IF;
144- RETURN NEW;
145- END;
146- $$
147- LANGUAGE PLPGSQL;
148-
149- DROP TRIGGER IF EXISTS before_insert_system_user_grant_system_user_access_token ON users;
150- CREATE TRIGGER before_insert_system_user_grant_system_user_access_token
151- BEFORE INSERT ON users
152- FOR EACH ROW WHEN ( NEW.roles = 'system_user' )
153- EXECUTE FUNCTION grant_system_user_access_token_role();
154- COMMIT;
155-
156-And to update all existing users, run this query:
157+Once the deployment has completed and the "mattermost" workload state in `juju
158+status` has changed to "active" you can visit http://${mattermost_ip}:8065 in a browser and log in to
159+your Mattermost instance, and you'll be presented with a screen to create an
160+initial admin account. Further accounts must be created using this admin account, or by
161+setting up an external authentication source, such as SAML.
162
163- UPDATE users
164- SET roles = 'system_user system_user_access_token'
165- WHERE roles = 'system_user';
166+For further details, [see here](https://charmhub.io/mattermost/docs).
167diff --git a/config.yaml b/config.yaml
168index 34ac0a8..d25ac01 100644
169--- a/config.yaml
170+++ b/config.yaml
171@@ -39,8 +39,10 @@ options:
172 description: |
173 The location of the image to use, e.g. "registry.example.com/mattermost:v1".
174
175+ Switching to a newer image version will initiate an upgrade of Mattermost.
176+
177 This setting is required.
178- default: mattermostcharmers/mattermost:edge
179+ default: mattermostcharmers/mattermost:5.29.0
180 mattermost_image_username:
181 type: string
182 description: |
183diff --git a/metadata.yaml b/metadata.yaml
184index ad496a5..75f7830 100644
185--- a/metadata.yaml
186+++ b/metadata.yaml
187@@ -1,10 +1,9 @@
188 name: mattermost
189-summary: Mattermost charm
190+summary: Mattermost is a flexible, open source messaging platform that enables secure team collaboration.
191 docs: https://discourse.charmhub.io/t/mattermost-documentation-overview/3758
192 maintainers:
193 - launchpad.net/~canonical-is-sre
194 description: |
195- A charm which deploys Mattermost on kubernetes.
196 Mattermost is a flexible, open source messaging platform that enables
197 secure team collaboration.
198 https://mattermost.com

Subscribers

People subscribed via source and target branches