Quick Deploy #003 - Rocket.Chat
Extraction des valeurs
helm show values stable/rocketchat >> rocketchat.values.yaml
Valeurs intéressantes
Image
Tag : version docker
image:
repository: docker.io/rocketchat/rocket.chat
tag: 3.5.0
pullPolicy: IfNotPresent
SMTP
smtp:
enabled: true
username:
password:
host:
port: 587
Paramètres Mongo
Il faut remplir les 2 champs « password », il est possible aussi de déployer Mongo en cluster avec plusieurs replicas en plus. J’ai ajouté la version de MongoDB, pour pouvoir la mettre à jour par la suite.
mongodb:
## Enable or disable MongoDB dependency completely.
image:
tag: 4.2.8
enabled: true
mongodbRootPassword:
mongodbUsername: rocketchat
mongodbPassword:
mongodbDatabase: rocketchat
replicaSet:
enabled: true
replicas:
secondary: 0
arbiter: 0
pdb:
minAvailable:
secondary: 0
arbiter: 0
persistence:
enabled: true
## mongodb data Persistent Volume Storage Class
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack)
##
# storageClass: "-"
accessMode: ReadWriteOnce
size: 8Gi
Persistance des données de Rocket Chat
persistence:
enabled: true
## rocketchat data Persistent Volume Storage Class
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack)
##
# storageClass: "-"
accessMode: ReadWriteOnce
size: 8Gi
Exemple IngressRoute
Pour avoir accès depuis l’extérieur avec Traefik, voici un exemple de configuration :
Middleware
rocketchat-middleware.yaml :
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: rocketchat-middleware
namespace: rocketchat
spec:
headers:
contentTypeNosniff: true
browserXssFilter: true
#HSTS
forceSTSHeader: true
stsIncludeSubdomains: true
stsSeconds: 31536000
# remove Server and X-Powered-By headers
customResponseHeaders:
Server: ''
X-Powered-By: ''
IngressRoute
rocketchat-ingressroute.yaml :
"rocket.chat-ingressroute.yaml"
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: rocketchat-https
namespace: rocketchat
spec:
entrypoints:
- websecure
routes:
- match: Host(`chat.anywhere.com`)
kind: Rule
services:
- name: rocketchat-rocketchat
port: 80
middlewares:
- name: rocketchat-middleware
Résultat
Installation
helm upgrade rocketchat -f rocket.chat.values.yaml -n rocketchat stable/rocketchat
# installation de la configuration traefik
kubectl apply -f rocketchat-middleware.yaml
kubectl apply -f rocketchat-ingressroute.yaml