Skip to content

Commit d82e91e

Browse files
committed
Update operator setup guide to include helm install via terraform
1 parent 8b15fc0 commit d82e91e

File tree

1 file changed

+50
-103
lines changed

1 file changed

+50
-103
lines changed

docs/operator-setup.md

Lines changed: 50 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -62,118 +62,67 @@ You should see a volume group named `instance-store-vg`.
6262

6363
## Install the Materialize Operator
6464

65-
0. Clone the Materialize repository:
66-
```bash
67-
[email protected]:MaterializeInc/materialize.git
68-
cd materialize
69-
```
65+
The Materialize Operator is installed automatically when you set the following in your Terraform configuration:
7066

71-
1. Create a values file for the Helm installation (save as `materialize-values.yaml`):
72-
```yaml
73-
operator:
74-
cloudProvider:
75-
type: "aws"
76-
region: "<your-aws-region>" # e.g. us-west-2
77-
providers:
78-
aws:
79-
enabled: true
80-
accountID: "<your-aws-account-id>" # e.g. 123456789012
81-
iam:
82-
roles:
83-
environment: "<output.materialize_s3_role_arn>" # e.g. arn:aws:iam::123456789012:role/materialize-s3-role
84-
85-
namespace:
86-
create: true
87-
name: "materialize"
88-
89-
# Adjust network policies as needed
90-
networkPolicies:
91-
enabled: true
92-
egress:
93-
enabled: true
94-
cidrs: ["0.0.0.0/0"]
95-
ingress:
96-
enabled: true
97-
cidrs: ["0.0.0.0/0"]
98-
internal:
99-
enabled: true
100-
101-
# Uncomment the following block to configure OpenEBS storage
102-
# storage:
103-
# storageClass:
104-
# create: true
105-
# name: "openebs-lvm-instance-store-ext4"
106-
# provisioner: "local.csi.openebs.io"
107-
# parameters:
108-
# storage: "lvm"
109-
# fsType: "ext4"
110-
# volgroup: "instance-store-vg"
111-
# volumeBindingMode: "WaitForFirstConsumer"
67+
```hcl
68+
# Enable and configure Materialize Operator
69+
install_materialize_operator = true
11270
```
11371

114-
2. Install the Materialize Operator:
72+
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:
73+
11574
```bash
116-
helm install materialize-operator misc/helm-charts/operator \
117-
-f materialize-values.yaml
75+
terraform apply
11876
```
11977

120-
3. Verify the installation:
78+
You can verify that the Materialize Operator is installed by running:
79+
12180
```bash
12281
kubectl get pods -n materialize
12382
```
12483

125-
## Deploy a Materialize Environment
126-
127-
1. Create a secret with the backend configuration (save as `materialize-backend-secret.yaml`):
128-
```yaml
129-
apiVersion: v1
130-
kind: Secret
131-
metadata:
132-
name: materialize-backend
133-
namespace: materialize-environment
134-
stringData:
135-
metadata_backend_url: "${terraform_output.metadata_backend_url}"
136-
persist_backend_url: "${terraform_output.persist_backend_url}"
137-
```
84+
For more details on installation and configuration, refer to the official Materialize documentation: [Materialize AWS Installation Guide](https://materialize.com/docs/self-managed/v25.1/installation/install-on-aws/).
13885

139-
> Replace `${terraform_output.metadata_backend_url}` and `${terraform_output.persist_backend_url}` with the actual values from the Terraform output.
140-
141-
2. Create a Materialize environment (save as `materialize-environment.yaml`):
142-
```yaml
143-
apiVersion: materialize.cloud/v1alpha1
144-
kind: Materialize
145-
metadata:
146-
name: "${var.service_account_name}"
147-
namespace: materialize-environment
148-
spec:
149-
environmentdImageRef: materialize/environmentd:latest
150-
environmentdResourceRequirements:
151-
limits:
152-
memory: 16Gi
153-
requests:
154-
cpu: "2"
155-
memory: 16Gi
156-
balancerdResourceRequirements:
157-
limits:
158-
memory: 256Mi
159-
requests:
160-
cpu: "100m"
161-
memory: 256Mi
162-
backendSecretName: materialize-backend
163-
```
86+
Alternatively, you can still install the [operator manually using Helm](https://github.com/MaterializeInc/materialize/tree/main/misc/helm-charts/operator#installing-the-chart).
16487

165-
> Replace `${var.service_account_name}` with the desired name for the Materialize environment. It should be a UUID, eg `12345678-1234-1234-1234-123456789012`.
88+
## Deploying Materialize Environments
16689

167-
3. Apply the configuration:
168-
```bash
169-
kubectl create namespace materialize-environment
170-
kubectl apply -f materialize-backend-secret.yaml
171-
kubectl apply -f materialize-environment.yaml
172-
```
90+
Once the infrastructure and the Materialize Operator are installed, you can deploy Materialize environments by setting the `materialize_instances` variable in your Terraform configuration.
91+
92+
1. Define your Materialize instances in `terraform.tfvars`:
93+
94+
```hcl
95+
materialize_instances = [
96+
{
97+
name = "analytics"
98+
namespace = "materialize-environment"
99+
database_name = "analytics_db"
100+
cpu_request = "2"
101+
memory_request = "4Gi"
102+
memory_limit = "4Gi"
103+
},
104+
{
105+
name = "demo"
106+
namespace = "materialize-environment"
107+
database_name = "demo_db"
108+
cpu_request = "2"
109+
memory_request = "4Gi"
110+
memory_limit = "4Gi"
111+
}
112+
]
113+
```
114+
115+
2. Re-apply the Terraform configuration to deploy the Materialize environments:
116+
117+
```bash
118+
terraform apply
119+
```
120+
121+
Alternatively, you can manually deploy Materialize instances as described in the [Materialize Operator Helm Chart Documentation](https://github.com/MaterializeInc/materialize/tree/main/misc/helm-charts/operator#installing-the-chart).
122+
123+
You can check the status of the Materialize instances by running:
173124

174-
4. Monitor the deployment:
175125
```bash
176-
kubectl get materializes -n materialize-environment
177126
kubectl get pods -n materialize-environment
178127
```
179128

@@ -207,11 +156,9 @@ kubectl delete -f materialize-environment.yaml
207156

208157
To uninstall the Materialize operator:
209158
```bash
210-
helm uninstall materialize-operator -n materialize
159+
terraform destroy
211160
```
212161

213-
This will remove the operator but preserve any PVs and data. To completely clean up:
214-
```bash
215-
kubectl delete namespace materialize
216-
kubectl delete namespace materialize-environment
217-
```
162+
This will remove all associated resources, including the operator and any deployed Materialize instances.
163+
164+
For more details, visit the [Materialize documentation](https://materialize.com/docs/self-managed/v25.1/installation/install-on-aws/).

0 commit comments

Comments
 (0)