Skip to content

Commit 7aa271d

Browse files
committed
adding a special instance-types string 'not-specified'
Signed-off-by: Mahmoud Gaballah <[email protected]>
1 parent b077696 commit 7aa271d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cluster/node-pools/worker-karpenter/provisioners.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ spec:
124124
# {{ end}}
125125
#{{ end}}
126126

127-
#{{ if and (eq (len .NodePool.InstanceTypes) 1) (eq (index .NodePool.InstanceTypes 0) "default-for-karpenter") }}
127+
#{{ if (eq .NodePool.KarpenterInstanceTypeStrategy "default-for-karpenter" ) }}
128128
- key: "karpenter.k8s.aws/instance-family"
129129
operator: In
130130
values:
@@ -155,7 +155,7 @@ spec:
155155
- "c7in"
156156
- "m7in"
157157
- "r7in"
158-
#{{ else if (gt (len .NodePool.InstanceTypes) 0) }}
158+
#{{ else if (eq .NodePool.KarpenterInstanceTypeStrategy "custom" ) }}
159159
- key: "node.kubernetes.io/instance-type"
160160
operator: In
161161
values:
@@ -165,7 +165,7 @@ spec:
165165
#{{ end }}
166166

167167
# safety guards to prevent the use of unwanted instance types in case the user has not specified any specific instance types
168-
#{{ if or (eq .NodePool.KarpenterInstanceTypeStrategy "default-for-karpenter") (eq .NodePool.KarpenterInstanceTypeStrategy "not-specified") }}
168+
#{{ if ne .NodePool.KarpenterInstanceTypeStrategy "custom" }}
169169
# exclude unwanted sizes
170170
- key: "karpenter.k8s.aws/instance-size"
171171
operator: "NotIn"

0 commit comments

Comments
 (0)