From 3e572d6e2bdcc738dc51d1b86928bb1c2b20653a Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Mon, 19 Aug 2024 20:13:33 -0400 Subject: [PATCH] updates from docs --- ec2_node_class.yaml.tpl | 4 ++- ec2_node_pool.yaml.tpl | 56 ++++++++++++++++++----------------------- 2 files changed, 27 insertions(+), 33 deletions(-) diff --git a/ec2_node_class.yaml.tpl b/ec2_node_class.yaml.tpl index facebf0..4251292 100644 --- a/ec2_node_class.yaml.tpl +++ b/ec2_node_class.yaml.tpl @@ -3,6 +3,8 @@ apiVersion: karpenter.k8s.aws/v1 kind: EC2NodeClass metadata: name: ${cluster_name}-karpenter-node-class + annotations: + kubernetes.io/description: "EC2NodeClass for running Bottlerocket nodes" spec: kubelet: podsPerCore: 2 @@ -35,7 +37,7 @@ spec: # Required, resolves a default ami and userdata amiFamily: ${amd_ami_family} amiSelectorTerms: - - alias: bottlerocket@latest + - alias: bottlerocket@latest # Bottlerocket # Required, discovers subnets to attach to instances # Each term in the array of subnetSelectorTerms is ORed together # Within a single term, all conditions are ANDed diff --git a/ec2_node_pool.yaml.tpl b/ec2_node_pool.yaml.tpl index 88285f4..0da0ee8 100644 --- a/ec2_node_pool.yaml.tpl +++ b/ec2_node_pool.yaml.tpl @@ -3,40 +3,32 @@ apiVersion: karpenter.sh/v1 kind: NodePool metadata: name: ${cluster_name}-node-pool-general + annotations: + kubernetes.io/description: "General purpose NodePool for generic workloads" spec: - disruption: - consolidationPolicy: WhenUnderutilized - expireAfter: 1h template: spec: + requirements: + - key: kubernetes.io/arch + operator: In + values: ["amd64"] + - key: kubernetes.io/os + operator: In + values: ["linux"] + - key: karpenter.sh/capacity-type + operator: In + values: ["on-demand", "spot"] + - key: karpenter.k8s.aws/instance-category + operator: In + values: ["c", "m", "r", "t"] + - key: karpenter.k8s.aws/instance-generation + operator: Gt + values: ["2"] nodeClassRef: + group: karpenter.k8s.aws + kind: EC2NodeClass name: ${cluster_name}-karpenter-node-class - requirements: - - key: node.kubernetes.io/instance-type - operator: In - values: - - m5.large - - m5.xlarge - - m5.2xlarge - - c5.large - - c5.xlarge - - c5a.large - - c5a.xlarge - - r5.large - - r5.xlarge - - t3.xlarge - - t3a.xlarge - - t4a.xlarge - - key: kubernetes.io/os - operator: In - values: - - linux - - key: kubernetes.io/arch - operator: In - values: - - amd64 - - key: karpenter.sh/capacity-type - operator: In - values: - - on-demand - - spot + disruption: + consolidationPolicy: WhenEmptyOrUnderutilized + consolidateAfter: 1h + expireAfter: 1h