Skip to content

Commit 612bdd0

Browse files
committed
Switch to managedNodeGroups
1 parent 4b1c70a commit 612bdd0

File tree

1 file changed

+9
-58
lines changed

1 file changed

+9
-58
lines changed

eks-cluster.yaml

Lines changed: 9 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ privateCluster:
5959
- "autoscaling"
6060
- "logs"
6161

62-
nodeGroups:
62+
managedNodeGroups:
6363
- name: workspaces
6464
desiredCapacity: 1
6565
minSize: 1
@@ -78,28 +78,10 @@ nodeGroups:
7878
# https://eksctl.io/usage/vpc-networking/#use-private-subnets-for-initial-nodegroup
7979
privateNetworking: true
8080
ami: ami-0ea449d16eb31a003
81-
amiFamily: Ubuntu2004
82-
asgMetricsCollection: &asgMetricsCollection
83-
- granularity: 1Minute
84-
metrics:
85-
- GroupMinSize
86-
- GroupMaxSize
87-
- GroupDesiredCapacity
88-
- GroupInServiceInstances
89-
- GroupPendingInstances
90-
- GroupStandbyInstances
91-
- GroupTerminatingInstances
92-
- GroupTotalInstances
93-
ssh:
94-
enableSsm: true
95-
taints:
96-
dedicated: workspaces:NoSchedule
9781
tags:
9882
# EC2 tags required for cluster-autoscaler auto-discovery
9983
k8s.io/cluster-autoscaler/enabled: "true"
10084
k8s.io/cluster-autoscaler/gitpod: "owned"
101-
k8s.io/cluster-autoscaler/node-template/label/lifecycle: OnDemand
102-
k8s.io/cluster-autoscaler/node-template/label/aws.amazon.com/spot: "true"
10385
k8s.io/cluster-autoscaler/node-template/label/purpose: workspaces
10486
k8s.io/cluster-autoscaler/node-template/taint/dedicated: "workspaces:NoSchedule"
10587
iam:
@@ -120,33 +102,22 @@ nodeGroups:
120102
overrideBootstrapCommand: |
121103
#!/bin/bash
122104
123-
export AMI=ami-0ea449d16eb31a003
124105
export CLUSTERNAME=gitpod
125106
export NODEGROUP=workspaces
126107
127108
declare -a LABELS=(
128-
alpha.eksctl.io/cluster-name="${CLUSTERNAME}"
129-
alpha.eksctl.io/nodegroup-name="${NODEGROUP}"
130-
eks.amazonaws.com/capacityType=ON_DEMAND
131109
eks.amazonaws.com/nodegroup="${NODEGROUP}"
132-
eks.amazonaws.com/nodegroup-image="${AMI}"
133-
alpha.eksctl.io/nodegroup-type=unmanaged
134110
purpose="${NODEGROUP}"
135111
)
136112
137113
export USE_MAX_PODS=false
138114
export KUBELET_EXTRA_ARGS="$(printf -- "--max-pods=110 --node-labels=%s" $(IFS=$','; echo "${LABELS[*]}"))"
139115
/etc/eks/bootstrap.sh ${CLUSTERNAME}
140116
141-
# disabled when using spot instances
142-
#instanceType: r5n.xlarge
143-
# Spot instances documentation https://eksctl.io/usage/spot-instances/
144-
instancesDistribution:
145-
instanceTypes: ["r5n.xlarge","r5n.2xlarge"]
146-
maxPrice: 0.15
147-
onDemandBaseCapacity: 0
148-
onDemandPercentageAboveBaseCapacity: 0
149-
spotInstancePools: 1
117+
instanceTypes: [r5n.xlarge, r5n.2xlarge]
118+
# Create a spot nodegroup
119+
# Please change to false for production
120+
spot: true
150121

151122
- name: services
152123
desiredCapacity: 1
@@ -166,20 +137,11 @@ nodeGroups:
166137
# https://eksctl.io/usage/vpc-networking/#use-private-subnets-for-initial-nodegroup
167138
privateNetworking: true
168139
ami: ami-0ea449d16eb31a003
169-
amiFamily: Ubuntu2004
170-
asgMetricsCollection: *asgMetricsCollection
171-
ssh:
172-
enableSsm: true
173-
#taints:
174-
# dedicated: services:NoSchedule
175140
tags:
176141
# EC2 tags required for cluster-autoscaler auto-discovery
177142
k8s.io/cluster-autoscaler/enabled: "true"
178143
k8s.io/cluster-autoscaler/gitpod: "owned"
179-
k8s.io/cluster-autoscaler/node-template/label/lifecycle: OnDemand
180-
k8s.io/cluster-autoscaler/node-template/label/aws.amazon.com/spot: "true"
181144
k8s.io/cluster-autoscaler/node-template/label/purpose: services
182-
#k8s.io/cluster-autoscaler/node-template/taint/dedicated: "services:NoSchedule"
183145
iam:
184146
attachPolicyARNs: *attachPolicyARNs
185147
withAddonPolicies: *withAddonPolicies
@@ -188,30 +150,19 @@ nodeGroups:
188150
overrideBootstrapCommand: |
189151
#!/bin/bash
190152
191-
export AMI=ami-0ea449d16eb31a003
192153
export CLUSTERNAME=gitpod
193154
export NODEGROUP=services
194155
195156
declare -a LABELS=(
196-
alpha.eksctl.io/cluster-name="${CLUSTERNAME}"
197-
alpha.eksctl.io/nodegroup-name="${NODEGROUP}"
198-
eks.amazonaws.com/capacityType=ON_DEMAND
199157
eks.amazonaws.com/nodegroup="${NODEGROUP}"
200-
eks.amazonaws.com/nodegroup-image="${AMI}"
201-
alpha.eksctl.io/nodegroup-type=unmanaged
202158
purpose="${NODEGROUP}"
203159
)
204160
205161
export USE_MAX_PODS=false
206162
export KUBELET_EXTRA_ARGS="$(printf -- "--max-pods=110 --node-labels=%s" $(IFS=$','; echo "${LABELS[*]}"))"
207163
/etc/eks/bootstrap.sh ${CLUSTERNAME}
208164
209-
# disabled when using spot instances
210-
# instanceType: r5n.xlarge
211-
# Spot instances documentation https://eksctl.io/usage/spot-instances/
212-
instancesDistribution:
213-
maxPrice: 0.15
214-
instanceTypes: ["r5n.xlarge","r5n.2xlarge"]
215-
onDemandBaseCapacity: 0
216-
onDemandPercentageAboveBaseCapacity: 0
217-
spotInstancePools: 1
165+
instanceTypes: [r5n.xlarge, r5n.2xlarge]
166+
# Create a spot nodegroup
167+
# Please change to false for production
168+
spot: true

0 commit comments

Comments
 (0)