Skip to content

Commit

Permalink
flex karpenter node-pool configurations
Browse files Browse the repository at this point in the history
Signed-off-by: Mahmoud Gaballah <mahmoud.gaballah@zalando.de>
  • Loading branch information
myaser committed Jun 3, 2024
1 parent b1a5d3d commit f723db0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cluster/node-pools/master-default/userdata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ write_files:
limits:
memory: {{ .Values.InstanceInfo.MemoryFraction (parseInt64 .Cluster.ConfigItems.apiserver_memory_limit_percent)}}
{{- end }}
- image: 926694233939.dkr.ecr.eu-central-1.amazonaws.com/production_namespace/teapot/admission-controller:master-206
` - image: 926694233939.dkr.ecr.eu-central-1.amazonaws.com/staging_namespace/teapot/admission-controller:pr-203-7
name: admission-controller
lifecycle:
preStop:
Expand Down
29 changes: 21 additions & 8 deletions cluster/node-pools/worker-karpenter/provisioners.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,23 +143,36 @@ spec:
- "c7in"
- "m7in"
- "r7in"
#{{ else if (gt (len .NodePool.InstanceTypes) 0) }}
- key: "node.kubernetes.io/instance-type"
operator: In
values:
# {{ range $type := .NodePool.InstanceTypes }}
- "{{ $type }}"
# {{ end }}
#{{ end }}
# exclude unwanted sizes
- key: "karpenter.k8s.aws/instance-size"
operator: "NotIn"
values:
- "metal"
# exclude instance-types with slow SSD
# exclude unwanted instance-types
- key: "node.kubernetes.io/instance-type"
operator: "NotIn"
values:
- "c5d.large"
#{{ else }}
- key: "node.kubernetes.io/instance-type"
operator: In
- "c5d.large" # too slow SSD
# user's custom configurations
#{{ if (index .NodePool.ConfigItems "requirements") }}
# {{ range $requirement := .NodePool.KarpenterRequirements }}
- key: "{{ $requirement.Key }}"
operator: "{{ $requirement.Operator }}"
values:
# {{ range $type := .NodePool.InstanceTypes }}
- "{{ $type }}"
# {{ end }}
# {{ range $value := $requirement.Values }}
- "{{ $value}}"
# {{ end }}
# {{ end }}
#{{ end }}
# other configuration
- key: "karpenter.sh/capacity-type"
operator: In
values:
Expand Down

0 comments on commit f723db0

Please sign in to comment.