Skip to content

Commit

Permalink
Merge pull request #301 from thehejik/eks-nodegroup-k8s-version-v28
Browse files Browse the repository at this point in the history
[v2.8] Add support for setting k8s version in EKS NodeGroup
  • Loading branch information
thehejik authored Sep 27, 2024
2 parents 2a9f2c0 + ca5929a commit e41d69e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion extensions/clusters/eks/eks_cluster_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type NodeGroupConfig struct {
Subnets []string `json:"subnets" yaml:"subnets"`
Tags map[string]string `json:"tags" yaml:"tags"`
UserData *string `json:"userData,omitempty" yaml:"userData,omitempty"`
Version *string `json:"version,omitempty" yaml:"version,omitempty"`
}

// LaunchTemplateConfig is the configuration need for a node group launch template
Expand All @@ -64,6 +65,12 @@ func nodeGroupsConstructor(nodeGroupsConfig *[]NodeGroupConfig, kubernetesVersio
Version: nodeGroupConfig.LaunchTemplateConfig.Version,
}
}
var version *string
if nodeGroupConfig.Version != nil {
version = nodeGroupConfig.Version
} else {
version = &kubernetesVersion
}
nodeGroup := management.NodeGroup{
DesiredSize: nodeGroupConfig.DesiredSize,
DiskSize: nodeGroupConfig.DiskSize,
Expand All @@ -83,7 +90,7 @@ func nodeGroupsConstructor(nodeGroupsConfig *[]NodeGroupConfig, kubernetesVersio
Subnets: &nodeGroupConfig.Subnets,
Tags: &nodeGroupConfig.Tags,
UserData: nodeGroupConfig.UserData,
Version: &kubernetesVersion,
Version: version,
}
nodeGroups = append(nodeGroups, nodeGroup)
}
Expand Down

0 comments on commit e41d69e

Please sign in to comment.