Files
team/docs/main/administration-guide/upgrade/upgrade-mattermost-kubernetes-ha.mdx
b5f007d35e docs: fix broken path links, anchors, and tab rendering from RST-to-MDX migration (#37433)
* docs: resolve cross-file anchor mismatches from RST-to-MDX migration

The Sphinx-to-Docusaurus migration converted `:ref:`/`{ref}` links using
naive text-slugification, so anchors that pointed to headings in a
different file (e.g. release-summary tables linking into their
respective changelog pages) were emitted as same-page fragments and
silently resolved to nothing.

Built a label registry from the original Sphinx `.. _label:` / `(label)=`
targets to recover the true source file for each cross-reference, then
rewrote the affected links to point at the correct file + heading
anchor. Fixes 282 broken cross-file anchors, primarily in the mobile/
desktop/server release-summary pages, plus assorted same-page anchor
mismatches caught by re-auditing after the prior admonition/anchor fix.

* docs: manually resolve remaining anchor mismatches after cross-file audit

Hand-verified fixes for anchors that fuzzy-matching alone couldn't
safely resolve (confirmed against actual heading text/context, and in a
few cases against the original RST source, before applying):

- Typos and dropped words carried over from the original Sphinx docs
  (e.g. "bot-acocunts", "auto-follow-all-new-channel-threads" ->
  "follow-all-new-channel-threads").
- Sphinx auto-generated duplicate-heading IDs (#id1/#id3/#id4) resolved
  to their real target headings.
- Numbered-step TOC links in enterprise-roll-out-checklist.mdx that
  dropped the leading "N. " used in the actual heading slugs.
- Push-notification docs pointing at the wrong file entirely
  (environment-configuration-settings instead of
  push-notification-server-configuration-settings).
- SAML "saml-enterprise" label resolved to its true cross-file target
  (authentication-configuration-settings#saml-2-0), recovered from the
  original RST label definition that the automated registry missed
  because it sat after an RST transition marker.
- sso-saml-technical references converted from broken same-page/
  malformed-path anchors to correct page links.

* docs: fix SAML 2.0 anchor slug (saml-2-0 -> saml-20)

github-slugger strips periods rather than hyphenating them, so "SAML
2.0" slugifies to saml-20, not saml-2-0 as previously fixed.

* docs: fix broken path links found during docs/main migration cleanup

* docs: convert div.tab blocks to Docusaurus Tabs/TabItem components

* docs: restore missing Kubernetes deployment architecture diagrams

The RST-to-MDX migration never copied over the AWS/Azure/Oracle
architecture diagrams referenced by the deployment-architecture-at-scale
page, leaving broken images in each Tabs/TabItem.

* docs: fix 7 anchor mismatches from the fragment/heading audit

Covers three root causes from the anchor mismatch breakdown:
- Fragment repeated the target page's own title instead of a real
  heading, so the link is simplified to point at the bare page.
- Heading exists verbatim but lives on a sibling settings page
  (experimental-configuration-settings, push-notification-server-
  configuration-settings) rather than environment-configuration-settings.
- A page path was mistakenly pasted into a same-page #fragment instead
  of being used as a real cross-page link.

* docs: fix 8 anchor slugs that were close but didn't match the real heading

Repoints links whose fragment was a plausible guess (typo, reworded
heading, or wrong section) at the actual auto-generated slug of the
target heading, confirmed by inspecting each target page directly.

* docs: merge split Tabs blocks so tabs render horizontally

The div.tab conversion script split some sibling tab groups into
separate single-item Tabs blocks whenever a stray blockquote marker
sat between them, causing them to render stacked instead of as one
horizontal tab bar. Merges the MySQL/PostgreSQL and Team/Enterprise
Edition tab groups back into single Tabs blocks.

* docs: remove Azure tab and restore Kubernetes deploy content

The Mattermost Operator, Azure, and Oracle platform tabs on the
Kubernetes deployment guide were split across two separate Tabs
blocks (rendering stacked instead of as one tab bar) and all three
tab bodies were empty because the migration never flattened the
original RST include directives. Removes the unsupported Azure tab
and restores the Mattermost Operator and Oracle content from the
pre-migration RST sources as a single merged Tabs block.

* addresscoderabbitreview

* docs: unify Linux/Kubernetes/Containers deploy pages and fix FIPS/STIG placement

Kubernetes and Containers duplicated full install content across a top-level
page (Tabs) and orphaned sidebar subpages that nothing linked to. Reworked
both to follow the Linux page's pattern: shared content on the landing page,
platform-specific instructions live once in their own subpage.

Also removed configure-fips-at-install-time.mdx, which claimed FIPS is
available for native Linux installs — FIPS/STIG in Mattermost is a container
image property (Chainguard-based build), not available outside Docker/
Kubernetes. Consolidated all FIPS/STIG references onto
containers/fips-stig.mdx and pointed the Mattermost Operator subpage (not
Oracle OKE, which doesn't expose image selection) at it.

* docs: fix review findings — image alt text, Important callout markup, typo

- Replace generic alt="image" on scaling diagrams with descriptive text
  identifying cloud provider and user scale.
- Convert raw div.important markup in deploy-containers.mdx to the
  repo's <Important> component, matching usage elsewhere in the file.
- Fix "Matermost" typo in manage-your-display-options.mdx.

---------

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-10 14:50:13 +03:00

240 lines
13 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Upgrade Mattermost in Kubernetes and High Availability environments"
---
<PlanAvailability slug="ent-plus" />
This guide provides a resilient and comprehensive strategy for upgrading Mattermost deployments managed via Kubernetes and the Mattermost Operator, including High Availability (HA) and optional Active/Active failover configurations. It outlines best practices to ensure zero downtime, minimize service risk, and provide robust fallback mechanisms.
## Architecture overview
### Kubernetes-based deployment
Mattermost uses [Kubernetes](/deployment-guide/server/deploy-kubernetes) for container orchestration, deployed and managed via Helm charts and the [Mattermost Operator](#install-mattermost-operator). This model enables scalable, highly available, and automatically managed application lifecycles.
The Mattermost Operator handles the upgrade process automatically, ensuring that pods are updated incrementally and that traffic is routed correctly throughout the upgrade. If an error occurs during the upgrade, the Operator will not apply any changes, allowing you to investigate and resolve the issue or manually roll back without impacting the live environment. See the [Downgrade Mattermost Server](/administration-guide/upgrade/downgrading-mattermost-server) documentation for rollback details.
Health monitoring ensures that only healthy pods are replaced, and new pods are brought online only after passing health checks. New pods are deployed with the updated version, while old pods are gracefully terminated.
### High Availability
In [High Availability (HA) cluster-based deployments](/administration-guide/scale/high-availability-cluster-based-deployment), Mattermost runs multiple application servers in a cluster. This configuration ensures that if one server fails, others can continue to serve requests without downtime. User traffic load balancing is managed with services such as NGINX Ingress or HAProxy. [PostgreSQL](/deployment-guide/server/preparations#database-preparation) and [file storage](/deployment-guide/server/preparations#file-storage-preparation) are deployed with replication for redundancy and failover.
### Active/Active deployments
An Active/Active configuration is optional and consists of two or more Mattermost clusters running concurrently across geographically distributed regions or availability zones. Each cluster is capable of serving live user traffic and processing requests independently while remaining in sync with shared backend components such as the database and file storage.
Key benefits for enterprise customers include:
- **Resilience and uptime**: If a site becomes unavailable due to maintenance or an outage, another site can continue to serve users with minimal disruption.
- **Geographic distribution**: Users connect to the nearest cluster for lower latency and faster response times.
- **Load distribution**: Workload can be balanced between clusters to improve performance and system scalability.
These deployments require careful configuration management and coordination to ensure data consistency, upgrade safety, and seamless traffic failover. These clusters must maintain configuration/data consistency and require coordinated upgrades. See the [Active/Active upgrade considerations](#step-3-activeactive-upgrade-considerations) section for recommendations.
## Step 1: Prepare
This phase ensures your environment is healthy, backed up, and ready for an upgrade. Follow each step carefully to avoid disruptions and to ensure rollback readiness.
<Important>
- **Backup your data**: Always back up your database and file storage before starting an upgrade. This ensures you can restore to a previous state in case of issues during the upgrade process.
- **Upgrade safely**: The Mattermost Operator performs upgrade validation checks before rollout. If checks fail, the upgrade is blocked and no changes are applied. If checks pass, the Operator upgrades pods incrementally to maintain uptime.
</Important>
### Pre-upgrade checklist
1. **Cluster health**: Ensure all nodes are in a ready state and all pods are running without errors. This step is crucial to avoid issues during the upgrade process. Use the following commands to check cluster health:
> ``` bash
> kubectl get nodes
> kubectl get pods --all-namespaces
> ```
2. **Helm setup**: Verify that Helm is installed and configured correctly in your Kubernetes cluster. Ensure you have the latest version of the Mattermost Operator Helm chart. Use the following commands to check Helm setup:
> ``` bash
> helm repo update
> helm upgrade mattermost-operator mattermost/mattermost-operator -n <OPERATOR_NAMESPACE_HERE> -f <OPTIONAL_CUSTOM_VALUES_HERE>
> ```
3. **Confirm Mattermost Operator version**: Make sure the image version matches the latest supported release from the Helm repository. Use the following command to check the current image version of the Mattermost Operator:
> ``` bash
> kubectl get deployment mattermost-operator -n mattermost -o=jsonpath='&#123;.spec.template.spec.containers[0].image&#125;'
> ```
4. **Verify available resources**: Ensure your Kubernetes cluster has sufficient CPU and memory resources to handle the upgrade process. Use the following commands to check resource availability:
> ``` bash
> kubectl top nodes
> kubectl describe node | grep Allocatable
> ```
5. Back up database and file storage.
> Use `pg_dump` or volume snapshots to create a full backup to a secure, external location (e.g., S3 or NFS). Validate the backup can be restored. See the [Backup and Disaster Recovery](/deployment-guide/backup-disaster-recovery) documentation for details.
6. **Ensure configuration consistency**: Validate that `values.yaml`, secrets, and other configuration files are version-controlled and consistent across all clusters (required for [Active/Active deployments](#step-3-activeactive-upgrade-considerations)). Use tools like GitOps or configuration management systems to ensure all clusters have the same configuration.
7. We strongly recommend performing a dry run by testing the upgrade in a staging environment that mirrors production to catch misconfigurations early.
## Step 2: Perform the upgrade
This step involves updating the Mattermost Operator and Mattermost server to a new version. The Operator manages the upgrade process, ensuring that pods are updated incrementally and that traffic is routed correctly throughout the upgrade.
We recommend having a separate Mattermost custom resource. See the [Deploy Mattermost on Kubernetes](/deployment-guide/server/deploy-kubernetes) documentation for details.
1. In the separate resource, update the `version` field in your `mattermost-installation.yaml` file by replacing the `&lt;new-version-tag&gt;` with the specific version you are upgrading to:
> ``` yaml
> apiVersion: installation.mattermost.com/v1beta1
> kind: Mattermost
> metadata:
> name: <INSTALLATION_NAME_HERE>
> spec:
> version: &lt;new-version-tag&gt; # Update this field
> ```
>
> Alternatively, if you're using Helm `values.yaml` directly, update it with the desired Mattermost version:
>
> ``` yaml
> image:
> repository: mattermost/mattermost-enterprise-edition
> tag: &lt;new-version-tag&gt;
> ```
2. Apply the updated configuration:
> For Mattermost custom resource deployments:
>
> ``` bash
> kubectl apply -f mattermost-installation.yaml
> ```
>
> For Helm values deployments:
>
> ``` bash
> helm upgrade mattermost mattermost/mattermost-operator -f values.yaml
> ```
3. Monitor the rollout by tracking upgrade progress and logs with the following commands:
> ``` bash
> kubectl get pods -n mattermost
> kubectl logs -f &lt;pod-name&gt; -n mattermost
> ```
New pods are started with the updated version. Old pods are gracefully terminated after health checks pass, and traffic remains uninterrupted due to rolling upgrade behavior. NGINX, HAProxy, or Ingress configurations continue routing traffic seamlessly during the upgrade process.
## Step 3: Active/Active upgrade considerations
When your deployment includes an Active/Active configuration with multi-cluster or multi-region deployments, you must ensure that all clusters are upgraded in a coordinated manner to maintain data consistency and service availability.
For coordinated site upgrades, we recommend the following steps:
- Use your global load balancer or DNS to route traffic away from the site being upgraded.
- Upgrade one site at a time while directing traffic to the other. This minimizes downtime and allows for validation of the upgrade process.
- Confirm replication health for databases and storage before proceeding to the next site.
- Monitor performance and logs before resuming traffic to the upgraded site.
To prevent split-brain scenarios during upgrades and ensure data consistency:
- Use a global load balancer or DNS to direct traffic exclusively to the active site.
- Disable writes on the site being upgraded until the upgrade is complete and validated.
- Confirm that only one site is actively writing data at any time.
- Monitor logs for signs of replication lag, file synchronization issues, or data divergence.
- Validate the health of data replication channels before and after each site upgrade.
## Step 4: Validate
After the upgrade:
1. Confirm that all pods are healthy and running the expected version using the following command:
> ``` bash
> kubectl get pods -n mattermost -o=jsonpath='&#123;.items[*].spec.containers[*].image&#125;'
> ```
3. Perform product smoke tests:
> - Log in to the Mattermost web interface and navigate across teams and channels.
> - Test core functionalities such as posting messages and uploading files.
> - Verify that all integrations, webhooks, and plugins are functioning as expected.
> - Check for error messages in the logs.
4. Use monitoring tools to confirm application health and performance. See the [Performance monitoring with Prometheus and Grafana](/administration-guide/scale/deploy-prometheus-grafana-for-performance-monitoring) documentation or the [Metrics plugin](/administration-guide/scale/performance-monitoring-metrics) documentation for details on collecting and reviewing performance metrics.
## Rollback strategy
In case of upgrade issues, rollback should be performed by modifying the custom resource and setting the Mattermost version back to its original value.
For Mattermost custom resource deployments, update the `version` field in your `mattermost-installation.yaml` file to the previous version:
``` yaml
apiVersion: installation.mattermost.com/v1beta1
kind: Mattermost
metadata:
name: <INSTALLATION_NAME_HERE>
spec:
version: <previous-version-tag> # Set back to previous version
```
Then apply the rollback:
``` bash
kubectl apply -f mattermost-installation.yaml
```
Alternatively, for Helm values deployments, use Helm's rollback command:
``` bash
helm rollback mattermost <revision_number>
```
Restore your PostgreSQL database and file store backups if needed. Refer to the [Backup and Disaster Recovery](/deployment-guide/backup-disaster-recovery) documentation for detailed guidance.
## Frequently asked questions
### How can I confirm an upgrade was successful?
A successful upgrade is indicated by:
- All pods running the expected image version
- No errors in pod logs
- Functional smoke tests passing (login, messaging, file upload, etc.)
- No anomalies in monitoring dashboards
### What should I monitor post-upgrade?
We recommend monitoring the following key metrics after an upgrade:
- Pod health and restarts
- Application logs for errors or warnings
- Database replication health (if HA or Active/Active)
- Performance metrics (latency, error rate) via Prometheus/Grafana
### How can I test upgrades without impacting production?
We strongly recommend deploying a separate staging environment that mirrors production, and running a full end-to-end upgrade simulation before upgrading live production clusters.
### Can I upgrade the Operator and Mattermost server at the same time?
Upgrade the Operator first. Validate it’s stable before upgrading the Mattermost server version.
### Do I need to upgrade the database separately?
Mattermost does not upgrade the database schema by default. You must manually apply database schema updates if required by a newer Mattermost version. Review the [Mattermost Server changelog](/product-overview/mattermost-v10-changelog) for any migration steps.
### What if my pods don’t become ready after the upgrade?
Check the Operator logs and pod events using `kubectl` to identify and resolve issues. Look for common issues such as resource constraints, configuration errors, or network connectivity problems.
### What version compatibility should I be aware of between the Mattermost Operator and the application server?
Running an older Operator version may not support newer Mattermost features or upgrade flows. Always check the [Helm chart release notes](https://github.com/mattermost/mattermost-helm/tree/master/charts/mattermost-operator) for version compatibility between the Operator and the Mattermost server.
### Can I automate this upgrade process using GitOps or CI/CD?
Yes. You can manage upgrades using tools like ArgoCD or FluxCD to apply Helm changes from version-controlled `values.yaml` files. Ensure changes are peer-reviewed and validated in staging before promotion.