Last active
April 1, 2022 04:02
-
-
Save mumoshu/c82167a10c2a38b08f4e43aaad06aa21 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
if eksctl get cluster -f $FILE >/dev/null 2>&1; then | |
# See https://github.com/weaveworks/eksctl/blob/33ec1ed967c1ad03c985bf18774ea970d85c86f1/site/content/usage/03-cluster-upgrade.md#L41 | |
eksctl update cluster -f $FILE | |
eksctl utils update-kube-proxy | |
eksctl utils update-aws-node | |
eksctl utils update-coredns | |
# See https://github.com/weaveworks/eksctl/blob/33ec1ed967c1ad03c985bf18774ea970d85c86f1/site/content/usage/03-cluster-upgrade.md#updating-nodegroups | |
eksctl create nodegroup -f $FILE | |
for nodegroup in $(pending_nodegroups); do | |
eksctl utils wait-nodes --nodes-min $NUM_NODES | |
done | |
# TODO: Detect nodegroups to be deleted | |
for nodegroup in $(unneeded_nodegroups); do | |
# TODO: Drain unneeded nodegroups | |
eksctl drain nodegroup -f $FILE --name $nodegroup | |
# Delete unneeded nodegroups | |
eksctl delete nodegroup -f $FILE --name $nodegroup | |
done | |
else | |
eksctl create cluster -f $FILE | |
for nodegroup in $(pending_nodegroups); do | |
# TODO: Wait until the new nodegroup becomes ready | |
eksctl utils wait-nodes --nodes-min $NUM_NODES | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment