forked from aws-samples/eks-workshop-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update to 1.29 (aws-samples#817)
* Updates to EKS 1.29.0 and eksctl to 0.169.0 Added scripts to automate updates * Added alias k and bash completion for it
- Loading branch information
Showing
8 changed files
with
73 additions
and
36 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,38 @@ | ||
apiVersion: eksctl.io/v1alpha5 | ||
kind: ClusterConfig | ||
|
||
availabilityZones: | ||
- ${AWS_REGION}a | ||
- ${AWS_REGION}b | ||
- ${AWS_REGION}c | ||
|
||
- ${AWS_REGION}a | ||
- ${AWS_REGION}b | ||
- ${AWS_REGION}c | ||
metadata: | ||
name: ${EKS_CLUSTER_NAME} | ||
region: ${AWS_REGION} | ||
version: '1.27' | ||
version: '1.29' | ||
tags: | ||
karpenter.sh/discovery: ${EKS_CLUSTER_NAME} | ||
created-by: eks-workshop-v2 | ||
env: ${EKS_CLUSTER_NAME} | ||
|
||
iam: | ||
withOIDC: true | ||
|
||
vpc: | ||
cidr: 10.42.0.0/16 | ||
clusterEndpoints: | ||
privateAccess: true | ||
publicAccess: true | ||
|
||
addons: | ||
- name: vpc-cni | ||
version: 1.14.1 | ||
configurationValues: "{\"env\":{\"ENABLE_PREFIX_DELEGATION\":\"true\", \"ENABLE_POD_ENI\":\"true\", \"POD_SECURITY_GROUP_ENFORCING_MODE\":\"standard\"},\"enableNetworkPolicy\": \"true\"}" | ||
resolveConflicts: overwrite | ||
|
||
- name: vpc-cni | ||
version: 1.14.1 | ||
configurationValues: "{\"env\":{\"ENABLE_PREFIX_DELEGATION\":\"true\", \"ENABLE_POD_ENI\":\"true\", \"POD_SECURITY_GROUP_ENFORCING_MODE\":\"standard\"},\"enableNetworkPolicy\": \"true\"}" | ||
resolveConflicts: overwrite | ||
managedNodeGroups: | ||
- name: default | ||
desiredCapacity: 3 | ||
minSize: 3 | ||
maxSize: 6 | ||
instanceType: m5.large | ||
privateNetworking: true | ||
releaseVersion: 1.27.3-20230816 | ||
updateConfig: | ||
maxUnavailablePercentage: 50 | ||
labels: | ||
workshop-default: 'yes' | ||
- name: default | ||
desiredCapacity: 3 | ||
minSize: 3 | ||
maxSize: 6 | ||
instanceType: m5.large | ||
privateNetworking: true | ||
releaseVersion: "1.29.0-20240129" | ||
updateConfig: | ||
maxUnavailablePercentage: 50 | ||
labels: | ||
workshop-default: 'yes' |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export KUBECTL_VERSION='v1.27.7' | ||
export KUBECTL_VERSION='v1.29.0' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/sh -x | ||
|
||
if [ -z "$1" ] || [ -z "$2" ]; then | ||
echo "We need a k8s version and eksctl version to update to, e.g. ./$0 1.29.0 0.169.0" | ||
exit 1 | ||
fi | ||
|
||
K8SLong=$1 | ||
K8S="${K8SLong%.*}" | ||
EKSCTL=$2 | ||
|
||
ARCH=amd64 | ||
PLATFORM=$(uname -s)_$ARCH | ||
|
||
#AMI=`aws ec2 describe-images --owners amazon --filters "Name=name,Values=amazon-eks-node-$K8S*" --query "Images[1].[Name,Description]" --output text` | ||
AMI_API=`aws ec2 describe-images --owners amazon --filters "Name=name,Values=amazon-eks-node-$K8S*" --query "Images[1].[Name]" --output text` | ||
|
||
AMI=$( echo ${AMI_API} | sed "s/amazon-eks-node-.*-v\(.*\)/$K8SLong-\\1/") | ||
|
||
|
||
sed -i "s/KUBERNETES_VERSION: '.*'/KUBERNETES_VERSION: '$K8S'/" website/docusaurus.config.js | ||
sed -i "s/KUBERNETES_NODE_VERSION: '.*'/KUBERNETES_NODE_VERSION: '$K8S-eks-tbdl'/" website/docusaurus.config.js #Find the right version | ||
|
||
sed -i "s/kubectl_version='.*'/kubectl_version='$K8SLong'/" lab/scripts/installer.sh | ||
kubectl_checksum=`curl -L "https://dl.k8s.io/release/v$K8SLong/bin/linux/amd64/kubectl.sha256"` | ||
sed -i "s/kubectl_checksum='.*'/kubectl_checksum='$kubectl_checksum'/" lab/scripts/installer.sh | ||
|
||
sed -i "s/eksctl_version='.*'/eksctl_version='$EKSCTL'/" lab/scripts/installer.sh | ||
EKSCTL_CHECKSUM=`curl -sL "https://github.com/eksctl-io/eksctl/releases/download/v$EKSCTL/eksctl_checksums.txt" | grep $PLATFORM | cut -f1 -d" "` | ||
sed -i "s/eksctl_checksum='.*'/eksctl_checksum='$EKSCTL_CHECKSUM'/" lab/scripts/installer.sh | ||
|
||
#sed -i "s/version: '.*'/version: '$K8S'/" cluster/eksctl/cluster.yaml | ||
yq -i ".metadata.version = \"$K8S\"" cluster/eksctl/cluster.yaml | ||
yq -i ".managedNodeGroups[0].releaseVersion = \"$AMI\"" cluster/eksctl/cluster.yaml | ||
|
||
# Using line numbers in Terraform to target only the right resources | ||
sed -i "9s/default.*= \".*\"/default = \"$K8S\"/" cluster/terraform/variables.tf | ||
sed -i "15s/default.*= \".*\"/default = \"$AMI\"/" cluster/terraform/variables.tf | ||
|
||
|
||
sed -i "s/KUBECTL_VERSION='.*'/KUBECTL_VERSION='v$K8SLong'/" hack/lib/kubectl-version.sh |
This file contains 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
This file contains 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
This file contains 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