Skip to content

Commit

Permalink
Added minValues flag in values.yaml,modified nodepool template
Browse files Browse the repository at this point in the history
  • Loading branch information
hiteshmakol1 committed Dec 30, 2024
2 parents 3489386 + b84aaf4 commit 1f6aca8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
4 changes: 3 additions & 1 deletion charts/karpenter/templates/nodePool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ spec:
{{- else }}
{} # Empty labels object if no labels are defined
{{- end }}

# Annotations - This will loop over and add all annotations specified in values.yaml
annotations:
{{- if .Values.nodePools.annotations }}
Expand All @@ -33,6 +32,9 @@ spec:
operator: {{ .operator }}
values:
{{ toYaml .values | indent 12 }}
{{- if .minValues }}
minValues: {{ .minValues }}
{{- end }}
{{- end }}
{{- else }}
[] # In case requirements is empty, an empty array will be passed
Expand Down
22 changes: 20 additions & 2 deletions charts/karpenter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,35 @@ nodePools:
- key: karpenter.sh/capacity-type
operator: In
values:
- "spot"
- "on-demand"
- key: karpenter.k8s.aws/instance-category
operator: In
values:
- "c"
- "t"
- "m"
- "r"
minValues: 2
- key: karpenter.k8s.aws/instance-family
operator: Exists
minValues: 5
- key: karpenter.k8s.aws/instance-family
operator: In
values:
- "m5"
- "m5d"
- "c5"
- "c5d"
- "c4"
- "r4"
minValues: 3
- key: node.kubernetes.io/instance-type
operator: Exists
minValues: 10
- key: karpenter.k8s.aws/instance-generation
operator: Gt
values:
- "2"

nodeClass:
group: karpenter.k8s.aws
kind: EC2NodeClass
Expand Down

0 comments on commit 1f6aca8

Please sign in to comment.