Skip to content

Commit 3e7265b

Browse files
committed
Pre karpenter v1.1.1 changes
Signed-off-by: Mikkel Oscar Lyderik Larsen <[email protected]>
1 parent c55ac6f commit 3e7265b

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

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

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#{{ if eq .Cluster.ConfigItems.karpenter_pools_enabled "true"}}
22
---
3-
apiVersion: karpenter.k8s.aws/v1beta1
3+
apiVersion: karpenter.k8s.aws/v1
44
kind: EC2NodeClass
55
metadata:
66
name: "{{ .NodePool.Name }}"
@@ -40,6 +40,24 @@ spec:
4040
# {{ end }}
4141
# If you enable this option, the Amazon EC2 console displays monitoring graphs with a 1-minute period for the instances that Karpenter launches.
4242
detailedMonitoring: false
43+
# Karpenter provides the ability to specify a few additional Kubelet args.
44+
# These are all optional and provide support for additional customization and use cases.
45+
kubelet:
46+
clusterDNS: [ "10.0.1.100" ]
47+
cpuCFSQuota: false
48+
#{{ if ne .Cluster.Provider "zalando-eks" }}
49+
# {{ if ne .Cluster.ConfigItems.karpenter_max_pods_per_node "" }}
50+
maxPods: {{ .Cluster.ConfigItems.karpenter_max_pods_per_node }}
51+
# {{ else }}
52+
maxPods: {{ nodeCIDRMaxPods (parseInt64 .Cluster.ConfigItems.node_cidr_mask_size) (parseInt64 .Cluster.ConfigItems.node_max_pods_extra_capacity) }}
53+
# {{ end }}
54+
#{{ end }}
55+
systemReserved:
56+
cpu: "{{ .Cluster.ConfigItems.kubelet_system_reserved_cpu }}"
57+
memory: "{{ .Cluster.ConfigItems.kubelet_system_reserved_memory }}"
58+
kubeReserved:
59+
cpu: "{{ .Cluster.ConfigItems.kubelet_kube_reserved_cpu }}"
60+
memory: "{{ .Cluster.ConfigItems.kubelet_kube_reserved_memory }}"
4361
tags:
4462
Name: "{{ .NodePool.Name }} ({{ .Cluster.ID }})"
4563
InfrastructureComponent: 'true'
@@ -68,7 +86,7 @@ spec:
6886
userData: |
6987
{{ .Values.UserData | indent 4 }}
7088
---
71-
apiVersion: karpenter.sh/v1beta1
89+
apiVersion: karpenter.sh/v1
7290
kind: NodePool
7391
metadata:
7492
name: "{{.NodePool.Name}}"
@@ -98,6 +116,10 @@ spec:
98116
karpenter.sh/do-not-disrupt: "true"
99117
#{{ end }}
100118
spec:
119+
# The amount of time a Node can live on the cluster before being removed
120+
# Avoiding long-running Nodes helps to reduce security vulnerabilities as well as to reduce the chance of issues that can plague Nodes with long uptimes such as file fragmentation or memory leaks from system processes
121+
# You can choose to disable expiration entirely by setting the string value 'Never' here
122+
expireAfter: Never
101123
# References the Cloud Provider's NodeClass resource, see your cloud provider specific documentation
102124
nodeClassRef:
103125
name: {{ .NodePool.Name }}
@@ -215,22 +237,6 @@ spec:
215237
#{{ range $az := $azs }}
216238
- "{{ $az }}"
217239
#{{ end }}
218-
# Karpenter provides the ability to specify a few additional Kubelet args.
219-
# These are all optional and provide support for additional customization and use cases.
220-
kubelet:
221-
clusterDNS: [ "10.0.1.100" ]
222-
cpuCFSQuota: false
223-
# {{ if ne .Cluster.ConfigItems.karpenter_max_pods_per_node "" }}
224-
maxPods: {{ .Cluster.ConfigItems.karpenter_max_pods_per_node }}
225-
# {{ else }}
226-
maxPods: {{ nodeCIDRMaxPods (parseInt64 .Cluster.ConfigItems.node_cidr_mask_size) (parseInt64 .Cluster.ConfigItems.node_max_pods_extra_capacity) }}
227-
# {{ end }}
228-
systemReserved:
229-
cpu: "{{ .Cluster.ConfigItems.kubelet_system_reserved_cpu }}"
230-
memory: "{{ .Cluster.ConfigItems.kubelet_system_reserved_memory }}"
231-
kubeReserved:
232-
cpu: "{{ .Cluster.ConfigItems.kubelet_kube_reserved_cpu }}"
233-
memory: "{{ .Cluster.ConfigItems.kubelet_kube_reserved_memory }}"
234240
# Disruption section which describes the ways in which Karpenter can disrupt and replace Nodes
235241
# Configuration in this section constrains how aggressive Karpenter can be with performing operations
236242
# like rolling Nodes due to them hitting their maximum lifetime (expiry) or scaling down nodes to reduce cluster cost
@@ -240,7 +246,7 @@ spec:
240246
- nodes: "5%"
241247
- nodes: "10"
242248
# Describes which types of Nodes Karpenter should consider for consolidation
243-
# If using 'WhenUnderutilized', Karpenter will consider all nodes for consolidation and attempt to remove or replace Nodes when it discovers that the Node is underutilized and could be changed to reduce cost
249+
# If using 'WhenEmptyOrUnderutilized', Karpenter will consider all nodes for consolidation and attempt to remove or replace Nodes when it discovers that the Node is underutilized and could be changed to reduce cost
244250
# If using `WhenEmpty`, Karpenter will only consider nodes for consolidation that contain no workload pods
245251
#{{ if and (index .NodePool.ConfigItems "consolidation_policy") (eq .NodePool.ConfigItems.consolidation_policy "WhenEmpty") }}
246252
consolidationPolicy: WhenEmpty
@@ -249,12 +255,8 @@ spec:
249255
# You can choose to disable consolidation entirely by setting the string value 'Never' here
250256
consolidateAfter: {{ or (index .NodePool.ConfigItems "consolidate_after") "10m" }}
251257
#{{ else }}
252-
consolidationPolicy: WhenUnderutilized
258+
consolidationPolicy: WhenEmptyOrUnderutilized
253259
#{{ end }}
254-
# The amount of time a Node can live on the cluster before being removed
255-
# Avoiding long-running Nodes helps to reduce security vulnerabilities as well as to reduce the chance of issues that can plague Nodes with long uptimes such as file fragmentation or memory leaks from system processes
256-
# You can choose to disable expiration entirely by setting the string value 'Never' here
257-
expireAfter: Never
258260
# Priority given to the NodePool when the scheduler considers which NodePool
259261
# to select. Higher weights indicate higher priority when comparing NodePools.
260262
# Specifying no weight is equivalent to specifying a weight of 0.

0 commit comments

Comments
 (0)