After deploying the infrastructure using this Terraform module, follow these steps to install the Materialize Operator on your EKS cluster.
kubectlconfigured to interact with your EKS cluster- Helm 3.2.0+
- AWS CLI configured with appropriate credentials
First, update your kubeconfig to connect to the newly created EKS cluster:
aws eks update-kubeconfig --name materialize-cluster --region <your-region>Note: the exact authentication method may vary depending on your EKS configuration. For example, you might have to add an IAM access entry to the EKS cluster.
Verify the connection:
kubectl get nodesThe Materialize Operator requires fast, locally-attached NVMe storage for optimal performance. We'll set up OpenEBS with LVM Local PV for managing local volumes.
- Install OpenEBS:
# Add the OpenEBS Helm repository
helm repo add openebs https://openebs.github.io/openebs
helm repo update
# Install OpenEBS with only Local PV enabled
helm install openebs --namespace openebs openebs/openebs \
--set engines.replicated.mayastor.enabled=false \
--create-namespace- Verify the installation:
kubectl get pods -n openebs -l role=openebs-lvmTODO: Add more detailed instructions for setting up LVM on Bottlerocket nodes.
If you're using the recommended Bottlerocket AMI with the Terraform module, the LVM configuration needs to be done through the Bottlerocket bootstrap container. This is automatically handled by the EKS module using the provided user data script.
To verify the LVM setup:
kubectl debug -it node/<node-name> --image=amazonlinux:2
chroot /host
lvsYou should see a volume group named instance-store-vg.
The Materialize Operator is installed automatically when you set the following in your Terraform configuration:
# Enable and configure Materialize Operator
install_materialize_operator = trueThis eliminates the need to manually install the operator via Helm. Make sure that this setting is enabled in your Terraform configuration before applying changes:
terraform applyYou can verify that the Materialize Operator is installed by running:
kubectl get pods -n materializeFor more details on installation and configuration, refer to the official Materialize documentation: Materialize AWS Installation Guide.
Alternatively, you can still install the operator manually using Helm.
Once the infrastructure and the Materialize Operator are installed, you can deploy Materialize environments by setting the materialize_instances variable in your Terraform configuration.
-
Define your Materialize instances in
terraform.tfvars:materialize_instances = [ { name = "analytics" namespace = "materialize-environment" database_name = "analytics_db" cpu_request = "2" memory_request = "4Gi" memory_limit = "4Gi" }, { name = "demo" namespace = "materialize-environment" database_name = "demo_db" cpu_request = "2" memory_request = "4Gi" memory_limit = "4Gi" } ]
-
Re-apply the Terraform configuration to deploy the Materialize environments:
terraform apply
Alternatively, you can manually deploy Materialize instances as described in the Materialize Operator Helm Chart Documentation.
You can check the status of the Materialize instances by running:
kubectl get pods -n materialize-environmentIf you encounter issues:
- Check operator logs:
kubectl logs -l app.kubernetes.io/name=materialize-operator -n materialize- Check environment logs:
kubectl logs -l app.kubernetes.io/name=environmentd -n materialize-environment- Verify the storage configuration:
kubectl get sc
kubectl get pv
kubectl get pvc -ADelete the Materialize environment:
kubectl delete -f materialize-environment.yamlTo uninstall the Materialize operator:
terraform destroyThis will remove all associated resources, including the operator and any deployed Materialize instances.
For more details, visit the Materialize documentation.