Skip to content

Commit e0f9705

Browse files
committed
feat: Remove spegel layer configuration
1 parent fcec146 commit e0f9705

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

cluster_connect.sh.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fi
2121
--b64-cluster-ca ${base64_cluster_ca} \
2222
--apiserver-endpoint ${api_server_url}
2323

24-
%{ if discard_unpacked_layers == false }
24+
%{ if discard_unpacked_layers == false && ami_al2023 == false }
2525
# Retain unpacked layers. We avoid using the configuration merge capability of containerd due to a known bug.
2626
# For more details, refer to: https://github.com/containerd/containerd/issues/5837
2727
sed -i '/discard_unpacked_layers = true/s/true/false/' /etc/containerd/config.toml

node_group_advanced.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ resource "aws_iam_instance_profile" "quortex" {
6969
data "aws_ami" "eks_worker_image" {
7070
filter {
7171
name = "name"
72-
values = ["amazon-eks-node-al2023-x86_64-standard-${local.kubernetes_worker_nodes_version}-v*"]
72+
values = var.ami_al2023 ? ["amazon-eks-node-al2023-x86_64-standard-${local.kubernetes_worker_nodes_version}-v*"] : ["amazon-eks-node-${local.kubernetes_worker_nodes_version}-v*"]
7373
}
7474
most_recent = true
7575
owners = ["self", "amazon"]
@@ -125,6 +125,7 @@ resource "aws_launch_template" "quortex_launch_tpl" {
125125
cni_version = try(var.vpc_cni_addon.version, "")
126126
show_max_allowed = var.node_use_max_pods_allowed
127127
discard_unpacked_layers = var.discard_unpacked_layers
128+
ami_al2023 = var.ami_al2023
128129
}
129130
)
130131
}

userdata.sh.tpl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@ Content-Disposition: attachment; filename="cloud-config.txt"
1111
cloud_final_modules:
1212
- [scripts-user, always]
1313

14+
%{ if var.ami_al2023 && var.discard_unpacked_layers == false }
15+
--//
16+
Content-Type: application/node.eks.aws
17+
Mime-Version: 1.0
18+
Content-Transfer-Encoding: 7bit
19+
20+
---
21+
apiVersion: node.eks.aws/v1alpha1
22+
kind: NodeConfig
23+
spec:
24+
containerd:
25+
config: |
26+
[plugins."io.containerd.grpc.v1.cri".containerd]
27+
discard_unpacked_layers = false
28+
%{ endif }
29+
1430
--//
1531
Content-Type: text/x-shellscript; charset="us-ascii"
1632
MIME-Version: 1.0

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ variable "discard_unpacked_layers" {
216216
description = "Set to false to keep unpacked layers on the node after the image is pulled. By default, EKS will clean up the unpacked layers to save disk space."
217217
}
218218

219+
variable "ami_al2023" {
220+
description = "Whether to use Amazon Linux 2023 AMI for worker nodes (only applies to advanced_node_groups)."
221+
type = bool
222+
default = false
223+
}
224+
219225
variable "node_use_max_pods_allowed" {
220226
type = bool
221227
default = false

0 commit comments

Comments
 (0)