Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
ebeaty-cisco committed Dec 3, 2024
1 parent ac7a35e commit 58b1674
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 22 deletions.
2 changes: 1 addition & 1 deletion examples/ha/infra/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ data "aws_ami" "eks_optimized" {

filter {
name = "name"
values = ["amazon-eks-node-${data.aws_eks_cluster.this.version}-*"]
values = ["amazon-eks-node-al2023-x86_64-standard-${data.aws_eks_cluster.this.version}-*"]
}

filter {
Expand Down
4 changes: 4 additions & 0 deletions modules/aws/node/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ data "aws_ami" "this" {
data "aws_ec2_instance_type" "this" {
instance_type = var.instance_type
}

data "aws_eks_cluster" "this" {
name = var.cluster_name
}
18 changes: 4 additions & 14 deletions modules/aws/node/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,10 @@ resource "aws_instance" "this" {
user_data = templatefile(
"${path.module}/templates/user-data.tftpl",
{
xrd_bootstrap = local.is_xrd_ami
hugepages_gb = local.hugepages_gb
isolated_cores = local.isolated_cores
cluster_name = var.cluster_name
kubelet_extra_args = format(
"%s%s",
(
local.kubelet_node_labels_arg != null ?
"--node-labels ${local.kubelet_node_labels_arg}" :
""
),
var.kubelet_extra_args != null ? " ${var.kubelet_extra_args}" : "",
)
additional_user_data = var.user_data
name = data.aws_eks_cluster.this.name
api_endpoint = data.aws_eks_cluster.this.endpoint
certificate_authority = data.aws_eks_cluster.this.certificate_authority[0].data
cidr = data.aws_eks_cluster.this.vpc_config[0].public_access_cidr
}
)

Expand Down
16 changes: 9 additions & 7 deletions modules/aws/node/templates/user-data.tftpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash
%{~ if xrd_bootstrap }
HUGEPAGES_GB=${hugepages_gb} ISOLATED_CORES=${isolated_cores} /etc/xrd/bootstrap.sh
%{~ endif }
/etc/eks/bootstrap.sh ${cluster_name} --kubelet-extra-args '${kubelet_extra_args}'
${additional_user_data}
reboot
---
apiVersion: node.eks.aws/v1alpha1
kind: NodeConfig
spec:
cluster:
name: ${name}
apiServerEndpoint: ${api_endpoint}
certificateAuthority: ${certificate_authority}
cidr: ${cidr}
1 change: 1 addition & 0 deletions modules/aws/node/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,4 @@ variable "xrd_vr_cp_num_cpus" {
type = number
default = null
}
=

0 comments on commit 58b1674

Please sign in to comment.