-
Notifications
You must be signed in to change notification settings - Fork 235
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
feat: Add EMR runtime for flink operator blueprint #485
Changes from 1 commit
461b27a
4681e36
51eb6ba
883ef3d
b6987da
0fc6f27
3096d80
1ca710b
6a1cf6c
44a100b
ddf17e2
3cc5bad
880c182
a1ee994
978659a
3879966
527668b
6e91fea
7560e0c
5d0d834
cd38905
bfb8b37
b3538e1
dd43a6a
24585f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,9 @@ module "s3_bucket" { | |
source = "terraform-aws-modules/s3-bucket/aws" | ||
version = "~> 3.0" | ||
|
||
bucket_prefix = "${local.name}-flink-logs-" | ||
bucket_prefix = "${local.name}-" | ||
|
||
# For example only - please evaluate for your environment | ||
force_destroy = true | ||
|
||
attach_deny_insecure_transport_policy = true | ||
attach_require_latest_tls_policy = true | ||
attach_require_latest_tls_policy = true | ||
|
||
block_public_acls = true | ||
block_public_policy = true | ||
|
@@ -143,11 +139,27 @@ module "eks_blueprints_addons" { | |
# Data on EKS Kubernetes Addons | ||
#--------------------------------------------------------------- | ||
module "eks_data_addons" { | ||
|
||
depends_on = [module.flink_irsa_jobs, module.flink_irsa_operator] | ||
#source = "[email protected]:mithun008/terraform-aws-eks-data-addons/" | ||
source = "aws-ia/eks-data-addons/aws" | ||
version = "~> 1.30" # ensure to update this to the latest/desired version | ||
|
||
oidc_provider_arn = module.eks.oidc_provider_arn | ||
enable_karpenter_resources = true | ||
enable_emr_flink_operator = true | ||
emr_flink_operator_helm_config = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. replace this bloc with emr_flink_operator_helm_config = {
repository = "oci://public.ecr.aws/emr-on-eks"
operatorExecutionRoleArn = module.flink_irsa_operator.iam_role_arn
}
You can remove the |
||
namespace = "emr-flink-operator" | ||
create_namespace = true | ||
namespace = "${local.flink_operator}-ns" | ||
name = "flink-kubernetes-operator" | ||
repository = "oci://public.ecr.aws/emr-on-eks" | ||
chart = "flink-kubernetes-operator" | ||
operatorExecutionRoleArn = module.flink_irsa_operator.iam_role_arn | ||
|
||
|
||
} | ||
|
||
karpenter_resources_helm_config = { | ||
flink-compute-optimized = { | ||
values = [ | ||
|
@@ -207,6 +219,77 @@ module "eks_data_addons" { | |
EOT | ||
] | ||
} | ||
flink-graviton-memory-optimized = { | ||
values = [ | ||
<<-EOT | ||
name: flink-graviton-memory-optimized | ||
clusterName: ${module.eks.cluster_name} | ||
ec2NodeClass: | ||
karpenterRole: ${split("/", module.eks_blueprints_addons.karpenter.node_iam_role_arn)[1]} | ||
subnetSelectorTerms: | ||
tags: | ||
Name: "${module.eks.cluster_name}-private*" | ||
securityGroupSelectorTerms: | ||
tags: | ||
Name: ${module.eks.cluster_name}-node | ||
instanceStorePolicy: RAID0 | ||
nodePool: | ||
labels: | ||
- type: karpenter | ||
- NodeGroupType: FlinkGravitonMemoryOptimized | ||
- multiArch: Flink | ||
requirements: | ||
- key: "karpenter.sh/capacity-type" | ||
operator: In | ||
values: ["spot", "on-demand"] | ||
- key: "kubernetes.io/arch" | ||
operator: In | ||
values: ["arm64"] | ||
- key: "karpenter.k8s.aws/instance-category" | ||
operator: In | ||
values: ["r"] | ||
- key: "karpenter.k8s.aws/instance-family" | ||
operator: In | ||
values: ["r6gd"] | ||
- key: "karpenter.k8s.aws/instance-cpu" | ||
operator: In | ||
values: ["4", "8", "16", "32"] | ||
- key: "karpenter.k8s.aws/instance-hypervisor" | ||
operator: In | ||
values: ["nitro"] | ||
- key: "karpenter.k8s.aws/instance-generation" | ||
operator: Gt | ||
values: ["2"] | ||
limits: | ||
cpu: 1000 | ||
disruption: | ||
consolidationPolicy: WhenEmpty | ||
consolidateAfter: 30s | ||
expireAfter: 720h | ||
weight: 50 | ||
EOT | ||
] | ||
} | ||
} | ||
} | ||
|
||
resource "aws_s3_object" "checkpoints" { | ||
bucket = module.s3_bucket.s3_bucket_id | ||
key = "checkpoints/" | ||
content_type = "application/x-directory" | ||
} | ||
resource "aws_s3_object" "savepoints" { | ||
bucket = module.s3_bucket.s3_bucket_id | ||
key = "savepoints/" | ||
content_type = "application/x-directory" | ||
} | ||
resource "aws_s3_object" "jobmanager" { | ||
bucket = module.s3_bucket.s3_bucket_id | ||
key = "jobmanager/" | ||
content_type = "application/x-directory" | ||
} | ||
resource "aws_s3_object" "logs" { | ||
bucket = module.s3_bucket.s3_bucket_id | ||
key = "logs/" | ||
content_type = "application/x-directory" | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ metadata: | |
namespace: flink-team-a-ns | ||
spec: | ||
imagePullPolicy: Always | ||
emrReleaseLabel: "emr-7.0.0-flink-latest" | ||
emrReleaseLabel: "emr-7.1.0-flink-latest" | ||
flinkVersion: v1_18 | ||
flinkConfiguration: | ||
taskmanager.numberOfTaskSlots: "2" | ||
|
@@ -26,7 +26,7 @@ spec: | |
state.checkpoints.dir: s3://emr-flink-data/checkpoints | ||
state.savepoints.dir: s3://emr-flink-data/savepoints | ||
|
||
|
||
# Replace this execution role ARN with your own | ||
executionRoleArn: arn:aws:iam::xxxxxxxxx:role/emr-eks-flink-flink-team-a-20240406012025932700000008 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to provide instruction to replace this execution role ARN on top of the file as a NOTE |
||
jobManager: | ||
# Replace with s3 bucket in your own account | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ metadata: | |
namespace: flink-team-a-ns | ||
spec: | ||
imagePullPolicy: Always | ||
emrReleaseLabel: "emr-7.0.0-flink-latest" | ||
emrReleaseLabel: "emr-7.1.0-flink-latest" | ||
flinkVersion: v1_18 | ||
flinkConfiguration: | ||
taskmanager.numberOfTaskSlots: "2" | ||
|
@@ -26,8 +26,8 @@ spec: | |
state.checkpoints.dir: s3://emr-flink-data/checkpoints | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. <<REPLACE_WITH_S3_BUCKET_ID>> |
||
state.savepoints.dir: s3://emr-flink-data/savepoints | ||
|
||
|
||
executionRoleArn: arn:aws:iam::xxxxxxxxx:role/emr-eks-flink-flink-team-a-20240406012025932700000008 | ||
# Replace this execution role ARN with your own | ||
executionRoleArn: arn:aws:iam::681921237057:role/emr-eks-flink-flink-team-a-20240406012025932700000008 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should substitute this with variables, or provide instructions on how to generate the role arn (including the permissions). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have the instructions in the website docs to substitute these values. |
||
|
||
podTemplate: | ||
apiVersion: v1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done