From 113c45fab181786cc41656d311c6d66f405d6a28 Mon Sep 17 00:00:00 2001 From: Aleksander Borowski <73070465+happyRip@users.noreply.github.com> Date: Wed, 29 May 2024 16:45:42 +0200 Subject: [PATCH] Update Kubernetes deployments docs (#1339) * doc: Add a note about database migrations for AKS * doc: Add a note about db migration to General k8s docs * doc: Add a note about k8s version upgrades for AKS * doc: Fix spelling --- .../host/kubernetes/azure/upgrading/_index.md | 37 +++++++++++++++++++ .../generic/database-migrations/_index.md | 24 +++++++++++- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 doc/content/the-things-stack/host/kubernetes/azure/upgrading/_index.md diff --git a/doc/content/the-things-stack/host/kubernetes/azure/upgrading/_index.md b/doc/content/the-things-stack/host/kubernetes/azure/upgrading/_index.md new file mode 100644 index 0000000000..4442bba771 --- /dev/null +++ b/doc/content/the-things-stack/host/kubernetes/azure/upgrading/_index.md @@ -0,0 +1,37 @@ +--- +title: "Upgrading" +description: "" +weight: 4 +--- + +This page describes the steps for upgrading {{% tts %}} on Azure Kubernetes Service. + + + +## Database Migration + +{{% tts %}} database schema is managed between minor versions using database migrations. + +{{< note >}} +User are informed of required migrations for each version via the [Release Notes](https://www.thethingsindustries.com/docs/whats-new/). It’s mandatory to run required database migrations for {{% tts %}} to function properly. +{{}} + +To migrate the database during an upgrade set the respective Terraform variables to `true`. + +| Service | Variable | +| ------- | ---------------- | +| IS | `is-db-migrate` | +| NOC | `noc-db-migrate` | + +{{< note >}} +For example to migrate Identity Server and Network Operations Center databases run the following command. + +```bash +$ terraform apply -var='is-db-migrate=true' -var='noc-db-migrate=true' +``` + +{{}} + +## Kubernetes version upgrade + +AKS Kubernetes version upgrades have to be performed sequentially for each minor version. For example to upgrade from `1.25` to `1.27` it's necessary to upgrade to version `1.26` first as an intermediate step. For more information refer to the [official documentation](https://learn.microsoft.com/en-us/azure/aks/supported-kubernetes-versions). diff --git a/doc/content/the-things-stack/host/kubernetes/generic/database-migrations/_index.md b/doc/content/the-things-stack/host/kubernetes/generic/database-migrations/_index.md index 3f863a5e92..6a8973e422 100644 --- a/doc/content/the-things-stack/host/kubernetes/generic/database-migrations/_index.md +++ b/doc/content/the-things-stack/host/kubernetes/generic/database-migrations/_index.md @@ -4,7 +4,7 @@ description: "" weight: 7 --- -{{% tts %}} database entries are managed between minor versions using database migrations. +{{% tts %}} database schema is managed between minor versions using database migrations. User are informed of required migrations for each version via the [Release Notes](https://www.thethingsindustries.com/docs/whats-new/). It's mandatory to run required database migrations for {{% tts %}} to function properly. @@ -14,6 +14,28 @@ This page describes the steps for performing database operations on a {{% tts %} ## General Procedure +Set the respective Helm chart values to `true` to perform database migrations during Helm chart upgrade. + +| Service | Variable | +| ------- | ---------------------------- | +| IS | `is.database.migrate` | +| NOC | `noc.store.database.migrate` | + +{{< note >}} +For example to migrate Identity Server use the following config. + +```yaml +is: + database: + migrate: true +``` + +{{}} + +Remember to unset the value after the upgrade is done. + +## Manual Procedure + 1. Delete current Jobs (if any). ```bash