Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pkg/actions/addon/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ func CreateAddonTasks(ctx context.Context, cfg *api.ClusterConfig, clusterProvid
if addonInfo.IsDefault && !slices.ContainsFunc(cfg.Addons, func(a *api.Addon) bool {
return strings.EqualFold(a.Name, addonName)
}) {
addons = append(addons, &api.Addon{Name: addonName})
autoDefaultAddonNames = append(autoDefaultAddonNames, addonName)
if !cfg.IsAutoModeEnabled() {
addons = append(addons, &api.Addon{Name: addonName})
autoDefaultAddonNames = append(autoDefaultAddonNames, addonName)
} else if addonInfo.IsDefaultAutoMode {
addons = append(addons, &api.Addon{Name: addonName})
autoDefaultAddonNames = append(autoDefaultAddonNames, addonName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hard to tell without the context of the PR (please update the PR body explaining the motivation behind the changes and intent), but when Auto Mode is enabled, I believe we do NOT want the add-ons deployed since they are provided automatically as part of Auto Mode. The only time we really want add-ons to be deployed is when there is a node group involved (either managed or self-managed)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My apologies for not including description in the PR body, I had originally included one but it seemed to have not published. I have updated the description

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are correct, we do not want to install core networking addons on auto mode clusters, since these addons are provisioned as part of auto mode. This change does not enable installing vpc-cni, coredns, or kube-proxy, it only enables installing metrics-server by default.

Metrics-server was chosen to be installed by default based on default AWS EKS Console experience. Console will call EKS Addons create-addon api to provision metrics-server for the customer on cluster creation.

}

}
}
} else {
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/eksctl.io/v1alpha5/known_addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "slices"
var KnownAddons = map[string]struct {
IsDefault bool
CreateBeforeNodeGroup bool
IsDefaultAutoMode bool
}{
VPCCNIAddon: {
IsDefault: true,
Expand All @@ -26,6 +27,7 @@ var KnownAddons = map[string]struct {
MetricsServerAddon: {
IsDefault: true,
CreateBeforeNodeGroup: true,
IsDefaultAutoMode: true,
},
}

Expand Down
23 changes: 10 additions & 13 deletions pkg/ctl/create/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,20 +369,17 @@ func doCreateCluster(cmd *cmdutils.Cmd, ngFilter *filter.NodeGroupFilter, params
postNodeGroupAddons *tasks.TaskTree
postClusterCreationTasks *tasks.TaskTree
)
if cfg.IsAutoModeEnabled() {
postClusterCreationTasks = ctl.CreateExtraClusterConfigTasks(ctx, cfg, nil, nil)
} else {
iamRoleCreator := &podidentityassociation.IAMRoleCreator{
ClusterName: cfg.Metadata.Name,
StackCreator: stackManager,
}
preNodegroupAddons, postAddons, updateVPCCNITask, autoDefaultAddons := addon.CreateAddonTasks(ctx, cfg, ctl, iamRoleCreator, true, cmd.ProviderConfig.WaitTimeout)
if len(autoDefaultAddons) > 0 {
logger.Info("default addons %s were not specified, will install them as EKS addons", strings.Join(autoDefaultAddons, ", "))
}
postNodeGroupAddons = postAddons
postClusterCreationTasks = ctl.CreateExtraClusterConfigTasks(ctx, cfg, preNodegroupAddons, updateVPCCNITask)

iamRoleCreator := &podidentityassociation.IAMRoleCreator{
ClusterName: cfg.Metadata.Name,
StackCreator: stackManager,
}
preNodegroupAddons, postAddons, updateVPCCNITask, autoDefaultAddons := addon.CreateAddonTasks(ctx, cfg, ctl, iamRoleCreator, true, cmd.ProviderConfig.WaitTimeout)
if len(autoDefaultAddons) > 0 {
logger.Info("default addons %s were not specified, will install them as EKS addons", strings.Join(autoDefaultAddons, ", "))
}
postNodeGroupAddons = postAddons
postClusterCreationTasks = ctl.CreateExtraClusterConfigTasks(ctx, cfg, preNodegroupAddons, updateVPCCNITask)

taskTree := stackManager.NewTasksToCreateCluster(ctx, cfg.NodeGroups, cfg.ManagedNodeGroups, cfg.AccessConfig, makeAccessEntryCreator(cfg.Metadata.Name, stackManager), params.NodeGroupParallelism, postClusterCreationTasks)

Expand Down
Loading