Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
[stable/mattemost-team-edition] Add initial charts for Mattermost Tea…
Browse files Browse the repository at this point in the history
…m Edition (#5987)

* Add initial charts for Mattermost Team Edition

Signed-off-by: cpanato <ctadeu@gmail.com>

* update based on feedback

Signed-off-by: cpanato <ctadeu@gmail.com>

* update dependencies

Signed-off-by: cpanato <ctadeu@gmail.com>
  • Loading branch information
cpanato authored and k8s-ci-robot committed Sep 19, 2018
1 parent 5a97849 commit ba3b3d8
Show file tree
Hide file tree
Showing 18 changed files with 822 additions and 0 deletions.
24 changes: 24 additions & 0 deletions stable/mattermost-team-edition/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj

# OWNERS file for Kubernetes
OWNERS
19 changes: 19 additions & 0 deletions stable/mattermost-team-edition/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
description: Mattermost Team Edition server.
name: mattermost-team-edition
version: 1.0.0
appVersion: 5.2.1
keywords:
- mattermost
- communication
- team collaboration
home: https://mattermost.com
icon: http://www.mattermost.org/wp-content/uploads/2016/04/icon.png
source:
- https://github.com/mattermost/mattermost-server
- https://github.com/mattermost/mattermost-kubernetes
maintainers:
- name: cpanato
email: carlos@mattermost.com
- name: jwilander
email: joram@mattermost.com
6 changes: 6 additions & 0 deletions stable/mattermost-team-edition/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
approvers:
- cpanato
- jwilander
reviewers:
- cpanato
- jwilander
120 changes: 120 additions & 0 deletions stable/mattermost-team-edition/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Mattermost Team Edition

[Mattermost](https://mattermost.com/) is a hybrid cloud enterprise messaging workspace that brings your messaging and tools together to get more done, faster.

## TL;DR;

```bash
$ helm install stable/mattermost-team-edition \
--set mysql.mysqlUser=sampleUser \
--set mysql.mysqlPassword=samplePassword \
```

## Introduction

This chart creates a [Mattermost Team Edition](https://mattermost.com/)deployment on a [Kubernetes](http://kubernetes.io)
cluster using the [Helm](https://helm.sh) package manager.

## Prerequisites

- Kubernetes 1.8+ with Beta APIs enabled

## Installing the Chart

To install the chart with the release name `my-release`:

```bash
$ helm install --name my-release stable/mattermost-team-edition
```

The command deploys Mattermost on the Kubernetes cluster in the default configuration. The [configuration](#configuration)
section lists the parameters that can be configured during installation.

## Uninstalling the Chart

To uninstall/delete the `my-release` deployment:

```bash
$ helm delete my-release
```
The command removes all the Kubernetes components associated with the chart and deletes the release.

## Configuration

The following table lists the configurable parameters of the Mattermost Team Edition chart and their default values.

Parameter | Description | Default
--- | --- | ---
`image.repository` | container image repository | `mattermost/mattermost-team-edition`
`image.tag` | container image tag | `5.2.1`
`config.SiteUrl` | The URL that users will use to access Mattermost. ie `https://mattermost.mycompany.com` | ``
`config.SiteName` | Name of service shown in login screens and UI | `Mattermost`
`config.FilesAccessKey` | The AWS Access Key, if you want store the files on S3 | ``
`config.FilesSecretKey` | The AWS Secret Key | ``
`config.FileBucketName` | The S3 bucket name | ``
`config.SMTPHost` | Location of SMTP email server | ``
`config.SMTPPort` | Port of SMTP email server | ``
`config.SMTPUsername` | The username for authenticating to the SMTP server | ``
`config.SMTPPassword` | The password associated with the SMTP username | ``
`config.FeedbackEmail` | Address displayed on email account used when sending notification emails from Mattermost system | ``
`config.FeedbackName` | Name displayed on email account used when sending notification emails from Mattermost system | ``
`ingress.enabled` | if `true`, an ingress is created | `false`
`ingress.hosts` | a list of ingress hosts | `[mattermost.example.com]`
`ingress.tls` | a list of [IngressTLS](https://v1-8.docs.kubernetes.io/docs/api-reference/v1.8/#ingresstls-v1beta1-extensions) items | `[]`
`mysql.mysqlRootPassword` | Root Password for Mysql (Opcional) | ""
`mysql.mysqlUser` | Username for Mysql (Required) | ""
`mysql.mysqlPassword` | User Password for Mysql (Required) | ""
`mysql.mysqlDatabase` | Database name (Required) | "mattermost"

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

```bash
$ helm install --name my-release \
--set image.tag=release-5.2.1 \
--set mysql.mysqlUser=sampleUser \
--set mysql.mysqlPassword=samplePassword \
stable/mattermost-team-edition
```

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

```bash
$ helm install --name my-release -f values.yaml stable/mattermost-team-edition
```

### External Databases
There is an option to use external database services (PostgreSQL or MySQL) for your Mattermost installation.
If you use an external Database you will need to disable the MySQL chart in the `values.yaml`

```Bash
mysql:
enabled: false
```

#### PostgreSQL
To use an external **PostgreSQL**, You need to set Mattermost **externalDB** config

**IMPORTANT:** Make sure the DB is already created before deploying Mattermost services

```Bash
externalDB:
enabled: true
externalDriverType: "postgres"
externalConnectionString: "postgres://<USERNAME>:<PASSWORD>@<HOST>:5432/<DATABASE_NAME>?sslmode=disable&connect_timeout=10"
```

#### MySQL
To use an external **MySQL**, You need to set Mattermost **externalDB** config

**IMPORTANT:** Make sure the DB is already created before deploying Mattermost services

```Bash
externalDB:
enabled: true
externalDriverType: "mysql"
externalConnectionString: "<USERNAME>:<PASSWORD>@tcp(<HOST>:3306)/<DATABASE_NAME>?charset=utf8mb4,utf8&readTimeout=30s&writeTimeout=30s"
```

#### Limitations

For the Team Edition you can have just one replica running.
6 changes: 6 additions & 0 deletions stable/mattermost-team-edition/ci/default-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
mysql:
enabled: true
mysqlRootPassword: "rootpassord"
mysqlUser: "mmuser"
mysqlPassword: "mmpassword"
mysqlDatabase: mattermost
6 changes: 6 additions & 0 deletions stable/mattermost-team-edition/requirements.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: mysql
repository: https://kubernetes-charts.storage.googleapis.com
version: 0.10.1
digest: sha256:be368592f2a1722d1b90e6881e2d381b47d674d1f76c50ed85b27cfb00dcda35
generated: 2018-09-14T14:08:32.750548865+02:00
5 changes: 5 additions & 0 deletions stable/mattermost-team-edition/requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dependencies:
- name: mysql
version: 0.10.1
repository: https://kubernetes-charts.storage.googleapis.com
condition: mysql.enabled
27 changes: 27 additions & 0 deletions stable/mattermost-team-edition/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
You can easily connect to the remote instance from your browser. Forward the webserver port to localhost:8065

- kubectl port-forward --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "mattermost-team-edition.fullname" . }},release={{ .Release.Name }}" -o jsonpath='{ .items[0].metadata.name }') 8080:8065

{{ if .Values.ingress.enabled }}

Mattermost will be available at the URL, if you setup the nginx-ingress or other type of ingress:

{{ if .Values.ingress.tls }}
{{ range .Values.ingress.hosts }}
https://{{ . }}
{{ end }}

{{ else }}

{{ range .Values.ingress.hosts }}
http://{{ . }}
{{ end }}

{{ end }}

{{ else }}

To expose Mattermost via an Ingress you need to set host and enable ingress.

helm install --set host=mattermost.yourdomain.com --set ingress.enabled=true stable/mattermost-team-edition
{{ end }}
32 changes: 32 additions & 0 deletions stable/mattermost-team-edition/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "mattermost-team-edition.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "mattermost-team-edition.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "mattermost-team-edition.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
Loading

0 comments on commit ba3b3d8

Please sign in to comment.