Skip to content

Commit edc6419

Browse files
authored
Merge branch 'master' into v9.6-documentation
2 parents f16c19c + d230434 commit edc6419

File tree

1 file changed

+119
-21
lines changed

1 file changed

+119
-21
lines changed

source/install/install-kubernetes.rst

Lines changed: 119 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,74 @@ You'll need a `Kubernetes cluster <https://kubernetes.io/docs/setup/>`__ running
2121
Install the operators
2222
---------------------
2323

24-
Operators are installed using ``kubectl``, and each operator is created in its own namespace. You can install and run multiple Mattermost installations in the same cluster using different namespaces.
24+
Nginx Ingress Controller
25+
~~~~~~~~~~~~~~~~~~~~~~~~
26+
See the `Kubernetes deployment documentation <https://kubernetes.github.io/ingress-nginx/deploy/>`__ for details on installing the NGINX ingress controller in your Kubernetes cluster.
2527

26-
1. Install NGINX ingress controller by following the instructions `here <https://kubernetes.github.io/ingress-nginx/deploy/>`__.
28+
Mattermost Operator
29+
~~~~~~~~~~~~~~~~~~~
2730

28-
2. Install the Mattermost Operator:
31+
There are multiple ways to install the Mattermost Kubernetes Operator. We recommend deploying with Helm, but installation instructions via the Kubernetes CLI can also be found below.
32+
33+
With Helm
34+
^^^^^^^^^
35+
36+
37+
1. Install Helm. We recommend Helm v3.13.0 or later. For installation instructions, see the `Helm quickstart documentation <https://docs.helm.sh/using_helm/#quickstart>`__.
38+
2. Once Helm is installed and initialized, run the following:
39+
40+
.. code-block:: sh
41+
:class: mm-code-block
42+
43+
helm repo add mattermost https://helm.mattermost.com
44+
45+
3. Create a file named ``config.yaml``, then copy and paste the content of `the Mattermost operator file <https://github.com/mattermost/mattermost-helm/blob/master/charts/mattermost-operator/values.yaml>`__ into it.
46+
47+
48+
4. Create a namespace for the Mattermost Operator:
2949

3050
.. code-block:: sh
3151
:class: mm-code-block
3252
3353
kubectl create ns mattermost-operator
3454
35-
kubectl apply -n mattermost-operator -f https://raw.githubusercontent.com/mattermost/mattermost-operator/master/docs/mattermost-operator/mattermost-operator.yaml
55+
5. Install your preferred version of the Mattermost Operator using the following command:
3656

37-
.. tip::
57+
.. code-block:: sh
58+
:class: mm-code-block
59+
60+
helm install <your-release-name> mattermost/mattermost-operator -n <namespace_name>
61+
62+
For example:
63+
64+
.. code-block:: sh
65+
:class: mm-code-block
66+
67+
helm install mattermost-operator mattermost/mattermost-operator -n mattermost-operator
68+
69+
To install with any customized configuration you've made in your ``config.yaml`` file, use the ``-f`` flag:
70+
71+
.. code-block:: sh
72+
:class: mm-code-block
73+
74+
helm install mattermost-operator mattermost/mattermost-operator -n mattermost-operator -f config.yaml
75+
76+
.. tip::
77+
If no version is specified, the latest version of the Mattermost Operator will be installed.
78+
79+
With Kubernetes CLI
80+
^^^^^^^^^^^^^^^^^^^
81+
82+
Operators are installed using ``kubectl``, and each operator is created in its own namespace. You can install and run multiple Mattermost installations in the same cluster using different namespaces.
3883

39-
To install the operators using the Mattermost Operator Helm chart, follow the instructions `here <https://github.com/mattermost/mattermost-helm/tree/master/charts/mattermost-operator>`__. See the `Kubernetes YAML file <https://github.com/mattermost/mattermost-operator/blob/0f2c7b1a182598c4399449eb17a6557187175082/apis/mattermost/v1beta1/mattermost_types.go#L308C2-L309C14>`__ documentation within the ``mattermost`` GitHub repository for details on working with the YAML file.
84+
1. Install the Mattermost Operator:
85+
86+
.. code-block:: sh
87+
:class: mm-code-block
88+
89+
kubectl create ns mattermost-operator
90+
91+
kubectl apply -n mattermost-operator -f https://raw.githubusercontent.com/mattermost/mattermost-operator/master/docs/mattermost-operator/mattermost-operator.yaml
4092
4193
Deploy Mattermost
4294
-----------------
@@ -54,7 +106,7 @@ Deploy Mattermost
54106
stringData:
55107
license: <LICENSE_FILE_CONTENTS>
56108
57-
2. Create an installation manifest file locally in a text editor by copying and pasting contenst from the Mattermost installation manifest, and adjusting fields for your configuration and environment.
109+
2. Create an installation manifest file ``mattermost-installation.yaml`` locally, and open it with a text editor. Copy and paste the YAML structure below, and make any necessary adjustments for your configuration and environment.
58110

59111
.. code-block:: yaml
60112
:class: mm-code-block
@@ -73,7 +125,8 @@ Deploy Mattermost
73125
version: <VERSION_HERE> # Select a recent supported version of Mattermost. Example = 9.3.0
74126
licenseSecret: "" # If you created a license secret in step 1, put the secret name here
75127
76-
Save the file as ``mattermost-installation.yaml``. While recommended file names are provided, your naming conventions may differ.
128+
.. note::
129+
While file names are provided, your file names can be different. The file names in this tutorial are used for clarity and organization.
77130

78131
Some of the most commonly-used fields include:
79132

@@ -83,13 +136,43 @@ Deploy Mattermost
83136
"metadata.name", "The name of your Mattermost as it will be shown in Kubernetes. The shorter the better."
84137
"spec.size", "The size of your installation. This can be '100users', '1000users, '5000users', '10000users', or '25000users'."
85138
"spec.ingress.host", "The DNS for your Mattermost installation."
86-
"spec.version", "The Mattermost version. Refer to `the version archive page <https://docs.mattermost.com/upgrade/version-archive.html>`__ when selecting a mattermost version."
87-
"spec.licenseSecret", "The name of the Kubernetes secret containing your license (e.g. mattermost-license). Required for Enterprise deployments."
139+
"spec.version", "The Mattermost version. Refer to `the version archive page <https://docs.mattermost.com/upgrade/version-archive.html>`__ when selecting a Mattermost version."
140+
"spec.licenseSecret", "The name of the Kubernetes secret containing your license (e.g., mattermost-license). Required for Enterprise deployments."
88141
"spec.mattermostEnv", "List of custom environment variables for the Mattermost instance. Only required when tweaking Mattermost configuration is required."
89-
90-
Additional fields are documented `in the example <https://github.com/mattermost/mattermost-operator/blob/master/docs/examples/mattermost_full.yaml>`__. If you have previous experience with Kubernetes Custom Resources, you can also check the `Custom Resource Definition <https://github.com/mattermost/mattermost-operator/blob/master/config/crd/bases/installation.mattermost.com_mattermosts.yaml>`__.
142+
"spec.image", "Docker image for the Mattermost app servers."
143+
"spec.imagePullPolicy", "Image Pull policy used by Mattermost deployment."
144+
"spec.useServiceLoadBalancer", "Set to true to use AWS or Azure load balancers instead of an NGINX controller."
145+
"spec.serviceAnnotations", "Service annotations to use with AWS or Azure load balancers."
146+
"spec.ingress.enabled", "Indicates if Ingress should be created by Mattermost Operator."
147+
"spec.ingress.annotations", "Custom annotations propagated to Ingress resource."
148+
"spec.ingress.tlsSecret", "Name of a Secret that contains TLS certificates for the ingress."
149+
"spec.database.external.secret", "Name of a Kubernetes secret containing connection string to an external database."
150+
"spec.fileStore.external.url", "External File Storage URL."
151+
"spec.fileStore.external.bucket", "File Storage bucket name."
152+
"spec.fileStore.external.secret", "Name of a Kubernetes secret that contains credentials to external file storage."
153+
"spec.elasticSearch.host", "Elasticsearch hostname."
154+
"spec.elasticSearch.username", "Username to log into Elasticsearch."
155+
"spec.elasticSearch.password", "Password to log into Elasticsearch."
156+
"spec.scheduling.resources", "Resource requests and limits of pod and container (Kubernetes)."
157+
"spec.scheduling.nodeSelector", "Node selector for assigning pods to nodes (Kubernetes)."
158+
"spec.scheduling.affinity", "Affinity and anti-affinity for assigning pods to nodes (Kubernetes)."
159+
160+
More information on these additional fields can be found `in this example <https://github.com/mattermost/mattermost-operator/blob/master/docs/examples/mattermost_full.yaml>`__. If you have previous experience with Kubernetes Custom Resources, you can also check the `Custom Resource Definition <https://github.com/mattermost/mattermost-operator/blob/master/config/crd/bases/installation.mattermost.com_mattermosts.yaml>`__.
161+
162+
3. Create a file ``mattermost-database-secret.yaml`` to house secrets related to your installation's database. The database secret needs to be created in the namespace that will hold the Mattermost installation. The secret should contain the following data:
163+
164+
.. code-block:: yaml
165+
166+
apiVersion: v1
167+
data:
168+
DB_CONNECTION_CHECK_URL: <DB_CONNECTION_CHECK_URL>
169+
DB_CONNECTION_STRING: <DB_CONNECTION_STRING>
170+
MM_SQLSETTINGS_DATASOURCEREPLICAS: <MM_SQLSETTINGS_DATASOURCEREPLICAS>
171+
kind: Secret
172+
metadata:
173+
name: my-postgres-connection
174+
type: Opaque
91175
92-
3. Create external database secret. The database secret needs to be created in the namespace that will hold the Mattermost installation. The secret should contain the following data:
93176
94177
.. csv-table::
95178
:header: "Key", "Description", "Required"
@@ -98,7 +181,7 @@ Deploy Mattermost
98181
"MM_SQLSETTINGS_DATASOURCEREPLICAS", "Connection string to read replicas of the database.", "No"
99182
"DB_CONNECTION_CHECK_URL", "The URL used for checking that the database is accessible.", "No"
100183

101-
Example secret for AWS Aurora compatible with PostgreSQL:
184+
Here's an example of a secret for AWS Aurora with PostgreSQL:
102185

103186
.. code-block:: yaml
104187
:class: mm-code-block
@@ -117,15 +200,27 @@ Deploy Mattermost
117200

118201
For PostgreSQL databases, the connection is checked with `pg_isready <https://www.postgresql.org/docs/9.3/app-pg-isready.html>`__ so the ``DB_CONNECTION_CHECK_URL`` is the same as connection string.
119202

120-
4. Create external filestore secret. The filestore secret needs to be created in the namespace that will hold the Mattermost installation. The secret should contain the following data:
203+
4. Create a file ``mattermost-filestore-secret.yaml`` to house secrets related to your installation's filestore. The filestore secret needs to be created in the namespace that will hold the Mattermost installation. The secret should contain the following data:
204+
205+
.. code-block:: yaml
206+
207+
apiVersion: v1
208+
data:
209+
accesskey: <accesskey>
210+
secretkey: <secretkey>
211+
kind: Secret
212+
metadata:
213+
name: <name>
214+
type: Opaque
121215
122216
.. csv-table::
123217
:header: "Key", "Description", "Required"
124218

125219
"accesskey", "Filestore access key.", "Yes"
126220
"secretkey", "Filestore secret key.", "Yes"
221+
"metadata.name": "The name of the secret.", "Yes"
127222

128-
Example secret for AWS S3:
223+
Here's an example of a secret for Amazon S3:
129224

130225
.. code-block:: yaml
131226
:class: mm-code-block
@@ -141,7 +236,10 @@ Deploy Mattermost
141236
142237
5. Adjust installation manifest.
143238

144-
To instruct Mattermost Operator to use the external database, modify Mattermost manifest by adding the following fields:
239+
.. tip::
240+
For more information on where in the YAML structure to make the below updates, reference the supported fields in step 2.
241+
242+
In order for the Mattermost Operator to utilize your external database, you must modify the Mattermost manifest (inside the ``mattermost-installation.yaml`` file) by adding the following fields:
145243

146244
.. code-block:: yaml
147245
:class: mm-code-block
@@ -150,9 +248,9 @@ Deploy Mattermost
150248
...
151249
database:
152250
external:
153-
secret: my-postgres-connection
251+
secret: <secret name> # The name of the secret containing the database connection string. You set this value in step 3. Example = my-postgres-connection
154252
155-
To instruct Mattermost Operator to use the external filestore, modify Mattermost manifest by adding the following fields:
253+
Now, point the Mattermost Operator at your external filestore. Modify the Mattermost manifest (inside the ``mattermost-installation.yaml`` file) by adding the following fields:
156254

157255
.. code-block:: yaml
158256
:class: mm-code-block
@@ -163,7 +261,7 @@ Deploy Mattermost
163261
external:
164262
url: s3.amazonaws.com
165263
bucket: my-s3-bucket
166-
secret: my-s3-iam-access-key
264+
secret: <secret name> # The name of the secret containing the filestore access and secret keys. You set this value in step 4. Example = my-s3-iam-access-key
167265
168266
Additionally when using Amazon S3, set the ``MM_FILESETTINGS_AMAZONS3SSE`` and ``MM_FILESETTINGS_AMAZONS3SSL`` environment variables to ``true``:
169267

@@ -179,7 +277,7 @@ Deploy Mattermost
179277
- name: MM_FILESETTINGS_AMAZONS3SSL
180278
value: "true"
181279
182-
Example Mattermost manifest configured with both external databases and filestore:
280+
If you've configured your Mattermost Enterprise Edition installation manifest with a custom PostgreSQL database, and an Amazon S3 filestore, your installation manifest should look something like this:
183281

184282
.. code-block:: yaml
185283
:class: mm-code-block

0 commit comments

Comments
 (0)