Search

Migrate from CAS to Karpenter

Cover
https://karpenter.sh/karpenter-overview.png
Short description
Safe migration to Karpenter for cost optimization
Github repository
Affiliation
AtlasLabs
Client
AtlasLabs
Time frame
2023/05/02 → 2023/07/18
PROJECT OVERVIEW

Migrate from CAS to Karpenter

For cost optimization, adopting right-sized nodes by Karpenter(v0.27.5) over Cluster Autoscaler.
Reduce EC2 compute costs by 30%.
For safe and soft migration, planning strategies and policies.
Contributed to improve the observability of Karpenter.
4250
pull
CONCEPTS

Provisioner

1.
nodegroup과 1:1 교체
taint를 provisioner에 씀
2.
requirements엔 노드그룹(또는 launch template)의 instance types의 instance family set(karpenter.k8s.aws/instance-family)만 지정(e.g. t3, m6i, c5, g5, ….)
instance family = instance category(e.g. t, m, c, g) + instance generation(e.g. 3, 4, 5, 6)
instance size(e.g. medium, large, xlarge) 지정 안함
3.
limits에 max nodes times instance type cpu/mem +50%를 해줌

NodeTemplate

1.
원칙적으론 Launch Template과 1:1 교체
2.
provisioner와 1:N 매칭이 되도록, (노드 어트리뷰트를 최소로 나누어), 최소한의 개수를 만든다.
3.
기본 디스크 사이즈를 100GiB로 한다 → blockDeviceMappings[].ebs.volumeSize
ARTICLE