== Upgrade ==
=== Mattermost (Current ) ===
Work in progressIMPORTANT: Read the update notes before https://docs.mattermost.com/upgrade/important-upgrade-notes.html
<pre>
# Backup
ubuntu@k8s:~$ sudo rsync --exclude=data/ -av /srv/chat.fixme.ch/ /root/backup-chat-$(date +'%Y-%m-%d')/
# Upgrade
mattermost-app-b68b5cdb-5jlhj 1/1 Running 5 308d
postgresql-db-59ffdffd84-klkw2 1/1 Running 4 466d
# Watch the logs of the newly created pod
ubuntu@k8s:~$ kubectl logs -n mattermost -f mattermost-app-b68b5cdb-5jlhj
</pre>
=== Old PostgreSQL ===
* This is outdated since we migrated to KubernetesExample d'update de postgresql
Creation d'un nouveau deployment avec la nouvelle version, en parallèle de l'actuelle dans objects.yaml
<pre>
# ssh root@chat.fixme.chapiVersion: v1systemctl stop kind: PersistentVolumemetadata: labels: type: local name: mattermost-postgresql-10autopostgresqlbackup namespace: mattermostls spec: accessModes: -l ReadWriteOnce capacity: storage: 20Gi hostPath: path: /varsrv/lib/autopostgresqlbackup/daily/mattermostchat.fixme.ch/postgresql-10
su apiVersion: v1kind: PersistentVolumeClaimmetadata: name: mattermost- chatpostgresql-10 namespace: mattermostspec: accessModes: - ReadWriteOnce resources: requests: storage: 20Gi
# Get the TEAM edition (not the enterprise version)# VERSION from httpapiVersion:apps//about.v1kind: Deploymentmetadata: labels: app: mattermost.com/download/ tier: dbcd name: postgresql-10-db namespace: mattermostVERSION=3spec: replicas: 1 selector: matchLabels: app: mattermost tier: db template: metadata: creationTimestamp: null labels: app: mattermost tier: db name: mattermost-10-db spec: containers: - image: postgres:10.6.216OLDVERSION=$( imagePullPolicy: IfNotPresent name: postgresql-10-db ports: - containerPort: 5432 protocol: TCP resources: {} terminationMessagePath: /homedev/chattermination-log terminationMessagePolicy: File volumeMounts: - mountPath: /mattermostvar/binlib/platform version 2>&1 | head postgresql/data name: db env: -n 1 | awk 'name: POSTGRES_PASSWORD valueFrom: secretKeyRef: key: db-root name: mattermost.env dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler securityContext: {print $2}') terminationGracePeriodSeconds: 30 volumes: - name: db persistentVolumeClaim: claimName: mattermost-postgresql-10</pre>
cdCreation des objets, backup de l'ancienne db et import dans la nouvellewget https:<pre>mkdir /srv/releaseschat.mattermostfixme.com/$VERSIONch/postgresql-10kubectl create -n mattermostobjects.yamlsudo docker exec k8s_postgresql-teamdb_postgresql-$VERSIONdb-linux59ffdffd84-amd64.tar.gzmv mattermost mattermostpb2pg_mattermost_87151477-$OLDVERSIONtar xvf mattermosta5bf-team11eb-$VERSIONbde2-linux525400731ac9_0 pg_dumpall -amd64U postgres > dump-9.tar4.gzsqlrsync sudo cp dump-a 9.4.sql /mattermost-$OLDVERSION/configsrv/ chat.fixme.ch/mattermost/configpostgresql-10/.exit setcap cap_net_bind_service=+ep /home/chat/mattermostsudo docker exec -it k8s_postgresql-10-db_postgresql-10-db-558644f4fd-6g5lw_mattermost_bb97a762-a5c5-11eb-bde2-525400731ac9_0 /bin/platformsystemctl start mattermostbashtail pgsql -F U postgres < /homevar/chatlib/mattermostpostgresql/logsdata/mattermostdump-9.4.logsql
</pre>
A terminer:
- switch vers la nouvelle version
== Channel naming convention ==