Reputation: 696
I am trying to upgrade my EKS cluster version and node group version via CDK.
For EKS cluster version, I bumped the version for the eks cluster in cdk.
this.cluster = new eks.Cluster(this, 'eks-cluster', {
vpc: props.vpc,
clusterName: props.clusterName,
version: eks.KubernetesVersion.V1_22,
});
This change deployed successfully and I can observe the cluster version have been updated (v1.22). However, the node group version did not get updated (v1.21).
I was only able to find doc to upgrade node group version using eksctl
or aws console
, but these are manual and I would have to do it for each node group.
reference doc - https://docs.aws.amazon.com/eks/latest/userguide/update-managed-node-group.html
How can I upgrade my node group version using cdk?
Upvotes: 2
Views: 891
Reputation: 696
I used releaseVersion
in NodegroupProps
to specify the EKS version.
The string for releaseVersion
is in the form of k8s_major_version.k8s_minor_version.k8s_patch_version-release_date
according to this doc. The list of AMI version is found in the changelogs.
const nodeGroup = new eks.Nodegroup(this, 'myNodeGroup', {
cluster: this.cluster,
forceUpdate: false,
amiType: eks.NodegroupAmiType.AL2_X86_64,
releaseVersion: '<AMI ID obtained from changelog>',
capacityType: eks.CapacityType.ON_DEMAND,
desiredSize: 5,
});
Upvotes: 2