Skip to content

Instantly share code, notes, and snippets.

@ravikyada
Created December 21, 2023 04:54
Show Gist options
  • Save ravikyada/472737101970f8ad122cada70a6c82ce to your computer and use it in GitHub Desktop.
Save ravikyada/472737101970f8ad122cada70a6c82ce to your computer and use it in GitHub Desktop.
Here is the new Karpenter NoodPoool YAML fIle.
apiVersion: karpenter.sh/v1beta1
kind: NodePool
metadata:
name: default
spec:
template:
metadata:
labels:
lifecycle: on-demand
spec:
nodeClassRef:
name: default-pool
taints:
- key: "env"
value: "prod"
effect: "NoSchedule"
requirements:
- key: "karpenter.k8s.aws/instance-category"
operator: In
values: ["c", "m", "r"]
- key: "karpenter.k8s.aws/instance-cpu"
operator: In
values: ["4", "8"]
- key: "kubernetes.io/arch"
operator: In
values: ["amd64"]
- key: "karpenter.sh/capacity-type"
operator: In
values: ["on-demand"]
kubelet:
clusterDNS: ["10.1.1.100"]
systemReserved:
cpu: 100m
memory: 100Mi
ephemeral-storage: 1Gi
kubeReserved:
cpu: 200m
memory: 100Mi
ephemeral-storage: 3Gi
evictionHard:
memory.available: 5%
nodefs.available: 10%
nodefs.inodesFree: 10%
evictionSoft:
memory.available: 500Mi
nodefs.available: 15%
nodefs.inodesFree: 15%
evictionSoftGracePeriod:
memory.available: 1m
nodefs.available: 1m30s
nodefs.inodesFree: 2m
evictionMaxPodGracePeriod: 60
imageGCHighThresholdPercent: 85
imageGCLowThresholdPercent: 80
cpuCFSQuota: true
podsPerCore: 2
maxPods: 20
disruption:
# Describes which types of Nodes Karpenter should consider for consolidation
# If using 'WhenUnderutilized', Karpenter will consider all nodes for consolidation and attempt to remove or replace Nodes when it discovers that the Node is underutilized and could be changed to reduce cost
# If using `WhenEmpty`, Karpenter will only consider nodes for consolidation that contain no workload pods
consolidationPolicy: WhenUnderutilized | WhenEmpty
limits:
cpu: "1000"
memory: 1000Gi
weight: 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment