Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Karpenter 0.3.0 Modifications #267

Closed
wants to merge 12 commits into from
2 changes: 1 addition & 1 deletion charts/karpenter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: ot-karpenter
version: 0.2.0
version: 0.3.0
dependencies:
- name: karpenter
version: 1.1.1

Check failure on line 6 in charts/karpenter/Chart.yaml

View workflow job for this annotation

GitHub Actions / lint-test

6:19 [trailing-spaces] trailing spaces
repository: oci://public.ecr.aws/karpenter
13 changes: 6 additions & 7 deletions charts/karpenter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ To install Karpenter, use the following commands:

```shell
$ helm repo add ot-helm https://ot-container-kit.github.io/helm-charts/
$ helm install karpenter ot-helm/karpenter --namespace <namespace> --dependency-update --include-crds
$ helm install karpenter ot-helm/karpenter --namespace <namespace> --dependency-update --create-namespace

```
# Adds the ot-helm repository to Helm, which contains the Karpenter Helm chart.
# Installs the Karpenter chart from the ot-helm repository.
Adds the ot-helm repository to Helm, which contains the Karpenter Helm chart.
Installs the Karpenter chart from the ot-helm repository.



Expand All @@ -22,7 +22,7 @@ $ helm upgrade karpenter ot-helm/karpenter --install --namespace <namespace> --c

```

# Upgrades an existing Karpenter release or installs it if it doesn't exist.
Upgrades an existing Karpenter release or installs it if it doesn't exist.


To uninstall the chart:
Expand All @@ -31,8 +31,8 @@ To uninstall the chart:
$ helm delete karpenter --namespace <namespace>
```

# Deletes the Karpenter release from the specified namespace.
# Replace <namespace> with the namespace where Karpenter is installed.
Deletes the Karpenter release from the specified namespace.
Replace <namespace> with the namespace where Karpenter is installed.



Expand Down Expand Up @@ -72,7 +72,6 @@ $ helm delete karpenter --namespace <namespace>

### Notes:

- After deployment of helm chart, in order for the nodepool to work, ec2nodeclass should be installed as well.
- Refer to Example Folder for a example values.yaml file
- Karpenter automatically creates and manages NodePools as part of the installation process.
- Make sure to configure the IAM roles required by Karpenter for it to interact with EC2 instances and manage resources along with all prerequisites.
Expand Down
Empty file.
33 changes: 33 additions & 0 deletions charts/karpenter/templates/ec2nodeclass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{- range .Values.ec2NodeClasses }}
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
name: {{ .name }}
spec:
amiFamily: {{ .amiFamily | default "AL2" }}
role: {{ .role }}
{{- if .detailedMonitoring }}
detailedMonitoring: {{ .detailedMonitoring }}
{{- end }}
subnetSelectorTerms:
- tags:
karpenter.sh/discovery: "{{ $.Values.clusterName }}"
securityGroupSelectorTerms:
- tags:
karpenter.sh/discovery: "{{ $.Values.clusterName }}"
amiSelectorTerms:
- id: "{{ .amiSelector.arm }}"
- id: "{{ .amiSelector.amd }}"
{{- if .amiSelector.gpu }}
- id: "{{ .amiSelector.gpu }}"
{{- end }}
{{- if .amiSelector.name }}
- name: "{{ .amiSelector.name }}"
{{- end }}
{{- if .tags }}
tags:
{{- range $key, $value := .tags }}
{{ $key }}: "{{ $value }}"
{{- end }}
{{- end }}
{{- end }}
26 changes: 24 additions & 2 deletions charts/karpenter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ awsAccountId: 3333 # AWS account ID where the resources will be provisioned
karpenter:
settings:
clusterName: "" # Cluster name for the Karpenter controller to identify and manage nodes in this cluster
#interruptionQueue: "" # Name of SQS queue for handling EC2 instance interruptions

serviceAccount:
annotations:
Expand All @@ -22,6 +23,23 @@ karpenter:
# cpu: "1" # CPU resource limit for the Karpenter controller (maximum resources Karpenter can consume)
# memory: "1Gi" # Memory resource limit for the Karpenter controller

# EC2NodeClasses define the EC2 instance classes that Karpenter can use
ec2NodeClasses:
- name: default
amiFamily: AL2 # Amazon Linux 2 AMI family
role: #"KarpenterNodeRole-my-eks-cluster" # Name of karpenter Node Role ( NOT THE ARN )
amiSelector:
# To get the AMI ID, run the commands below in the AWS CLI and replace the AMI ID in the values.yaml file
arm: # ARM_AMI_ID="$(aws ssm get-parameter --name /aws/service/eks/optimized-ami/${K8S_VERSION}/amazon-linux-2-arm64/recommended/image_id --query Parameter.Value --output text)"
amd: # AMD_AMI_ID="$(aws ssm get-parameter --name /aws/service/eks/optimized-ami/${K8S_VERSION}/amazon-linux-2/recommended/image_id --query Parameter.Value --output text)"
#gpu: ami-gpu-id # GPU_AMI_ID="$(aws ssm get-parameter --name /aws/service/eks/optimized-ami/${K8S_VERSION}/amazon-linux-2-gpu/recommended/image_id --query Parameter.Value --output text)"
#name: #amazon-eks-node-1.27-* # Optional: EKS Node AMI Name
# tags: # Optional, propagates tags to underlying EC2 resources
# environment: production
# team: "engineering"
# owner: "[email protected]"
#detailedMonitoring: true # Enable detailed monitoring for the EC2 instance

# NodePools define groups of nodes with specific requirements
nodePools:
- name: default # Name of the node pool, preset here is set to default nodepool
Expand All @@ -42,8 +60,12 @@ nodePools:
operator: In # Only nodes with the specified instance category will be selected
values:
- "t" # These can be customized as per need
- "m"
- "r"
- "m"
- "r"
# - key: karpenter.k8s.aws/instance-family # Uncomment to define the instance family (e.g., t3, m5, r5)
# operator: In
# values:
# - "t3a"
- key: karpenter.k8s.aws/instance-generation # Instance generation requirement
operator: Gt # Greater than the specified value
values:
Expand Down
Loading