Skip to content

Commit db4890e

Browse files
committed
feat: Set discard_unpacked_layers and single_process_oom_kill inside node group advanced
1 parent 24aaf82 commit db4890e

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

node_group_advanced.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ resource "aws_launch_template" "quortex_launch_tpl" {
9999
cluster_endpoint = aws_eks_cluster.quortex.endpoint
100100
cluster_auth_base64 = aws_eks_cluster.quortex.certificate_authority[0].data
101101
cluster_service_cidr = aws_eks_cluster.quortex.kubernetes_network_config[0].service_ipv4_cidr
102-
discard_unpacked_layers = var.discard_unpacked_layers
102+
discard_unpacked_layers = tobool(lookup(each.value, "discard_unpacked_layers", true))
103+
single_process_oom_kill = tobool(lookup(each.value, "single_process_oom_kill", false))
103104
# define the k8s node taints (passed to --kubelet-extra-args)
104105
node_taints = length(each.value.taints) == 0 ? "" : join(",", [for k, v in lookup(each.value, "taints", {}) : "${k}=${v}"])
105106
# define the k8s node labels (passed to --kubelet-extra-args)
@@ -153,7 +154,7 @@ resource "aws_launch_template" "quortex_launch_tpl" {
153154
use_max_pods = var.node_use_max_pods
154155
cni_version = try(var.vpc_cni_addon.version, "")
155156
show_max_allowed = var.node_use_max_pods_allowed
156-
discard_unpacked_layers = var.discard_unpacked_layers
157+
discard_unpacked_layers = lookup(each.value, "discard_unpacked_layers", true)
157158
}
158159
)
159160
}

templates/al2023_user_data.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ spec:
1111
flags:
1212
- --node-labels=${node_labels}
1313
- --register-with-taints=${node_taints}
14+
%{ if single_process_oom_kill == true }
15+
config:
16+
singleProcessOOMKill: true
17+
%{ endif }
1418
%{ if discard_unpacked_layers == false }
1519
containerd:
1620
config: |

variables.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,6 @@ variable "node_use_max_pods" {
210210
description = "Set to false to prevent EKS from setting --max-pods in Kubelet config. By default, EKS sets the maximum number of pods that can run on the node, based on the instance type. Disabling this can be useful when using a CNI other than the default, like Calico."
211211
}
212212

213-
variable "discard_unpacked_layers" {
214-
type = bool
215-
default = true
216-
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."
217-
}
218-
219213
variable "ami_al2023" {
220214
description = "Whether to use Amazon Linux 2023 AMI for worker nodes (only applies to advanced_node_groups)."
221215
type = bool

0 commit comments

Comments
 (0)