Skip to content

Commit

Permalink
Merge pull request #17 from fiverr/fix_required_amiselectorTerms
Browse files Browse the repository at this point in the history
fix amiselectorTerms is now required
  • Loading branch information
nadavbuc authored Aug 28, 2024
2 parents 60d2271 + 7c227f6 commit 9d07095
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 13 deletions.
2 changes: 1 addition & 1 deletion charts/karpenter_nodes/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: karpenter_nodes
version: 1.1.2
version: 1.1.3
description: A Helm chart for generating NodeClasses and NodePools for Karpenter
maintainers:
- name: nadavbuc
2 changes: 1 addition & 1 deletion charts/karpenter_nodes/examples/argocd_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
sources:
- repoURL: 'https://opensource.fiverr.com/public_charts/'
chart: karpenter_nodes
targetRevision: 1.1.0
targetRevision: 1.1.3
helm:
valueFiles:
- $values/karpenter_nodes/eks-dev/common.yaml
Expand Down
44 changes: 34 additions & 10 deletions charts/karpenter_nodes/examples/output/output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ spec:
role: eks_nodes_role
amiFamily: AL2
amiSelectorTerms:
- alias: al2@latest
subnetSelectorTerms:
- tags:
Name: eks-dev-eu-west-1a
Expand Down Expand Up @@ -150,6 +151,7 @@ spec:
role: eks_nodes_role
amiFamily: AL2
amiSelectorTerms:
- alias: al2@latest
subnetSelectorTerms:
- tags:
Name: eks-dev-eu-west-1a
Expand Down Expand Up @@ -283,6 +285,7 @@ spec:
role: eks_nodes_role
amiFamily: AL2
amiSelectorTerms:
- alias: al2@latest
subnetSelectorTerms:
- tags:
Name: eks-dev-eu-west-1a
Expand Down Expand Up @@ -416,6 +419,7 @@ spec:
role: eks_nodes_role
amiFamily: AL2
amiSelectorTerms:
- alias: al2@latest
subnetSelectorTerms:
- tags:
Name: eks-dev-eu-west-1a
Expand Down Expand Up @@ -549,6 +553,7 @@ spec:
role: eks_nodes_role
amiFamily: AL2
amiSelectorTerms:
- alias: al2@latest
subnetSelectorTerms:
- tags:
Name: eks-dev-eu-west-1a
Expand Down Expand Up @@ -675,6 +680,7 @@ spec:
role: eks_nodes_role
amiFamily: AL2
amiSelectorTerms:
- alias: al2@latest
subnetSelectorTerms:
- tags:
Name: eks-dev-eu-west-1a
Expand Down Expand Up @@ -808,6 +814,7 @@ spec:
role: eks_nodes_role
amiFamily: AL2
amiSelectorTerms:
- alias: al2@latest
subnetSelectorTerms:
- tags:
Name: eks-dev-eu-west-1a
Expand Down Expand Up @@ -942,6 +949,7 @@ spec:
role: eks_nodes_role
amiFamily: AL2
amiSelectorTerms:
- alias: al2@latest
subnetSelectorTerms:
- tags:
Name: eks-dev-eu-west-1a
Expand Down Expand Up @@ -1080,6 +1088,8 @@ spec:
spec:
nodeClassRef:
name: nodes-canary-amd64
apiVersion: karpenter.sh/v1
kind: EC2NodeClass
taints:
- key: dedicated
effect: NoSchedule
Expand Down Expand Up @@ -1150,8 +1160,8 @@ spec:
- "3"
- "4"
- "5"
expireAfter: 720h
disruption:
expireAfter: 720h
consolidationPolicy: WhenEmptyOrUnderutilized
weight: 1
---
Expand All @@ -1169,6 +1179,8 @@ spec:
spec:
nodeClassRef:
name: nodes-cilium-managed-amd64
apiVersion: karpenter.sh/v1
kind: EC2NodeClass
taints:
- key: dedicated
effect: NoSchedule
Expand Down Expand Up @@ -1235,8 +1247,8 @@ spec:
operator: NotIn
values:
- metal
expireAfter: 720h
disruption:
expireAfter: 720h
consolidationPolicy: WhenEmptyOrUnderutilized
weight: 1
---
Expand All @@ -1254,6 +1266,8 @@ spec:
spec:
nodeClassRef:
name: nodes-default-amd64
apiVersion: karpenter.sh/v1
kind: EC2NodeClass
requirements:
- key: "karpenter.k8s.aws/instance-category"
operator: In
Expand Down Expand Up @@ -1319,8 +1333,8 @@ spec:
- "3"
- "4"
- "5"
expireAfter: 720h
disruption:
expireAfter: 720h
consolidationPolicy: WhenEmptyOrUnderutilized
weight: 2
---
Expand Down Expand Up @@ -1399,8 +1413,8 @@ spec:
operator: In
values:
- "6"
expireAfter: 720h
disruption:
expireAfter: 720h
consolidationPolicy: WhenEmptyOrUnderutilized
weight: 1
---
Expand All @@ -1419,6 +1433,8 @@ spec:
spec:
nodeClassRef:
name: nodes-gpu-amd64
apiVersion: karpenter.sh/v1
kind: EC2NodeClass
taints:
- key: dedicated
effect: NoSchedule
Expand Down Expand Up @@ -1470,8 +1486,8 @@ spec:
- g5.xlarge
- g5.2xlarge
- g5.4xlarge
expireAfter: 720h
disruption:
expireAfter: 720h
consolidationPolicy: WhenEmptyOrUnderutilized
limits:
cpu: 128
Expand All @@ -1491,6 +1507,8 @@ spec:
spec:
nodeClassRef:
name: nodes-ingress-multiarch
apiVersion: karpenter.sh/v1
kind: EC2NodeClass
taints:
- key: dedicated
effect: NoSchedule
Expand Down Expand Up @@ -1548,8 +1566,8 @@ spec:
operator: NotIn
values:
- metal
expireAfter: Never
disruption:
expireAfter: Never
consolidationPolicy: WhenEmptyOrUnderutilized
weight: 1
---
Expand All @@ -1567,6 +1585,8 @@ spec:
spec:
nodeClassRef:
name: nodes-jobs-amd64
apiVersion: karpenter.sh/v1
kind: EC2NodeClass
taints:
- key: dedicated
effect: NoSchedule
Expand Down Expand Up @@ -1624,8 +1644,8 @@ spec:
operator: NotIn
values:
- metal
expireAfter: Never
disruption:
expireAfter: Never
consolidationPolicy: WhenEmpty
consolidateAfter: 5m
weight: 1
Expand All @@ -1645,6 +1665,8 @@ spec:
spec:
nodeClassRef:
name: nodes-monitoring-multiarch
apiVersion: karpenter.sh/v1
kind: EC2NodeClass
taints:
- key: dedicated
effect: NoSchedule
Expand Down Expand Up @@ -1696,8 +1718,8 @@ spec:
operator: NotIn
values:
- metal
expireAfter: Never
disruption:
expireAfter: Never
consolidationPolicy: WhenEmptyOrUnderutilized
weight: 1
---
Expand All @@ -1715,6 +1737,8 @@ spec:
spec:
nodeClassRef:
name: nodes-workers-amd64
apiVersion: karpenter.sh/v1
kind: EC2NodeClass
taints:
- key: dedicated
effect: NoSchedule
Expand Down Expand Up @@ -1784,8 +1808,8 @@ spec:
- "3"
- "4"
- "5"
expireAfter: 720h
disruption:
expireAfter: 720h
consolidationPolicy: WhenEmptyOrUnderutilized
weight: 2
---
Expand Down Expand Up @@ -1871,7 +1895,7 @@ spec:
- "3"
- "4"
- "5"
expireAfter: 720h
disruption:
expireAfter: 720h
consolidationPolicy: WhenEmptyOrUnderutilized
weight: 1
4 changes: 3 additions & 1 deletion charts/karpenter_nodes/templates/nodeclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ spec:
{{- fail "nodeClass error: Either IamRole or IamInstanceProfile must be defined" }}
{{- end }}
amiFamily: {{ $v.amiFamily | default $.Values.amiFamily }}
{{- if or (hasKey $v "amiSelectorTerms") (hasKey $.Values "amiSelectorTerms") }}
amiSelectorTerms:
{{- if or (hasKey $v "amiSelectorTerms") (hasKey $.Values "amiSelectorTerms") }}
{{- toYaml ($v.amiSelectorTerms | default $.Values.amiSelectorTerms) | nindent 4 }}
{{- else }}
- alias: {{ lower $.Values.amiFamily }}@latest
{{- end }}
subnetSelectorTerms:
{{- if hasKey $v "subnetSelectorTerms" }}
Expand Down

0 comments on commit 9d07095

Please sign in to comment.