/mattermost-cloud

Tools and services for running Mattermost Private Cloud :cloud:

Primary LanguageGoApache License 2.0Apache-2.0

Mattermost Private Cloud CircleCI branch

Mattermost Private Cloud is a SaaS offering meant to smooth and accelerate the customer journey from trial to full adoption. There is a significant amount of friction for a customer to set up a trial of Mattermost, and even more friction to run an extended length proof of concept. Both require hardware and technical personnel resources that create a significant barrier to potential customers. Mattermost Cloud aims to remove this barrier by providing a service to provision and host Mattermost instances that can be used by customers who have no technical experience. This will accelerate the customer journey to a full adoption of Mattermost either in the form of moving to a self-hosted instance or by continuing to use the cloud service.

Read more about the Mattermost Private Cloud Architecture.

Other Resources

This repository houses the open-source components of Mattermost Private Cloud. Other resources are linked below:

Get Involved

Developing

Environment Setup

  1. Install Go
  2. Install Terraform version v0.11.14
  3. Install kops version 1.15.X
  4. Install Helm version 2.14.X
  5. Install kubectl
  6. Specify the region in your AWS config, e.g. ~/.aws/config:
[profile mm-cloud]
region = us-east-1
  1. Generate an AWS Access and Secret key pair, then export them in your bash profile:
export AWS_ACCESS_KEY_ID=YOURACCESSKEYID
export AWS_SECRET_ACCESS_KEY=YOURSECRETACCESSKEY
export AWS_PROFILE=mm-cloud
  1. Create an S3 bucket to store the kops state
  2. Clone this repository into your GOPATH (or anywhere if you have Go Modules enabled)

Building

Simply run the following:

$ go install ./cmd/cloud

Running

Before running the server the first time you must set up the DB with:

$ cloud schema migrate

To run the server you will need a certificate ARN, private and public Route53 IDs, and a private DNS from AWS. For staff developers you can get these in our dev AWS account.

Run the server with:

$ cloud server --state-store=<your-s3-bucket> --private-dns dev.cloud.internal.mattermost.com --private-route53-id=<private-route53-id> --route53-id=<public-route53-id> --certificate-aws-arn <certifcate-aws-arn>

Testing

Run the go tests to test:

$ go test ./...

Deprecation Instructions

Terraform remote state and the ./clusters directory

The cloud server used to store all terraform generated by kops locally in the ./clusters directory.

This has been updated and the server now uses remote state in S3 for storing terraform state. The ./clusters directory is now completely ignored. To manually update your terraform to use remote state, do the following:

cd clusters/CLUSTER_ID
terraform init -backend-config=bucket=NAME_OF_KOPS_STATE_BUCKET -backend-config=region=us-east-1 -backend-config=key=terraform/KOPS_CLUSTER_NAME -force-copy

Repeat for every cluster in ./clusters dir. Note that KOPS_CLUSTER_NAME is not just the cluster ID. Run kops get clusters to get the full kops cluster names.