Skip to content

Commit b426915

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

File tree

11 files changed

+122
-0
lines changed

11 files changed

+122
-0
lines changed

modules/terraform-cdp-deploy/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ No resources.
8787
| <a name="input_azure_xaccount_app_pword"></a> [azure\_xaccount\_app\_pword](#input\_azure\_xaccount\_app\_pword) | Password for the Azure AD Cross Account Application. Required for CDP deployment on Azure. | `string` | `null` | no |
8888
| <a name="input_azure_xaccount_app_uuid"></a> [azure\_xaccount\_app\_uuid](#input\_azure\_xaccount\_app\_uuid) | UUID for the Azure AD Cross Account Application. Required for CDP deployment on Azure. | `string` | `null` | no |
8989
| <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 |
90+
| <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 |
91+
| <a name="input_compute_cluster_enabled"></a> [compute\_cluster\_enabled](#input\_compute\_cluster\_enabled) | Enable externalized compute cluster for the environment | `bool` | `false` | no |
9092
| <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 |
9193
| <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 |
9294
| <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" {
@@ -97,6 +102,9 @@ module "cdp_deploy" {
97102
environment_async_creation = var.environment_async_creation
98103
datalake_async_creation = var.datalake_async_creation
99104

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

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

+20
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,26 @@ variable "cdp_groups" {
9797

9898
default = null
9999
}
100+
variable "compute_cluster_enabled" {
101+
type = bool
102+
103+
description = "Enable externalized compute cluster for the environment"
104+
105+
default = false
106+
}
107+
108+
variable "compute_cluster_configuration" {
109+
type = map(object({
110+
kube_api_authorized_ip_ranges = optional(set(string))
111+
private_cluster = optional(bool)
112+
worker_node_subnets = optional(set(string))
113+
}))
114+
115+
description = "Kubernetes configuration for the externalized compute cluster"
116+
117+
default = null
118+
}
119+
100120
# ------- Network Resources -------
101121
variable "ingress_extra_cidrs_and_ports" {
102122
type = object({

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

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

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

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

+18
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,24 @@ variable "cdp_groups" {
9393
]))
9494
error_message = "CDP group names can consist only of letters, numbers, dots (.), hyphens (-) and underscores (_)."
9595
}
96+
}
97+
variable "compute_cluster_enabled" {
98+
type = bool
99+
100+
description = "Enable externalized compute cluster for the environment"
101+
102+
default = false
103+
}
104+
105+
variable "compute_cluster_configuration" {
106+
type = map(object({
107+
kube_api_authorized_ip_ranges = optional(set(string))
108+
outbound_type = optional(string)
109+
private_cluster = optional(bool)
110+
worker_node_subnets = optional(set(string))
111+
}))
112+
113+
description = "Kubernetes configuration for the externalized compute cluster"
96114

97115
default = null
98116
}

modules/terraform-cdp-deploy/main.tf

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

8787
environment_cascading_delete = var.environment_cascading_delete
88+
89+
compute_cluster_enabled = var.compute_cluster_enabled
90+
compute_cluster_configuration = var.compute_cluster_configuration
8891
}
8992

9093
# ------- Call sub-module for Azure Deployment -------
@@ -177,6 +180,9 @@ module "cdp_on_azure" {
177180
datalake_flexible_server_delegated_subnet_name = var.azure_datalake_flexible_server_delegated_subnet_name
178181

179182
environment_cascading_delete = var.environment_cascading_delete
183+
184+
compute_cluster_enabled = var.compute_cluster_enabled
185+
compute_cluster_configuration = var.compute_cluster_configuration
180186
}
181187

182188
# ------- 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
@@ -280,6 +280,27 @@ variable "workload_analytics" {
280280
default = true
281281
}
282282

283+
variable "compute_cluster_enabled" {
284+
type = bool
285+
286+
description = "Enable externalized compute cluster for the environment"
287+
288+
default = false
289+
}
290+
291+
variable "compute_cluster_configuration" {
292+
type = object({
293+
kube_api_authorized_ip_ranges = optional(set(string))
294+
outbound_type = optional(string)
295+
private_cluster = optional(bool)
296+
worker_node_subnets = optional(set(string))
297+
})
298+
299+
description = "Kubernetes configuration for the externalized compute cluster"
300+
301+
default = null
302+
}
303+
283304
variable "datalake_scale" {
284305
type = string
285306

0 commit comments

Comments
 (0)