Skip to content

Commit

Permalink
Merge pull request #297 from thehejik/eks-nodegroup-k8s-version
Browse files Browse the repository at this point in the history
Add support for setting k8s version in EKS NodeGroup
  • Loading branch information
thehejik authored Sep 27, 2024
2 parents f367251 + 3c6a4a1 commit 2cec075
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 @@ -48,6 +48,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 @@ -68,6 +69,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{
Arm: nodeGroupConfig.Arm,
DesiredSize: nodeGroupConfig.DesiredSize,
Expand All @@ -88,7 +95,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 2cec075

Please sign in to comment.