* Initial goal was to get out of slack
* The other goal is to have a userfriendly chat, better than IRC (which still have its use cases of course)
[[File:Team chat.png]]
== Component ==
* Mattermost: http://www.mattermost.org/
* Bot: https://hubot.github.com/
* <s>Hosted on an Openstack cloud instance</s>* Hosted in [[Bellatrix]] on Kubernetes
== Upgrade ==
* The === Mattermost (Current) === IMPORTANT: Read the update notes before https://docs.mattermost.com/upgrade takes place like this,/important-upgrade-notes.html <codepre>systemctl stop mattermostssh ubunut@k8s.fixme.chautopostgresqlbackupls # Backupubuntu@k8s:~$ sudo rsync -l -exclude=data/var-av /libsrv/autopostgresqlbackupchat.fixme.ch/daily/root/backup-chat-$(date +'%Y-%m-%d')/ # Upgradeubuntu@k8s:~$ sudo docker pull mattermost/mattermost-prod-app:5.9.8su ubuntu@k8s:~$ kubectl - chatn mattermost edit deployment.apps/mattermost-app # Download Update the TEAM edition (not image tag to be to the enterprise last version(not latest!) from http, ex:# image: mattermost//about.mattermost-prod-app:5.com/download/8.0VERSION=3# image: mattermost/mattermost-prod-app:5.69.28OLDVERSION=$(/home/chat# save/quit # Watch the pods being restarted ubuntu@k8s:~$ kubectl get pods -n mattermost-wNAME READY STATUS RESTARTS AGEmattermost-app-b68b5cdb-5jlhj 1/bin1 Running 5 308dpostgresql-db-59ffdffd84-klkw2 1/platform version 2>&1 | head Running 4 466d # Watch the logs of the newly created podubuntu@k8s:~$ kubectl logs -n 1 | awk mattermost -f mattermost-app-b68b5cdb-5jlhj</pre> === PostgreSQL === Example d'{print $2}update de postgresql Creation d')un nouveau deployment avec la nouvelle version, en parallèle de l'actuelle dans objects.yamlwget https<pre>apiVersion: v1kind: PersistentVolumemetadata: labels: type: local name: mattermost-postgresql-10 namespace: mattermostspec: accessModes: - ReadWriteOnce capacity: storage: 20Gi hostPath: path:/srv/releaseschat.mattermostfixme.com/$VERSIONch/postgresql-10 apiVersion: v1kind: PersistentVolumeClaimmetadata: name: mattermost-teampostgresql-$VERSION10 namespace: mattermostspec: accessModes: -linuxReadWriteOnce resources: requests: storage: 20Gi apiVersion: apps/v1kind: Deploymentmetadata: labels: app: mattermost tier: db name: postgresql-amd64.tar.gz10-dbmv namespace: mattermost spec: replicas: 1 selector: matchLabels: app: mattermost-$OLDVERSIONtar xvf tier: db template: metadata: creationTimestamp: null labels: app: mattermost tier: db name: mattermost-team10-$VERSION-linuxdb spec: containers: -amd64.tarimage: postgres:10.gz16rsync imagePullPolicy: IfNotPresent name: postgresql-a .10-db ports: - containerPort: 5432 protocol: TCP resources: {} terminationMessagePath: /mattermostdev/termination-$OLDVERSIONlog terminationMessagePolicy: File volumeMounts: - mountPath: /configvar/ .lib/postgresql/data name: db env: - name: POSTGRES_PASSWORD valueFrom: secretKeyRef: key: db-root name: mattermost.env dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler securityContext: {} terminationGracePeriodSeconds: 30 volumes: - name: db persistentVolumeClaim: claimName: mattermost-postgresql-10</config/pre>exitsetcap cap_net_bind_service=+ep Creation des objets, backup de l'ancienne db et import dans la nouvelle<pre>mkdir /homesrv/chat.fixme.ch/postgresql-10kubectl create -n mattermostobjects.yamlsudo docker exec k8s_postgresql-db_postgresql-db-59ffdffd84-pb2pg_mattermost_87151477-a5bf-11eb-bde2-525400731ac9_0 pg_dumpall -U postgres > dump-9.4.sqlsudo cp dump-9.4.sql /srv/chat.fixme.ch/postgresql-10/.sudo docker exec -it k8s_postgresql-10-db_postgresql-10-db-558644f4fd-6g5lw_mattermost_bb97a762-a5c5-11eb-bde2-525400731ac9_0 /bin/platformbashsystemctl start mattermosttail pgsql -F U postgres < /homevar/chatlib/mattermostpostgresql/logsdata/mattermostdump-9.log4.sql</codepre> A terminer:- switch vers la nouvelle version
== Channel naming convention ==