@@ -71,6 +71,17 @@ configure() {
71
71
echo ' createRecordSet: true' >> cluster.yaml
72
72
73
73
# required to run kube-aws update
74
+ customize_worker
75
+
76
+ ${KUBE_AWS_CMD} render
77
+
78
+ ${KUBE_AWS_CMD} validate --s3-uri ${KUBE_AWS_S3_URI}
79
+
80
+ echo Generated configuration files in ${WORK_DIR} :
81
+ find .
82
+ }
83
+
84
+ customize_worker () {
74
85
echo ' workerCount: 2' >> cluster.yaml
75
86
echo ' controllerCount: 2' >> cluster.yaml
76
87
echo -e ' experimental:\n nodeDrainer:\n enabled: true' >> cluster.yaml
@@ -86,13 +97,6 @@ configure() {
86
97
if [ " ${KUBE_AWS_USE_CALICO} " != " " ]; then
87
98
echo ' useCalico: true' >> cluster.yaml
88
99
fi
89
-
90
- ${KUBE_AWS_CMD} render
91
-
92
- ${KUBE_AWS_CMD} validate --s3-uri ${KUBE_AWS_S3_URI}
93
-
94
- echo Generated configuration files in ${WORK_DIR} :
95
- find .
96
100
}
97
101
98
102
clean () {
@@ -228,22 +232,52 @@ nodepool_init() {
228
232
fi
229
233
}
230
234
231
- nodepool () {
235
+ nodepool_render () {
232
236
cd ${WORK_DIR}
233
237
234
- nodepool_init
235
-
236
238
${KUBE_AWS_CMD} node-pools render stack --node-pool-name ${KUBE_AWS_POOL_NAME}
239
+ }
240
+
241
+ nodepool_up () {
242
+ cd ${WORK_DIR}
243
+
237
244
${KUBE_AWS_CMD} node-pools up --node-pool-name ${KUBE_AWS_POOL_NAME} --export
238
245
${KUBE_AWS_CMD} node-pools up --node-pool-name ${KUBE_AWS_POOL_NAME} --s3-uri ${KUBE_AWS_S3_URI}
239
246
}
240
247
248
+ nodepool_update () {
249
+ cd ${WORK_DIR}
250
+
251
+ pushd ${NODE_POOL_ASSETS_DIR}
252
+
253
+ if [ " ${KUBE_AWS_SPOT_FLEET_ENABLED} " ]; then
254
+ SED_CMD=" sed -e 's/targetCapacity: 3/targetCapacity: 5/'"
255
+ diff --unified cluster.yaml <( cat cluster.yaml | sh -c " ${SED_CMD} " ) || true
256
+ sh -c " ${SED_CMD} -i bak cluster.yaml"
257
+ else
258
+ echo ' workerCount: 2' >> cluster.yaml
259
+ fi
260
+
261
+ popd
262
+
263
+ ${KUBE_AWS_CMD} node-pools update --node-pool-name ${KUBE_AWS_POOL_NAME} --s3-uri ${KUBE_AWS_S3_URI}
264
+ }
265
+
241
266
nodepool_destroy () {
242
267
cd ${WORK_DIR}
243
268
244
269
${KUBE_AWS_CMD} node-pools destroy --node-pool-name ${KUBE_AWS_POOL_NAME}
245
270
}
246
271
272
+ nodepool () {
273
+ cd ${WORK_DIR}
274
+
275
+ nodepool_init
276
+ nodepool_render
277
+ nodepool_up
278
+ nodepool_update
279
+ }
280
+
247
281
all () {
248
282
build
249
283
prepare
0 commit comments