Skip to content

Latest commit

 

History

History
164 lines (117 loc) · 4.77 KB

operator-setup.md

File metadata and controls

164 lines (117 loc) · 4.77 KB

Installing the Materialize Operator

After deploying the infrastructure using this Terraform module, follow these steps to install the Materialize Operator on your EKS cluster.

Prerequisites

  • kubectl configured to interact with your EKS cluster
  • Helm 3.2.0+
  • AWS CLI configured with appropriate credentials

Configure kubectl

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 nodes

(Optional) Storage Configuration

The Materialize Operator requires fast, locally-attached NVMe storage for optimal performance. We'll set up OpenEBS with LVM Local PV for managing local volumes.

  1. 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
  1. Verify the installation:
kubectl get pods -n openebs -l role=openebs-lvm

LVM Configuration for AWS Bottlerocket nodes

TODO: 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
lvs

You should see a volume group named instance-store-vg.

Install the Materialize Operator

The Materialize Operator is installed automatically when you set the following in your Terraform configuration:

# Enable and configure Materialize Operator
install_materialize_operator = true

This 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 apply

You can verify that the Materialize Operator is installed by running:

kubectl get pods -n materialize

For 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.

Deploying Materialize Environments

Once the infrastructure and the Materialize Operator are installed, you can deploy Materialize environments by setting the materialize_instances variable in your Terraform configuration.

  1. 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"
      }
    ]
  2. 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-environment

Troubleshooting

If you encounter issues:

  1. Check operator logs:
kubectl logs -l app.kubernetes.io/name=materialize-operator -n materialize
  1. Check environment logs:
kubectl logs -l app.kubernetes.io/name=environmentd -n materialize-environment
  1. Verify the storage configuration:
kubectl get sc
kubectl get pv
kubectl get pvc -A

Cleanup

Delete the Materialize environment:

kubectl delete -f materialize-environment.yaml

To uninstall the Materialize operator:

terraform destroy

This will remove all associated resources, including the operator and any deployed Materialize instances.

For more details, visit the Materialize documentation.