简体   繁体   中英

how do i upgrade my custom eks nodegroup version using cdk?

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).

eks集群版本 节点组版本

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?

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,
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM