forked from aws-samples/karpenter-blueprints
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuserdata.yaml
52 lines (49 loc) · 1.51 KB
/
userdata.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
apiVersion: karpenter.k8s.aws/v1alpha1
kind: AWSNodeTemplate
metadata:
name: userdata-template
spec:
## If no amiFamily is defined, Karpenter will set the default amiFamily to AL2
# amiFamily: Bottlerocket ## Currently, Karpenter supports amiFamily values AL2, Bottlerocket, Ubuntu, Windows2019, Windows2022 and Custom.
subnetSelector:
karpenter.sh/discovery: "<<CLUSTER_NAME>>"
securityGroupSelector:
karpenter.sh/discovery: "<<CLUSTER_NAME>>"
instanceProfile: "<<KARPENTER_NODE_IAM_INSTANCE_PROFILE_NAME>>"
userData: |
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="BOUNDARY"
--BOUNDARY
Content-Type: text/x-shellscript; charset="us-ascii"
#!/bin/bash
echo $(jq '.containerLogMaxFiles=10|.containerLogMaxSize="100Mi"' /etc/kubernetes/kubelet/kubelet-config.json) > /etc/kubernetes/kubelet/kubelet-config.json
--BOUNDARY--
---
apiVersion: karpenter.sh/v1alpha5
kind: Provisioner
metadata:
name: userdata
spec:
labels:
intent: userdata
requirements:
- key: "karpenter.k8s.aws/instance-category"
operator: In
values: ["c", "m", "r", "i", "d"]
- key: "karpenter.k8s.aws/instance-cpu"
operator: Lt
values: ["65"]
- key: karpenter.sh/capacity-type
operator: In
values: ["spot", "on-demand"]
kubeletConfiguration:
containerRuntime: containerd
limits:
resources:
cpu: 100000
memory: 5000Gi
consolidation:
enabled: true
ttlSecondsUntilExpired: 604800
providerRef:
name: userdata-template