Skip to content

Commit 299a84c

Browse files
Merge pull request #49 from MaterializeInc/cert-manager
Certificates
2 parents 898e1ca + f5a8cbf commit 299a84c

File tree

10 files changed

+309
-173
lines changed

10 files changed

+309
-173
lines changed

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,12 @@ disk_support_config = {
117117
| Name | Source | Version |
118118
|------|--------|---------|
119119
| <a name="module_aws_lbc"></a> [aws\_lbc](#module\_aws\_lbc) | ./modules/aws-lbc | n/a |
120+
| <a name="module_certificates"></a> [certificates](#module\_certificates) | ./modules/certificates | n/a |
120121
| <a name="module_database"></a> [database](#module\_database) | ./modules/database | n/a |
121122
| <a name="module_eks"></a> [eks](#module\_eks) | ./modules/eks | n/a |
122123
| <a name="module_networking"></a> [networking](#module\_networking) | ./modules/networking | n/a |
123124
| <a name="module_nlb"></a> [nlb](#module\_nlb) | ./modules/nlb | n/a |
124-
| <a name="module_operator"></a> [operator](#module\_operator) | github.com/MaterializeInc/terraform-helm-materialize | v0.1.8 |
125+
| <a name="module_operator"></a> [operator](#module\_operator) | github.com/MaterializeInc/terraform-helm-materialize | v0.1.9 |
125126
| <a name="module_storage"></a> [storage](#module\_storage) | ./modules/storage | n/a |
126127

127128
## Resources
@@ -144,6 +145,9 @@ disk_support_config = {
144145
| <a name="input_availability_zones"></a> [availability\_zones](#input\_availability\_zones) | List of availability zones | `list(string)` | <pre>[<br/> "us-east-1a",<br/> "us-east-1b",<br/> "us-east-1c"<br/>]</pre> | no |
145146
| <a name="input_bucket_force_destroy"></a> [bucket\_force\_destroy](#input\_bucket\_force\_destroy) | Enable force destroy for the S3 bucket | `bool` | `true` | no |
146147
| <a name="input_bucket_lifecycle_rules"></a> [bucket\_lifecycle\_rules](#input\_bucket\_lifecycle\_rules) | List of lifecycle rules for the S3 bucket | <pre>list(object({<br/> id = string<br/> enabled = bool<br/> prefix = string<br/> transition_days = number<br/> transition_storage_class = string<br/> noncurrent_version_expiration_days = number<br/> }))</pre> | <pre>[<br/> {<br/> "enabled": true,<br/> "id": "cleanup",<br/> "noncurrent_version_expiration_days": 90,<br/> "prefix": "",<br/> "transition_days": 90,<br/> "transition_storage_class": "STANDARD_IA"<br/> }<br/>]</pre> | no |
148+
| <a name="input_cert_manager_chart_version"></a> [cert\_manager\_chart\_version](#input\_cert\_manager\_chart\_version) | Version of the cert-manager helm chart to install. | `string` | `"v1.17.1"` | no |
149+
| <a name="input_cert_manager_install_timeout"></a> [cert\_manager\_install\_timeout](#input\_cert\_manager\_install\_timeout) | Timeout for installing the cert-manager helm chart, in seconds. | `number` | `300` | no |
150+
| <a name="input_cert_manager_namespace"></a> [cert\_manager\_namespace](#input\_cert\_manager\_namespace) | The name of the namespace in which cert-manager is or will be installed. | `string` | `"cert-manager"` | no |
147151
| <a name="input_cluster_enabled_log_types"></a> [cluster\_enabled\_log\_types](#input\_cluster\_enabled\_log\_types) | List of desired control plane logging to enable | `list(string)` | <pre>[<br/> "api",<br/> "audit",<br/> "authenticator",<br/> "controllerManager",<br/> "scheduler"<br/>]</pre> | no |
148152
| <a name="input_cluster_version"></a> [cluster\_version](#input\_cluster\_version) | Kubernetes version for the EKS cluster | `string` | `"1.32"` | no |
149153
| <a name="input_create_vpc"></a> [create\_vpc](#input\_create\_vpc) | Controls if VPC should be created (it affects almost all resources) | `bool` | `true` | no |
@@ -164,6 +168,7 @@ disk_support_config = {
164168
| <a name="input_helm_chart"></a> [helm\_chart](#input\_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 |
165169
| <a name="input_helm_values"></a> [helm\_values](#input\_helm\_values) | Additional Helm values to merge with defaults | `any` | `{}` | no |
166170
| <a name="input_install_aws_load_balancer_controller"></a> [install\_aws\_load\_balancer\_controller](#input\_install\_aws\_load\_balancer\_controller) | Whether to install the AWS Load Balancer Controller | `bool` | `true` | no |
171+
| <a name="input_install_cert_manager"></a> [install\_cert\_manager](#input\_install\_cert\_manager) | Whether to install cert-manager. | `bool` | `false` | no |
167172
| <a name="input_install_materialize_operator"></a> [install\_materialize\_operator](#input\_install\_materialize\_operator) | Whether to install the Materialize operator | `bool` | `true` | no |
168173
| <a name="input_install_metrics_server"></a> [install\_metrics\_server](#input\_install\_metrics\_server) | Whether to install the metrics-server for the Materialize Console | `bool` | `true` | no |
169174
| <a name="input_kubernetes_namespace"></a> [kubernetes\_namespace](#input\_kubernetes\_namespace) | The Kubernetes namespace for the Materialize resources | `string` | `"materialize-environment"` | no |
@@ -182,14 +187,15 @@ disk_support_config = {
182187
| <a name="input_node_group_min_size"></a> [node\_group\_min\_size](#input\_node\_group\_min\_size) | Minimum number of worker nodes | `number` | `1` | no |
183188
| <a name="input_operator_namespace"></a> [operator\_namespace](#input\_operator\_namespace) | Namespace for the Materialize operator | `string` | `"materialize"` | no |
184189
| <a name="input_operator_version"></a> [operator\_version](#input\_operator\_version) | Version of the Materialize operator to install | `string` | `null` | no |
185-
| <a name="input_orchestratord_version"></a> [orchestratord\_version](#input\_orchestratord\_version) | Version of the Materialize orchestrator to install | `string` | `"v0.130.4"` | no |
190+
| <a name="input_orchestratord_version"></a> [orchestratord\_version](#input\_orchestratord\_version) | Version of the Materialize orchestrator to install | `string` | `null` | no |
186191
| <a name="input_postgres_version"></a> [postgres\_version](#input\_postgres\_version) | Version of PostgreSQL to use | `string` | `"15"` | no |
187192
| <a name="input_private_subnet_cidrs"></a> [private\_subnet\_cidrs](#input\_private\_subnet\_cidrs) | CIDR blocks for private subnets | `list(string)` | <pre>[<br/> "10.0.1.0/24",<br/> "10.0.2.0/24",<br/> "10.0.3.0/24"<br/>]</pre> | no |
188193
| <a name="input_public_subnet_cidrs"></a> [public\_subnet\_cidrs](#input\_public\_subnet\_cidrs) | CIDR blocks for public subnets | `list(string)` | <pre>[<br/> "10.0.101.0/24",<br/> "10.0.102.0/24",<br/> "10.0.103.0/24"<br/>]</pre> | no |
189194
| <a name="input_service_account_name"></a> [service\_account\_name](#input\_service\_account\_name) | Name of the service account | `string` | `"12345678-1234-1234-1234-123456789012"` | no |
190195
| <a name="input_single_nat_gateway"></a> [single\_nat\_gateway](#input\_single\_nat\_gateway) | Use a single NAT Gateway for all private subnets | `bool` | `false` | no |
191196
| <a name="input_tags"></a> [tags](#input\_tags) | Default tags to apply to all resources | `map(string)` | <pre>{<br/> "Environment": "dev",<br/> "Project": "materialize",<br/> "Terraform": "true"<br/>}</pre> | no |
192197
| <a name="input_use_local_chart"></a> [use\_local\_chart](#input\_use\_local\_chart) | Whether to use a local chart instead of one from a repository | `bool` | `false` | no |
198+
| <a name="input_use_self_signed_cluster_issuer"></a> [use\_self\_signed\_cluster\_issuer](#input\_use\_self\_signed\_cluster\_issuer) | Whether to install and use a self-signed ClusterIssuer for TLS. Due to limitations in Terraform, this may not be enabled before the cert-manager CRDs are installed. | `bool` | `false` | no |
193199
| <a name="input_vpc_cidr"></a> [vpc\_cidr](#input\_vpc\_cidr) | CIDR block for VPC | `string` | `"10.0.0.0/16"` | no |
194200

195201
## Outputs
@@ -231,6 +237,20 @@ By default, Network Load Balancers are created for each Materialize instance, wi
231237

232238
The DNS name and ARN for the NLBs will be in the `terraform output` as `nlb_details`.
233239

240+
#### TLS support
241+
242+
For example purposes, optional TLS support is provided by using `cert-manager` and a self-signed `ClusterIssuer`.
243+
244+
More advanced TLS support using user-provided CAs or per-Materialize `Issuer`s are out of scope for this Terraform module. Please refer to the [cert-manager documentation](https://cert-manager.io/docs/configuration/) for detailed guidance on more advanced usage.
245+
246+
###### To enable installation of `cert-manager` and configuration of the self-signed `ClusterIssuer`
247+
1. Set `install_cert_manager` to `true`.
248+
1. Run `terraform apply`.
249+
1. Set `use_self_signed_cluster_issuer` to `true`.
250+
1. Run `terraform apply`.
251+
252+
Due to limitations in Terraform, it cannot plan Kubernetes resources using CRDs that do not exist yet. We need to first install `cert-manager` in the first `terraform apply`, before defining any `ClusterIssuer` or `Certificate` resources which get created in the second `terraform apply`.
253+
234254
## Upgrade Notes
235255

236256
#### v0.3.0

docs/footer.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@ By default, Network Load Balancers are created for each Materialize instance, wi
1717

1818
The DNS name and ARN for the NLBs will be in the `terraform output` as `nlb_details`.
1919

20+
#### TLS support
21+
22+
For example purposes, optional TLS support is provided by using `cert-manager` and a self-signed `ClusterIssuer`.
23+
24+
More advanced TLS support using user-provided CAs or per-Materialize `Issuer`s are out of scope for this Terraform module. Please refer to the [cert-manager documentation](https://cert-manager.io/docs/configuration/) for detailed guidance on more advanced usage.
25+
26+
###### To enable installation of `cert-manager` and configuration of the self-signed `ClusterIssuer`
27+
1. Set `install_cert_manager` to `true`.
28+
1. Run `terraform apply`.
29+
1. Set `use_self_signed_cluster_issuer` to `true`.
30+
1. Run `terraform apply`.
31+
32+
Due to limitations in Terraform, it cannot plan Kubernetes resources using CRDs that do not exist yet. We need to first install `cert-manager` in the first `terraform apply`, before defining any `ClusterIssuer` or `Certificate` resources which get created in the second `terraform apply`.
33+
2034
## Upgrade Notes
2135

2236
#### v0.3.0

docs/operator-tls-setup.md

Lines changed: 0 additions & 166 deletions
This file was deleted.

examples/simple/main.tf

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,15 @@ module "materialize_infrastructure" {
7979
enable_monitoring = true
8080
metrics_retention_days = 3
8181

82+
# Certificates
83+
install_cert_manager = var.install_cert_manager
84+
use_self_signed_cluster_issuer = var.use_self_signed_cluster_issuer
85+
8286
# Enable and configure Materialize operator
8387
install_materialize_operator = true
8488
operator_version = var.operator_version
8589
orchestratord_version = var.orchestratord_version
90+
helm_values = var.helm_values
8691

8792
# Once the operator is installed, you can define your Materialize instances here.
8893
materialize_instances = var.materialize_instances
@@ -100,6 +105,7 @@ resource "random_password" "pass" {
100105
special = false
101106
}
102107

108+
103109
variable "namespace" {
104110
description = "Namespace for the resources. Used to prefix the names of the resources"
105111
type = string
@@ -121,7 +127,7 @@ variable "operator_version" {
121127
variable "orchestratord_version" {
122128
description = "Version of the Materialize orchestrator to install"
123129
type = string
124-
default = "v0.130.4"
130+
default = null
125131
}
126132

127133
variable "materialize_instances" {
@@ -147,6 +153,24 @@ variable "materialize_instances" {
147153
default = []
148154
}
149155

156+
variable "helm_values" {
157+
description = "Additional Helm values to merge with defaults"
158+
type = any
159+
default = {}
160+
}
161+
162+
variable "install_cert_manager" {
163+
description = "Whether to install cert-manager."
164+
type = bool
165+
default = false
166+
}
167+
168+
variable "use_self_signed_cluster_issuer" {
169+
description = "Whether to install and use a self-signed ClusterIssuer for TLS. Due to limitations in Terraform, this may not be enabled before the cert-manager CRDs are installed."
170+
type = bool
171+
default = false
172+
}
173+
150174
# Outputs
151175
output "vpc_id" {
152176
description = "VPC ID"

0 commit comments

Comments
 (0)