diff --git a/doc/user/content/installation/install-on-aws/appendix-deployment-guidelines.md b/doc/user/content/installation/install-on-aws/appendix-deployment-guidelines.md index 2a3c6866110d3..9790bfc244361 100644 --- a/doc/user/content/installation/install-on-aws/appendix-deployment-guidelines.md +++ b/doc/user/content/installation/install-on-aws/appendix-deployment-guidelines.md @@ -33,38 +33,19 @@ when operating on datasets larger than main memory as well as allows for a more graceful degradation rather than OOMing. Network-attached storage (like EBS volumes) can significantly degrade performance and is not supported. -*Starting in v0.3.1 of Materialize on AWS Terraform*, disk support (using -OpenEBS and NVMe instance storage) is enabled, by default, for Materialize. With -this change, the Terraform: +Starting in v0.6.1 of Materialize on AWS Terraform, +disk support (using swap on NVMe instance storage) may be enabled for Materialize. +With this change, the Terraform: -- Installs OpenEBS via Helm; - -- Configures NVMe instance store volumes using a bootstrap script; - -- Creates appropriate storage classes for Materialize. - -Associated with this change, +- Creates a node group for Materialize. +- Configures NVMe instance store volumes as swap using a daemonset. +- Enables swap at the Kubelet. - The following configuration options are available: - - [`enable_disk_support`] - - [`disk_support_config`] - -- The default [`node_group_instance_types`] has changed from `"r8g.2xlarge"` to - `"r7gd.2xlarge"`. See [Recommended instance - types](#recommended-instance-types). - -[enable disk support]: - https://github.com/MaterializeInc/terraform-aws-materialize?tab=readme-ov-file#disk-support-for-materialize - -[`enable_disk_support`]: - https://github.com/MaterializeInc/terraform-aws-materialize?tab=readme-ov-file#input_enable_disk_support - -[`disk_support_config`]: - https://github.com/MaterializeInc/terraform-aws-materialize?tab=readme-ov-file#input_disk_support_config + - [`swap_enabled`] -[`node_group_instance_types`]: - https://github.com/MaterializeInc/terraform-aws-materialize?tab=readme-ov-file#input_node_group_instance_types +See [Upgrade Notes](https://github.com/MaterializeInc/terraform-aws-materialize?tab=readme-ov-file#v061) ## CPU affinity diff --git a/doc/user/content/installation/install-on-azure/appendix-deployment-guidelines.md b/doc/user/content/installation/install-on-azure/appendix-deployment-guidelines.md index 660d9d644480b..7d224316c488f 100644 --- a/doc/user/content/installation/install-on-azure/appendix-deployment-guidelines.md +++ b/doc/user/content/installation/install-on-azure/appendix-deployment-guidelines.md @@ -47,28 +47,19 @@ when operating on datasets larger than main memory as well as allows for a more graceful degradation rather than OOMing. Network-attached storage (like EBS volumes) can significantly degrade performance and is not supported. -Starting in v0.4.0 of Materialize on Azure Terraform, disk support (using -OpenEBS and NVMe instance storage) is enabled, by default, for Materialize. With -this change, the Terraform: +Starting in v0.6.1 of Materialize on Azure Terraform, +disk support (using swap on NVMe instance storage) may be enabled for Materialize. +With this change, the Terraform: -- Installs OpenEBS via Helm; - -- Configures NVMe instance store volumes using a bootstrap script; - -- Creates appropriate storage classes for Materialize. - -Associated with this change: +- Creates a node group for Materialize. +- Configures NVMe instance store volumes as swap using a daemonset. +- Enables swap at the Kubelet. - The following configuration options are available: - - [`enable_disk_support`] - - [`disk_support_config`] - - [`disk_setup_image`] + - [`swap_enabled`] -- The default -[`aks_config.vm_size`](https://github.com/MaterializeInc/terraform-azurerm-materialize?tab=readme-ov-file#input_aks_config) -has changed from `Standard_E8ps_v6` to `Standard_E4pds_v6`. See [Recommended -instance types](#recommended-instance-types). +See [Upgrade Notes](https://github.com/MaterializeInc/terraform-azurerm-materialize?tab=readme-ov-file#v061) ## Recommended Azure Blob Storage diff --git a/doc/user/content/installation/install-on-gcp/appendix-deployment-guidelines.md b/doc/user/content/installation/install-on-gcp/appendix-deployment-guidelines.md index ff2f971f86406..c9cc2d2d6b5fc 100644 --- a/doc/user/content/installation/install-on-gcp/appendix-deployment-guidelines.md +++ b/doc/user/content/installation/install-on-gcp/appendix-deployment-guidelines.md @@ -75,37 +75,19 @@ when operating on datasets larger than main memory as well as allows for a more graceful degradation rather than OOMing. Network-attached storage (like EBS volumes) can significantly degrade performance and is not supported. -Starting in v0.4.0 of Materialize on Google Cloud Provider (GCP) Terraform, -disk support (using OpenEBS and NVMe instance storage) is enabled, by default, -for Materialize. With this change, the Terraform: +Starting in v0.6.1 of Materialize on Google Cloud PRovider (GCP) Terraform, +disk support (using swap on NVMe instance storage) may be enabled for Materialize. +With this change, the Terraform: -- Installs OpenEBS via Helm; - -- Configures NVMe instance store volumes using a bootstrap script; - -- Creates appropriate storage classes for Materialize. - -Associated with this change: +- Creates a node group for Materialize. +- Configures NVMe instance store volumes as swap using a daemonset. +- Enables swap at the Kubelet. - The following configuration options are available: - - [`enable_disk_support`] - - [`disk_support_config`] - -- The default [`gke_config.machine_type`] has changed from `e2-standard-4` to -`n2-highmem-8`. See [Recommended instance types](#recommended-instance-types). - -[enable disk support]: - https://github.com/MaterializeInc/terraform-google-materialize?tab=readme-ov-file#disk-support-for-materialize-on-gcp - -[`enable_disk_support`]: - https://github.com/MaterializeInc/terraform-google-materialize?tab=readme-ov-file#input_enable_disk_support - -[`disk_support_config`]: - https://github.com/MaterializeInc/terraform-google-materialize?tab=readme-ov-file#input_disk_support_config + - [`swap_enabled`] -[`gke_config.machine_type`]: - https://github.com/MaterializeInc/terraform-google-materialize?tab=readme-ov-file#input_gke_config +See [Upgrade Notes](https://github.com/MaterializeInc/terraform-google-materialize?tab=readme-ov-file#v061) ## CPU affinity diff --git a/doc/user/content/installation/upgrade-to-swap.md b/doc/user/content/installation/upgrade-to-swap.md new file mode 100644 index 0000000000000..d126566ace519 --- /dev/null +++ b/doc/user/content/installation/upgrade-to-swap.md @@ -0,0 +1,118 @@ +--- +title: "Guide: Node preparation for swap and upgrading to v26" +description: "Upgrade procedure when upgrading to v26 which has swap enabled by default." +menu: + main: + parent: "installation" + weight: 69 +--- + +Swap allows for infrequently accessed data to be moved from memory to disk. Enabling swap reduces the memory required to operate Materialize and improves cost efficiency. Upgrades to v26 and later have swap enabled by default. + +## Upgrading to v26 with swap requires node preparation +We've added new labels to the node selectors for clusterd pods to enable smooth upgrades. As a result, if you are running v25.2.12 or earlier, your existing nodes will not match these selectors and won't be selected to run the pods. Before upgrading to v26, you must prepare your nodes by adding the required labels. + +## Preparing for the upgrade using terraform +v0.6.1 of the Materialize terraform modules can handle much of the preparation work for you. If using our terraform modules, please follow the instructions provided in the respective upgrade notes: +- [AWS](https://github.com/MaterializeInc/terraform-aws-materialize?tab=readme-ov-file#v061) +- [GCP](https://github.com/MaterializeInc/terraform-google-materialize?tab=readme-ov-file#v061) +- [Azure](https://github.com/MaterializeInc/terraform-azurerm-materialize?tab=readme-ov-file#v061) + +## Preparing for the upgrade without terraform + +1. Label existing scratchfs/lgalloc node groups + + If using lgalloc on scratchfs volumes, you must add the additional `"materialize.cloud/scratch-fs": "true"` label to your existing node groups and nodes running Materialize workloads. + + Adding this label to the node group (or nodepool) configuration will apply the label to newly spawned nodes, but depending on your cloud provider may not apply the label to existing nodes. + + If not automatically applied, you may need to use `kubectl label` to apply the change to existing nodes. + +1. Modify existing scratchfs/lgalloc disk setup daemonset selector labels + + If using our [ephemeral-storage-setup image](https://github.com/MaterializeInc/ephemeral-storage-setup-image/) as a daemonset to configure scratchfs LVM volumes for lgalloc, you must add the additional `"materialize.cloud/scratch-fs": "true"` label to multiple places: + * `spec.selector.matchLabels` + * `spec.template.metadata.labels` + * (if using `nodeAffinity`) `spec.template.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms` + * (if using `nodeSelector`) `spec.template.spec.nodeSelector` + + You **must** use at least one of `nodeAffinity` or `nodeSelector`. + + It is recommended to rename this daemonset to make it clear that it is only for the legacy scratchfs/lgalloc nodes (for example, change the name `disk-setup` to `disk-setup-scratchfs`). + +1. Create a new node group for swap + + 1. Create a new node group (or ec2nodeclass and nodepool if using Karpenter in AWS) using an instance type with local NVMe disks. If in GCP, the disks must be in `raw` mode. + + 1. Label the node group with `"materialize.cloud/swap": "true"`. + + 1. If using AWS Bottlerocket AMIs (highly recommended if running in AWS), set the following in the userdata to configure the disks for swap, and enable swap in the kubelet: + + ```toml + [settings.oci-defaults.resource-limits.max-open-files] + soft-limit = 1048576 + hard-limit = 1048576 + + [settings.bootstrap-containers.diskstrap] + source = "docker.io/materialize/ephemeral-storage-setup-image:v0.4.0" + mode = "once" + essential = "true" + # ["swap", "--cloud-provider", "aws", "--bottlerocket-enable-swap"] + user-data = "WyJzd2FwIiwgIi0tY2xvdWQtcHJvdmlkZXIiLCAiYXdzIiwgIi0tYm90dGxlcm9ja2V0LWVuYWJsZS1zd2FwIl0=" + + [kernel.sysctl] + "vm.swappiness" = "100" + "vm.min_free_kbytes" = "1048576" + "vm.watermark_scale_factor" = "100" + ``` + + 1. If not using AWS or not using Bottlerocket AMIs, and your node group supports it (Azure does not as of 2025-11-05), add a startup taint. This taint will be removed after the disk is configured for swap. + + ```yaml + taints: + - key: startup-taint.cluster-autoscaler.kubernetes.io/disk-unconfigured + value: "true" + effect: NoSchedule + ``` + +1. Create a new disk-setup-swap daemonset + + If using Bottlerocket AMIs in AWS, you may skip this step, as you should have configured swap using userdata previously. + + Create a new daemonset using our [ephemeral-storage-setup image](https://github.com/MaterializeInc/ephemeral-storage-setup-image/) to configure the disks for swap and to enable swap in the kubelet. + + The arguments to the init container in this daemonset need to be configured for swap. See the examples in the linked git repository for more details. + + This daemonset should run only on the new swap nodes, so we need to ensure it has the `"materialize.cloud/swap": "true"` label in several places: + + * `spec.selector.matchLabels` + * `spec.template.metadata.labels` + * (if using `nodeAffinity`) `spec.template.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms` + * (if using `nodeSelector`) `spec.template.spec.nodeSelector` + + You **must** use at least one of `nodeAffinity` or `nodeSelector`. + + It is recommended to name this daemonset to clearly indicate that it is for configuring swap (ie: `disk-setup-swap`), as opposed to other disk configurations. + +1. (Optional) Configure environmentd to also use swap + + Swap is enabled by default for clusterd, but not for environmentd. If you'd like to enable swap for environmentd, add `"materialize.cloud/swap": "true"` to the `environmentd.node_selector` helm value. + +1. Upgrade the Materialize operator helm chart to v26 + + The cluster size definitions for existing Materialize instances will not be changed at this point, but any newly created Materialize instances, or upgraded Materialize instances will pick up the new sizes. + + Do not create any new Materialize instances at versions less than v26, or perform any rollouts to existing Materialize instances to versions less than v26. + +1. Upgrade existing Materialize instances to v26 + + The new v26 pods should go to the new swap nodes. + + You can verify that swap is enabled and working by `exec`ing into a clusterd pod and running `cat /sys/fs/cgroup/memory.swap.max`. If you get a number greater than 0, swap is enabled and the pod is allowed to use it. + +1. (Optional) Delete old scratchfs/lgalloc node groups and disk-setup-scratchfs daemonset + + If you no longer have anything running on the old scratchfs/lgalloc nodes, you may delete their node group and the disk-setup-scratchfs daemonset. + +## How to disable swap +If you wish to opt out of swap and retain the old behavior, you may set `operator.clusters.swap_enabled: false` in your helm values. diff --git a/doc/user/data/self_managed/aws_terraform_versions.yml b/doc/user/data/self_managed/aws_terraform_versions.yml index fd89284c76363..ad257cae22bbd 100644 --- a/doc/user/data/self_managed/aws_terraform_versions.yml +++ b/doc/user/data/self_managed/aws_terraform_versions.yml @@ -4,17 +4,22 @@ columns: rows: - "Terraform version": | - [v0.5.5](https://github.com/MaterializeInc/terraform-aws-materialize/releases/) + [v0.6.1](https://github.com/MaterializeInc/terraform-aws-materialize/releases/tag/v0.6.1) + "Notable changes": | + - Initial swap support. See upgrade notes for details. + +- "Terraform version": | + [v0.5.5](https://github.com/MaterializeInc/terraform-aws-materialize/releases/tag/v0.5.5) "Notable changes": | - Uses `terraform-helm-materialize` v0.1.26. - "Terraform version": | - [v0.5.4](https://github.com/MaterializeInc/terraform-aws-materialize/releases/) + [v0.5.4](https://github.com/MaterializeInc/terraform-aws-materialize/releases/tag/v0.5.4) "Notable changes": | - Uses `terraform-helm-materialize` v0.1.25. - "Terraform version": | - [v0.4.9](https://github.com/MaterializeInc/terraform-aws-materialize/releases/) + [v0.4.9](https://github.com/MaterializeInc/terraform-aws-materialize/releases/tag/v0.4.9) "Notable changes": | - Uses `terraform-helm-materialize` v0.1.19. @@ -22,7 +27,7 @@ rows: - Adds support for password authentication and enabling RBAC - "Terraform version": | - [v0.4.6](https://github.com/MaterializeInc/terraform-aws-materialize/releases/) + [v0.4.6](https://github.com/MaterializeInc/terraform-aws-materialize/releases/tag/v0.4.6) "Notable changes": | - Adds support for passing in additional Materialize instance configuration diff --git a/doc/user/data/self_managed/azure_terraform_versions.yml b/doc/user/data/self_managed/azure_terraform_versions.yml index b0d18ef100f5e..4646ff01b53d9 100644 --- a/doc/user/data/self_managed/azure_terraform_versions.yml +++ b/doc/user/data/self_managed/azure_terraform_versions.yml @@ -4,17 +4,22 @@ columns: rows: - "Terraform version": | - [v0.5.5](https://github.com/MaterializeInc/terraform-azurerm-materialize/releases/) + [v0.6.1](https://github.com/MaterializeInc/terraform-azurerm-materialize/releases/tag/v0.6.1) + "Notable changes": | + - Initial swap support. See upgrade notes for details. + +- "Terraform version": | + [v0.5.5](https://github.com/MaterializeInc/terraform-azurerm-materialize/releases/tag/v0.5.5) "Notable changes": | - Uses `terraform-helm-materialize` v0.1.26. - "Terraform version": | - [v0.5.4](https://github.com/MaterializeInc/terraform-azurerm-materialize/releases/) + [v0.5.4](https://github.com/MaterializeInc/terraform-azurerm-materialize/releases/tag/v0.5.4) "Notable changes": | - Uses `terraform-helm-materialize` v0.1.25. - "Terraform version": | - [v0.4.6](https://github.com/MaterializeInc/terraform-azurerm-materialize/releases/) + [v0.4.6](https://github.com/MaterializeInc/terraform-azurerm-materialize/releases/tag/v0.4.6) "Notable changes": | - Uses `terraform-helm-materialize` v0.1.19. @@ -22,7 +27,7 @@ rows: - Adds support for password authentication and enabling RBAC - "Terraform version": | - [v0.4.3](https://github.com/MaterializeInc/terraform-azurerm-materialize/releases/) + [v0.4.3](https://github.com/MaterializeInc/terraform-azurerm-materialize/releases/tag/v0.4.3) "Notable changes": | - Adds support for passing in additional Materialize instance configuration diff --git a/doc/user/data/self_managed/gcp_terraform_versions.yml b/doc/user/data/self_managed/gcp_terraform_versions.yml index 2cf5eb6ca7f12..7e9cefb78196e 100644 --- a/doc/user/data/self_managed/gcp_terraform_versions.yml +++ b/doc/user/data/self_managed/gcp_terraform_versions.yml @@ -4,17 +4,22 @@ columns: rows: - "Terraform version": | - [v0.5.5](https://github.com/MaterializeInc/terraform-google-materialize/releases/) + [v0.6.1](https://github.com/MaterializeInc/terraform-google-materialize/releases/tag/v0.6.1) + "Notable changes": | + - Initial swap support. See upgrade notes for details. + +- "Terraform version": | + [v0.5.5](https://github.com/MaterializeInc/terraform-google-materialize/releases/tag/v0.5.5) "Notable changes": | - Uses `terraform-helm-materialize` v0.1.26. - "Terraform version": | - [v0.5.4](https://github.com/MaterializeInc/terraform-google-materialize/releases/) + [v0.5.4](https://github.com/MaterializeInc/terraform-google-materialize/releases/tag/v0.5.4) "Notable changes": | - Uses `terraform-helm-materialize` v0.1.25. - "Terraform version": | - [v0.4.6](https://github.com/MaterializeInc/terraform-google-materialize/releases/) + [v0.4.6](https://github.com/MaterializeInc/terraform-google-materialize/releases/tag/v0.4.6) "Notable changes": | - Uses `terraform-helm-materialize` v0.1.19. @@ -22,7 +27,7 @@ rows: - Adds support for password authentication and enabling RBAC - "Terraform version": | - [v0.4.3](https://github.com/MaterializeInc/terraform-google-materialize/releases/) + [v0.4.3](https://github.com/MaterializeInc/terraform-google-materialize/releases/tag/v0.4.3) "Notable changes": | - Adds support for passing in additional Materialize instance configuration