Skip to content

MaterializeInc/terraform-helm-materialize

Repository files navigation

terraform-helm-materialize

Terraform module for installing the Materialize Helm chart

Terraform module for installing the Materialize Helm Chart

This module installs the Materialize Helm chart into a Kubernetes cluster using Terraform.

Instance Rollout Options

The module supports several rollout strategies for Materialize instances through the following configuration options:

in_place_rollout (bool)

  • When false (default): Performs a rolling upgrade by creating new instances before terminating old ones. This minimizes downtime but requires additional cluster resources during the transition.
  • When true: Performs an in-place upgrade by directly replacing existing instances. This requires less resources but causes downtime.

request_rollout (string)

  • Triggers a rollout only when there are actual changes to the instance (e.g., image updates)
  • Requires a valid UUID in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  • Must be changed to a new UUID value for each rollout

force_rollout (string)

  • Triggers a rollout regardless of whether there are changes to the instance
  • Useful for debugging or forcing a restart of instances
  • Requires a valid UUID in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  • Must be changed to a new UUID value for each rollout

To use these options, set the appropriate values in the instances input variable and when you want to rollout a new version of the instance, set the request_rollout or force_rollout value to a new UUID.

Requirements

Name Version
terraform >= 1.0
aws ~> 5.0
helm ~> 2.0
kubernetes ~> 2.0

Providers

Name Version
helm 2.17.0
kubernetes 2.35.1

Modules

No modules.

Resources

Name Type
helm_release.materialize_operator resource
helm_release.metrics_server resource
kubernetes_job.db_init_job resource
kubernetes_manifest.materialize_instances resource
kubernetes_namespace.instance_namespaces resource
kubernetes_namespace.materialize resource
kubernetes_namespace.monitoring resource
kubernetes_secret.materialize_backends resource

Inputs

Name Description Type Default Required
environment Environment name string n/a yes
helm_chart Chart name from repository or local path to chart. For local charts, set the path to the chart directory. string "materialize-operator" no
helm_repository Repository URL for the Materialize operator Helm chart. Leave empty if using local chart. string "https://materializeinc.github.io/materialize/" no
helm_values Values to pass to the Helm chart any n/a yes
install_metrics_server Whether to install the metrics-server bool true no
instances Configuration for Materialize instances
list(object({
name = string
namespace = optional(string)
create_database = optional(bool, true)
database_name = string
metadata_backend_url = string
persist_backend_url = string
environmentd_version = optional(string, "v0.130.1")
cpu_request = optional(string, "1")
memory_request = optional(string, "1Gi")
memory_limit = optional(string, "1Gi")
in_place_rollout = optional(bool, false)
request_rollout = optional(string)
force_rollout = optional(string)
}))
[] no
metrics_server_version Version of metrics-server to install string "3.12.2" no
monitoring_namespace Namespace for monitoring resources string "monitoring" no
namespace Namespace prefix for all resources string n/a yes
operator_namespace Namespace for the Materialize operator string "materialize" no
operator_version Version of the Materialize operator to install string "v25.1.0" no
postgres_version Postgres version to use for the metadata backend string "15" no
use_local_chart Whether to use a local chart instead of one from a repository bool false no

Outputs

Name Description
materialize_instances Details of created Materialize instances
operator_namespace Namespace where the operator is installed
operator_release_name Helm release name of the operator
operator_release_status Status of the helm release

Chart Installation for Development

By default, the module installs the Materialize chart from a remote Helm repository, requiring no additional configuration.

For development and testing, you can use a local chart by specifying a local path:

module "materialize" {
  # ... other configuration ...
  use_local_chart = true
  helm_chart      = "./path/to/local/chart"
}

This allows you to modify and test the chart locally before deploying it in a production environment.