Skip to content

Commit ae0392e

Browse files
committed
Add support for externalized compute clusters to cdp_deploy module
Signed-off-by: Jim Enright <[email protected]>
1 parent 47d968e commit ae0392e

File tree

11 files changed

+126
-0
lines changed

11 files changed

+126
-0
lines changed

modules/terraform-cdp-deploy/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ No resources.
8888
| <a name="input_cdp_admin_group_name"></a> [cdp\_admin\_group\_name](#input\_cdp\_admin\_group\_name) | Name of the CDP IAM Admin Group associated with the environment. Defaults to '<env\_prefix>-cdp-admin-group' if not specified. | `string` | `null` | no |
8989
| <a name="input_cdp_user_group_name"></a> [cdp\_user\_group\_name](#input\_cdp\_user\_group\_name) | Name of the CDP IAM User Group associated with the environment. Defaults to '<env\_prefix>-cdp-user-group' if not specified. | `string` | `null` | no |
9090
| <a name="input_cdp_xacccount_credential_name"></a> [cdp\_xacccount\_credential\_name](#input\_cdp\_xacccount\_credential\_name) | Name of the CDP Cross Account Credential. Defaults to '<env\_prefix>-xaccount-cred' if not specified. If create\_cdp\_credential is set to false then this should should be a valid pre-existing credential. | `string` | `null` | no |
91+
| <a name="input_compute_cluster_configuration"></a> [compute\_cluster\_configuration](#input\_compute\_cluster\_configuration) | Kubernetes configuration for the externalized compute cluster | <pre>object({<br> kube_api_authorized_ip_ranges = optional(set(string))<br> outbound_type = optional(string)<br> private_cluster = optional(bool)<br> worker_node_subnets = optional(set(string))<br> })</pre> | `null` | no |
92+
| <a name="input_compute_cluster_enabled"></a> [compute\_cluster\_enabled](#input\_compute\_cluster\_enabled) | Enable externalized compute cluster for the environment | `bool` | `false` | no |
9193
| <a name="input_create_cdp_credential"></a> [create\_cdp\_credential](#input\_create\_cdp\_credential) | Flag to specify if the CDP Cross Account Credential should be created. If set to false then cdp\_xacccount\_credential\_name should be a valid pre-existing credential. | `bool` | `true` | no |
9294
| <a name="input_datalake_async_creation"></a> [datalake\_async\_creation](#input\_datalake\_async\_creation) | Flag to specify if Terraform should wait for CDP datalake resource creation/deletion | `bool` | `false` | no |
9395
| <a name="input_datalake_call_failure_threshold"></a> [datalake\_call\_failure\_threshold](#input\_datalake\_call\_failure\_threshold) | Threshold value that specifies how many times should a single CDP Datalake API call failure happen before giving up the polling | `number` | `3` | no |

modules/terraform-cdp-deploy/examples/ex01-aws-basic/main.tf

+8
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ terraform {
4040

4141
provider "aws" {
4242
region = var.aws_region
43+
44+
# ignore tags created by data services
45+
ignore_tags {
46+
key_prefixes = ["kubernetes.io/cluster"]
47+
}
4348
}
4449

4550
module "cdp_aws_prereqs" {
@@ -96,6 +101,9 @@ module "cdp_deploy" {
96101
environment_async_creation = var.environment_async_creation
97102
datalake_async_creation = var.datalake_async_creation
98103

104+
compute_cluster_enabled = var.compute_cluster_enabled
105+
compute_cluster_configuration = var.compute_cluster_configuration
106+
99107
# From pre-reqs module output
100108
aws_vpc_id = module.cdp_aws_prereqs.aws_vpc_id
101109
aws_public_subnet_ids = module.cdp_aws_prereqs.aws_public_subnet_ids

modules/terraform-cdp-deploy/examples/ex01-aws-basic/variables.tf

+21
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,27 @@ variable "datalake_async_creation" {
6868

6969
default = false
7070
}
71+
72+
variable "compute_cluster_enabled" {
73+
type = bool
74+
75+
description = "Enable externalized compute cluster for the environment"
76+
77+
default = false
78+
}
79+
80+
variable "compute_cluster_configuration" {
81+
type = map(object({
82+
kube_api_authorized_ip_ranges = optional(set(string))
83+
private_cluster = optional(bool)
84+
worker_node_subnets = optional(set(string))
85+
}))
86+
87+
description = "Kubernetes configuration for the externalized compute cluster"
88+
89+
default = null
90+
}
91+
7192
# ------- Network Resources -------
7293
variable "ingress_extra_cidrs_and_ports" {
7394
type = object({

modules/terraform-cdp-deploy/examples/ex02-azure-basic/main.tf

+3
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ module "cdp_deploy" {
8787
environment_async_creation = var.environment_async_creation
8888
datalake_async_creation = var.datalake_async_creation
8989

90+
compute_cluster_enabled = var.compute_cluster_enabled
91+
compute_cluster_configuration = var.compute_cluster_configuration
92+
9093
# From pre-reqs module output
9194
azure_subscription_id = module.cdp_azure_prereqs.azure_subscription_id
9295
azure_tenant_id = module.cdp_azure_prereqs.azure_tenant_id

modules/terraform-cdp-deploy/examples/ex02-azure-basic/variables.tf

+21
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,27 @@ variable "datalake_async_creation" {
6767

6868
default = false
6969
}
70+
71+
variable "compute_cluster_enabled" {
72+
type = bool
73+
74+
description = "Enable externalized compute cluster for the environment"
75+
76+
default = false
77+
}
78+
79+
variable "compute_cluster_configuration" {
80+
type = map(object({
81+
kube_api_authorized_ip_ranges = optional(set(string))
82+
outbound_type = optional(string)
83+
private_cluster = optional(bool)
84+
worker_node_subnets = optional(set(string))
85+
}))
86+
87+
description = "Kubernetes configuration for the externalized compute cluster"
88+
89+
default = null
90+
}
7091
# ------- Network Resources -------
7192
variable "ingress_extra_cidrs_and_ports" {
7293
type = object({

modules/terraform-cdp-deploy/main.tf

+6
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ module "cdp_on_aws" {
8686
datalake_recipes = var.datalake_recipes
8787

8888
environment_cascading_delete = var.environment_cascading_delete
89+
90+
compute_cluster_enabled = var.compute_cluster_enabled
91+
compute_cluster_configuration = var.compute_cluster_configuration
8992
}
9093

9194
# ------- Call sub-module for Azure Deployment -------
@@ -179,6 +182,9 @@ module "cdp_on_azure" {
179182
datalake_flexible_server_delegated_subnet_name = var.azure_datalake_flexible_server_delegated_subnet_name
180183

181184
environment_cascading_delete = var.environment_cascading_delete
185+
186+
compute_cluster_enabled = var.compute_cluster_enabled
187+
compute_cluster_configuration = var.compute_cluster_configuration
182188
}
183189

184190
# ------- Call sub-module for GCP Deployment -------

modules/terraform-cdp-deploy/modules/aws/main.tf

+5
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ resource "cdp_environments_aws_environment" "cdp_env" {
6161
os = var.freeipa_os
6262
}
6363

64+
compute_cluster = {
65+
enabled = var.compute_cluster_enabled
66+
configuration = var.compute_cluster_configuration
67+
}
68+
6469
proxy_config_name = var.proxy_config_name
6570
s3_guard_table_name = var.s3_guard_table_name
6671
workload_analytics = var.workload_analytics

modules/terraform-cdp-deploy/modules/aws/variables.tf

+17
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,23 @@ variable "workload_analytics" {
178178

179179
}
180180

181+
variable "compute_cluster_enabled" {
182+
type = bool
183+
184+
description = "Enable externalized compute cluster for the environment"
185+
186+
}
187+
188+
variable "compute_cluster_configuration" {
189+
type = object({
190+
kube_api_authorized_ip_ranges = optional(set(string))
191+
private_cluster = optional(bool)
192+
worker_node_subnets = optional(set(string))
193+
})
194+
195+
description = "Kubernetes configuration for the externalized compute cluster"
196+
}
197+
181198
variable "datalake_scale" {
182199
type = string
183200

modules/terraform-cdp-deploy/modules/azure/main.tf

+5
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ resource "cdp_environments_azure_environment" "cdp_env" {
8282
os = var.freeipa_os
8383
}
8484

85+
compute_cluster = {
86+
enabled = var.compute_cluster_enabled
87+
configuration = var.compute_cluster_configuration
88+
}
89+
8590
proxy_config_name = var.proxy_config_name
8691
workload_analytics = var.workload_analytics
8792
enable_tunnel = var.enable_ccm_tunnel

modules/terraform-cdp-deploy/modules/azure/variables.tf

+17
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,23 @@ variable "proxy_config_name" {
212212

213213
}
214214

215+
variable "compute_cluster_enabled" {
216+
type = bool
217+
218+
description = "Enable externalized compute cluster for the environment"
219+
220+
}
221+
222+
variable "compute_cluster_configuration" {
223+
type = object({
224+
kube_api_authorized_ip_ranges = optional(set(string))
225+
outbound_type = optional(string)
226+
private_cluster = optional(bool)
227+
worker_node_subnets = optional(set(string))
228+
})
229+
230+
description = "Kubernetes configuration for the externalized compute cluster"
231+
}
215232

216233
variable "datalake_scale" {
217234
type = string

modules/terraform-cdp-deploy/variables.tf

+21
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,27 @@ variable "workload_analytics" {
287287
default = true
288288
}
289289

290+
variable "compute_cluster_enabled" {
291+
type = bool
292+
293+
description = "Enable externalized compute cluster for the environment"
294+
295+
default = false
296+
}
297+
298+
variable "compute_cluster_configuration" {
299+
type = object({
300+
kube_api_authorized_ip_ranges = optional(set(string))
301+
outbound_type = optional(string)
302+
private_cluster = optional(bool)
303+
worker_node_subnets = optional(set(string))
304+
})
305+
306+
description = "Kubernetes configuration for the externalized compute cluster"
307+
308+
default = null
309+
}
310+
290311
variable "datalake_scale" {
291312
type = string
292313

0 commit comments

Comments
 (0)