mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
chore(kb/k8s/karpenter): mostly just add sources
This commit is contained in:
@@ -4,25 +4,29 @@ Open-source, just-in-time cloud node provisioner for Kubernetes.
|
||||
|
||||
1. [TL;DR](#tldr)
|
||||
1. [Setup](#setup)
|
||||
1. [AWS](#aws)
|
||||
1. [Further readings](#further-readings)
|
||||
1. [Sources](#sources)
|
||||
|
||||
## TL;DR
|
||||
|
||||
Karpenter works by:
|
||||
Runs as workload on the cluster.
|
||||
|
||||
Works by:
|
||||
|
||||
1. Watching for unschedulable pods.
|
||||
1. Evaluating unschedulable pods' scheduling constraints (resource requests, node selectors, affinities, tolerations,
|
||||
and topology spread constraints).
|
||||
1. Provisioning **cloud-based** nodes meeting the requirements of unschedulable pods.
|
||||
1. Provisioning **cloud-based** nodes meeting the resource requirements and scheduling constraints of unschedulable
|
||||
pods.
|
||||
1. Deleting nodes when no longer needed.
|
||||
|
||||
Karpenter runs as workload on the cluster.
|
||||
Under the hood, Karpenter adds a finalizer to the Kubernetes node object it provisions.<br/>
|
||||
The finalizer blocks node deletion until all pods on it are drained and the instance is terminated.<br/>
|
||||
This **only** works for nodes provisioned by Karpenter.
|
||||
|
||||
Should one manually delete a Karpenter-provisioned node, Karpenter will gracefully cordon, drain, and shutdown the
|
||||
corresponding instance.<br/>
|
||||
Under the hood, Karpenter adds a finalizer to the node object it provisions. This blocks deletion until all pods are
|
||||
drained and the instance is terminated. This **only** works for nodes provisioned by Karpenter.
|
||||
Should one manually delete a Karpenter-provisioned Kubernetes node object, Karpenter will gracefully cordon, drain, and
|
||||
shutdown the corresponding cloud instance.
|
||||
|
||||
<details>
|
||||
<summary>Setup</summary>
|
||||
@@ -71,10 +75,33 @@ helm … \
|
||||
|
||||
Karpenter's controller and webhook deployment are designed to run as a workload on the cluster.
|
||||
|
||||
As of 2024-12-24, it only supports AWS and Azure nodes.<br/>
|
||||
As of 2025-06-08, it only supports AWS and Azure nodes.<br/>
|
||||
As part of the installation process, one **will** need credentials from the underlying cloud provider to allow
|
||||
Karpenter-managed nodes to be started up and added to the cluster as needed.
|
||||
|
||||
Karpenter configuration comes in the form of:
|
||||
|
||||
- A _NodePool_ Custom Resource Definition.
|
||||
- A _NodeClass_ Custom Resource Definition.<br/>
|
||||
Its specifics are defined by the cloud provider's implementation.
|
||||
|
||||
A single Karpenter NodePool is capable of handling many different pod shapes.<br/>
|
||||
A cluster may have more than one NodePool.
|
||||
|
||||
### AWS
|
||||
|
||||
Leverages the [Karpenter provider for AWS].
|
||||
|
||||
Requirements:
|
||||
|
||||
- An IAM Role for Karpenter.<br/>
|
||||
Required to allow Karpenter to call AWS APIs.
|
||||
- An IAM Role and an instance profile for the EC2 instances Karpenter creates.
|
||||
- An EKS cluster access entry for the nodes' IAM role.<br/>
|
||||
Required by the nodes to be able to join the EKS cluster.
|
||||
- An SQS queue for Karpenter.<br/>
|
||||
Required to receive Spot interruption, instance re-balance and other events.
|
||||
|
||||
## Further readings
|
||||
|
||||
- [Website]
|
||||
@@ -83,6 +110,11 @@ Karpenter-managed nodes to be started up and added to the cluster as needed.
|
||||
|
||||
### Sources
|
||||
|
||||
- [Karpenter EKS workshop]
|
||||
- [Karpenter: Amazon EKS Best Practice and Cloud Cost Optimization]
|
||||
- [Run Kubernetes Clusters for Less with Amazon EC2 Spot and Karpenter]
|
||||
- [Karpenter best practices]
|
||||
|
||||
<!--
|
||||
Reference
|
||||
═╬═Time══
|
||||
@@ -97,3 +129,8 @@ Karpenter-managed nodes to be started up and added to the cluster as needed.
|
||||
[website]: https://karpenter.sh/
|
||||
|
||||
<!-- Others -->
|
||||
[Karpenter best practices]: https://docs.aws.amazon.com/eks/latest/best-practices/karpenter.html
|
||||
[Karpenter EKS workshop]: https://www.eksworkshop.com/docs/autoscaling/compute/karpenter/
|
||||
[Karpenter provider for AWS]: https://github.com/aws/karpenter-provider-aws
|
||||
[Karpenter: Amazon EKS Best Practice and Cloud Cost Optimization]: https://catalog.us-east-1.prod.workshops.aws/workshops/f6b4587e-b8a5-4a43-be87-26bd85a70aba/en-US
|
||||
[Run Kubernetes Clusters for Less with Amazon EC2 Spot and Karpenter]: https://community.aws/content/2dhlDEUfwElQ9mhtOP6D8YJbULA/run-kubernetes-clusters-for-less-with-amazon-ec2-spot-and-karpenter
|
||||
|
||||
Reference in New Issue
Block a user