Skip to content

Commit

Permalink
[DOM-59987] Update linux_user_data.tpl for singe-node based on AL2023 (
Browse files Browse the repository at this point in the history
…#288)

One of the changes from Amazon Linux 2 to Amazon Linux 2023 is switching to nodeadm for the initialization process. The single-node option sets some labels, so we're updating the linux_user_data.tpl to be in YAML format.

---------

Co-authored-by: Paul Johnson <[email protected]>
  • Loading branch information
urianchang and Paul Johnson authored Nov 14, 2024
1 parent a5c458e commit 07917e8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
7 changes: 3 additions & 4 deletions examples/tfvars/single-node.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ single_node = {
instance_type = "m6i.2xlarge"
name = "dev-v2"
ami = {
name_prefix = "dev-v2_"
owner = "977170443939"

name_prefix = "amazon-eks-node-al2023-x86_64-standard-"
owner = "602401143452"
}
labels = {
"dominodatalab.com/node-pool" = "default",
Expand All @@ -41,5 +40,5 @@ storage = {
}

eks = {
k8s_version = "1.27"
k8s_version = "1.30"
}
2 changes: 1 addition & 1 deletion modules/single-node/single-node.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ locals {
"cluster" = var.eks_info.cluster.specs.name
}, data.aws_default_tags.this.tags, local.node_labels)

kubelet_extra_args = "--kubelet-extra-args '--node-labels=${join(",", [for k, v in local.node_labels : format("%s=%s", k, v)])}'"
kubelet_extra_args = "--node-labels=${join(",", [for k, v in local.node_labels : format("%s=%s", k, v)])}"

bootstrap_extra_args = join(" ", [local.kubelet_extra_args, var.single_node.bootstrap_extra_args])
}
Expand Down
21 changes: 11 additions & 10 deletions modules/single-node/templates/linux_user_data.tpl
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash
set -e
${pre_bootstrap_user_data ~}
%{ if length(cluster_service_ipv4_cidr) > 0 ~}
export SERVICE_IPV4_CIDR=${cluster_service_ipv4_cidr}
%{ endif ~}
B64_CLUSTER_CA=${cluster_auth_base64}
API_SERVER_URL=${cluster_endpoint}
/etc/eks/bootstrap.sh ${cluster_name} ${bootstrap_extra_args} --b64-cluster-ca $B64_CLUSTER_CA --apiserver-endpoint $API_SERVER_URL
${post_bootstrap_user_data ~}
---
apiVersion: node.eks.aws/v1alpha1
kind: NodeConfig
spec:
cluster:
name: ${cluster_name}
apiServerEndpoint: ${cluster_endpoint}
certificateAuthority: ${cluster_auth_base64}
cidr: ${cluster_service_ipv4_cidr}
kubelet:
flags: ["${bootstrap_extra_args}"]
9 changes: 6 additions & 3 deletions tests/deploy/single-node/single-node.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ single_node = {
instance_type = "m6i.2xlarge"
name = "dev-v2"
ami = {
name_prefix = "dev-v2_"
owner = "977170443939"

name_prefix = "amazon-eks-node-al2023-x86_64-standard-"
owner = "602401143452"
}
labels = {
"dominodatalab.com/node-pool" = "default",
"dominodatalab.com/domino-node" = "true"
},
}

eks = {
k8s_version = "1.30"
}

0 comments on commit 07917e8

Please sign in to comment.