-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelm-dynamically-retrieved-values.yfg.yaml
83 lines (78 loc) · 1.99 KB
/
helm-dynamically-retrieved-values.yfg.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
pipeline:
- name: fetch-ami-id
exec:
command: /bin/bash
args:
- -c
- |
aws ssm get-parameter --name /aws/service/eks/optimized-ami/1.30/amazon-linux-2/recommended --output json --query 'Parameter.Value'
- name: extract-ami-id
jq:
input:
ref: fetch-ami-id
expr: '. | fromjson | .image_id'
- name: karpenter-values
gotemplate:
refVars:
eks:
file: ../files/eks-vars.yaml
template:
value:
serviceAccount:
annotations:
eks.amazonaws.com/role-arn: "{{ .eks.roleARN }}"
settings:
clusterName: "{{ .eks.clusterName }}"
clusterEndpoint: "{{ .eks.clusterEndpoint }}"
interruptionQueue: "{{ .eks.clusterName }}"
- name: helm
helm:
chart: oci://public.ecr.aws/karpenter/karpenter
version: 1.0.0
releaseName: karpenter
namespace: karpenter
includeCRDs: true
values:
- ref: karpenter-values
- name: karpenter-node-pool
gotemplate:
refVars:
eks:
file: ../files/eks-vars.yaml
amiID:
ref: extract-ami-id
template:
value: |
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: default
spec:
template:
spec:
nodeClassRef:
group: karpenter.k8s.aws
kind: EC2NodeClass
name: default
---
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
name: default
spec:
role: "{{ .eks.nodeClassRole }}"
amiSelectorTerms:
- id: "{{ .amiID }}"
securityGroupSelectorTerms:
- tags:
karpenter.sh/discovery: "{{ .eks.clusterName }}"
subnetSelectorTerms:
- tags:
karpenter.sh/discovery: "{{ .eks.clusterName }}"
tags:
managed-by: karpenter
- name: output
yaml:
input:
- ref: helm
- ref: karpenter-node-pool