Skip to content

Add airflow mng #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ module "comet_eks" {

eks_druid_instance_type = var.eks_druid_instance_type
eks_druid_node_count = var.eks_druid_node_count
eks_airflow_instance_type = var.eks_airflow_instance_type
eks_airflow_node_count = var.eks_airflow_node_count
}

module "comet_elasticache" {
Expand Down
22 changes: 22 additions & 0 deletions modules/comet_eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,28 @@ module "eks" {
nodegroup_name = "druid"
}
iam_role_additional_policies = var.s3_enabled ? { comet_s3_access = var.comet_ec2_s3_iam_policy } : {}
},
airflow = {
name = "airflow"
instance_types = [var.eks_airflow_instance_type]
min_size = var.eks_airflow_node_count
max_size = var.eks_airflow_node_count
desired_size = var.eks_airflow_node_count
block_device_mappings = {
xvda = {
device_name = "/dev/xvda"
ebs = {
volume_size = var.eks_mng_disk_size
volume_type = local.volume_type
encrypted = local.volume_encrypted
delete_on_termination = local.volume_delete_on_termination
}
}
}
labels = {
nodegroup_name = "airflow"
}
iam_role_additional_policies = var.s3_enabled ? { comet_s3_access = var.comet_ec2_s3_iam_policy } : {}
}
} : {}
)
Expand Down
10 changes: 10 additions & 0 deletions modules/comet_eks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,14 @@ variable "eks_druid_instance_type" {
variable "eks_druid_node_count" {
description = "Instance count for EKS Druid nodes"
type = number
}

variable "eks_airflow_instance_type" {
description = "Instance type for EKS Airflow nodes"
type = string
}

variable "eks_airflow_node_count" {
description = "Instance count for EKS Airflow nodes"
type = number
}
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,18 @@ variable "eks_druid_node_count" {
default = 4
}

variable "eks_airflow_instance_type" {
description = "Instance type for EKS Airflow nodes"
type = string
default = "t3.medium"
}

variable "eks_airflow_node_count" {
description = "Instance count for EKS Airflow nodes"
type = number
default = 2
}

#### comet_elasticache ####
variable "elasticache_allow_from_sg" {
description = "Security group from which to allow connections to ElastiCache, to use when provisioning with existing compute"
Expand Down