Giter Club home page Giter Club logo

gcloud-kubernetes-mattermost's Introduction

gcloud-kubernetes-mattermost

This is a basic set of resources to get Mattermost 4.3.x+ running on Google Kubernetes Engine with Let's Encrypt. This guide assumes you already have a working Kubernetes Engine cluster setup.

  1. Clone the repo:
$ git clone https://github.com/admiralobvious/gcloud-kubernetes-mattermost.git && cd gcloud-kubernetes-mattermost
  1. Set the username and password for the PostgreSQL database:
$ kubectl create secret generic postgres-creds --from-literal=username=<yourusername> --from-literal=password=<yourpassword>
  1. Edit any Mattermost config you want in config.template.json and then set the username and password for the PostgreSQL database by editing the following line:
"postgres://<yourusername>:<yourpassword>@mattermost-pg:5432/mattermost?sslmode=disable&connect_timeout=10"
  1. Create the ConfigMap:
$ kubectl create configmap mattermost-config --from-file=./config.template.json
  1. Create persistent disks for PostgreSQL and Mattermost assets:
$ gcloud compute disks create "mattermost-postgres" --size "20GB" --type "pd-ssd"
$ gcloud compute disks create "mattermost-assets" --size "20GB" --type "pd-ssd"
  1. Create the PostgreSQL deployment and service:
$ kubectl create -f mattermost-pg-deployment.yaml
$ kubectl create -f mattermost-pg-service.yaml
  1. Create the Mattermost deployment and service:
$ kubectl create -f mattermost-app-deployment.yaml
$ kubectl create -f mattermost-app-service.yaml
  1. TLS and domain name:

Caddy is used as a reverse proxy for its Automatic HTTPS and Let's Encrypt support. It assumes you're using googlecloud for the DNS challenge but you can use any other DNS providers supported by Caddy.

You will want to edit the Caddyfile and replace mm.example.com with your own domain and <[email protected]> in the Dockerfile with your own email address. If you're using googlecloud you will also want to replace the content of credentials.json with the content a Google service account key that has DNS Administrator permissions.

  1. Build and push the Caddy reverse proxy container:
$ docker build -t gcr.io/<project_id>/mattermost-lb .
$ gcloud docker -- push gcr.io/<project_id>/mattermost-lb:latest
  1. Create the reverse proxy deployment and the load-balancer service (make sure you change the <project_id> in the deployment file:
$ kubectl create -f mattermost-lb-deployment.yaml
$ kubectl create -f mattermost-lb-service.yaml
  1. Grab the External IP to update your DNS:
$ kubectl get svc

Why not use Ingress (HTTP L7) instead of Load-Balancer (Network L4)?

The GCLB Ingress currently does not support (and probably never will) load-balancing WebSockets which Mattermost requires.

Credits

Based on: https://github.com/AcalephStorage/kubernetes-mattermost

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.