Skip to content

Commit

Permalink
Support user data for eks nodes (#9)
Browse files Browse the repository at this point in the history
* Add an example of adding EKS nodes pre_bootstrap_user_data for custom code before kubelet starts
  • Loading branch information
eldada authored Dec 9, 2024
1 parent 06c8018 commit bdd5a92
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion 5.aws-eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,15 @@ module "eks" {
subnet_ids = module.vpc.private_subnets

eks_managed_node_group_defaults = {
ami_type = "AL2_x86_64"
ami_type = "AL2_ARM_64"
iam_role_additional_policies = {
AmazonEBSCSIDriverPolicy = "arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy"
}

pre_bootstrap_user_data = <<-EOF
# This script will run on all nodes before the kubelet starts
echo "It works!" > /tmp/pre_bootstrap_user_data.txt
EOF
}

eks_managed_node_groups = {
Expand Down
4 changes: 4 additions & 0 deletions 6.artifactory-aws-install/eks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ module "eks" {
}
}
}
pre_bootstrap_user_data = <<-EOF
# This script will run on all nodes before the kubelet starts
echo "It works!" > /tmp/pre_bootstrap_user_data.txt
EOF
tags = {
Group = var.common_tag
}
Expand Down
4 changes: 4 additions & 0 deletions 7.jfrog-platform-aws-install/eks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ module "eks" {
}
}
}
pre_bootstrap_user_data = <<-EOF
# This script will run on all nodes before the kubelet starts
echo "It works!" > /tmp/pre_bootstrap_user_data.txt
EOF
tags = {
Group = var.common_tag
}
Expand Down

0 comments on commit bdd5a92

Please sign in to comment.