Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ go 1.26.5
require (
github.com/Masterminds/semver/v3 v3.5.0
github.com/aws/amazon-ec2-instance-selector/v3 v3.1.3
github.com/aws/aws-sdk-go-v2 v1.45.1
github.com/aws/aws-sdk-go-v2 v1.47.4
github.com/aws/aws-sdk-go-v2/config v1.33.1
github.com/aws/aws-sdk-go-v2/credentials v1.20.1
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.75.1
Expand All @@ -16,15 +16,15 @@ require (
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.84.1
github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.70.0
github.com/aws/aws-sdk-go-v2/service/ec2 v1.325.1
github.com/aws/aws-sdk-go-v2/service/eks v1.95.1
github.com/aws/aws-sdk-go-v2/service/eks v1.105.0
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.38.1
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.60.1
github.com/aws/aws-sdk-go-v2/service/iam v1.61.1
github.com/aws/aws-sdk-go-v2/service/kms v1.57.1
github.com/aws/aws-sdk-go-v2/service/outposts v1.70.1
github.com/aws/aws-sdk-go-v2/service/ssm v1.75.1
github.com/aws/aws-sdk-go-v2/service/sts v1.47.1
github.com/aws/smithy-go v1.28.1
github.com/aws/smithy-go v1.28.6
github.com/awslabs/amazon-eks-ami/nodeadm v0.0.0-20260213141146-147b13ea3f4a
github.com/benjamintf1/unmarshalledmatchers v1.0.0
github.com/blang/semver/v4 v4.0.0
Expand Down Expand Up @@ -136,8 +136,8 @@ require (
github.com/atotto/clipboard v0.1.4 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.20 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.19.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.7 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.7 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.1 // indirect
github.com/aws/aws-sdk-go-v2/service/eventbridge v1.45.17 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.19 // indirect
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z
github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
github.com/aws/amazon-ec2-instance-selector/v3 v3.1.3 h1:13qtG4reL2+2UiCm2U7gM9QJthDO8hPPzvn7hTjHask=
github.com/aws/amazon-ec2-instance-selector/v3 v3.1.3/go.mod h1:wdlMRtz9G4IO6H1yZPsqfGBxR8E6B/bdxHlGkls4kGQ=
github.com/aws/aws-sdk-go-v2 v1.45.1 h1:iIoG3NaLhV6UZpPXyPXlDj2I9oS8tV/nMcMnITCC6Ks=
github.com/aws/aws-sdk-go-v2 v1.45.1/go.mod h1:bttEH6JqnUL8LepvDVfdrds/fZ5bCIxzpe3abyUrhDU=
github.com/aws/aws-sdk-go-v2 v1.47.4 h1:bTvk6UdSSSvaQsfLVj1JRDEEqj/PDRwGf1KanaRzau0=
github.com/aws/aws-sdk-go-v2 v1.47.4/go.mod h1:XkrjAZvr705Nytv6PkPUhoSB2W9+vVHBp5oAWpkh8Ak=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.20 h1:GPRlPwz40I2B2VrBEASOA3Bi77NyeqejNLkifosX0rs=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.20/go.mod h1:g7PNzKcsOKWb4fkSRBA7BZVAS6Y8IcxzN+nRohhQ1Q8=
github.com/aws/aws-sdk-go-v2/config v1.33.1 h1:bq9jze1hQ5YTCLoVxNnbp0T7rglrlOE7N9YsHqjGkEw=
Expand All @@ -118,10 +118,10 @@ github.com/aws/aws-sdk-go-v2/credentials v1.20.1 h1:Z8GRNEx0u9sDkZOq4PUnN8mjGwbU
github.com/aws/aws-sdk-go-v2/credentials v1.20.1/go.mod h1:uBIK00kFo95dnemqfFMTWx0X8YRqsh6ecIoCjjOkZqM=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.19.1 h1:YIEBqcqRnpi4Pfv0YHImtgi6czGCwKHANC7SwmUAVD0=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.19.1/go.mod h1:imEf0oufgAo8KAkCHhrOdqGEC0YWx1PPBQH82shSxGw=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.1 h1:pc138gM1CW+XPc60rEwUlwwuwWFQK16CI1T7v1F9Oec=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.1/go.mod h1:1+koxpPIbfBdfzP6vojm5/zTpTQ/micYwlxIiNB3TxI=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.1 h1:K0JsbZQj+1h208Ro1zHeA4l7bMp0NvRffHQ91q8Ol1s=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.1/go.mod h1:W3/vL6EtCIatICGy9ab29QhMuae+cOKPWcMxv02CO+Q=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.7 h1:fSNAt6hs4qLjb9tMZc6vj3PHlOCYGXK2JjJZ7AW2tf4=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.7/go.mod h1:TMav+EuXQu5kNpZZz/6rIC8xx4mCsW+6AKHrjvOSAsE=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.7 h1:7NS6kqBjkWIN8P/AEdmtyq6eQGAhN1oHTZdzXclpH6Y=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.7/go.mod h1:1PFqtAUsIgF1nEVojzRJSf/v88zjzqrGW+w+UAtkXyQ=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.1 h1:yhw5KD1phVyP9vijxOUzDfEtJx+bt+L63k+VfuiYFAA=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.1/go.mod h1:ZW2e0d7DYlRxlS9hEiMXE47gTdX5KRN4byUiNbUpG+Q=
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.75.1 h1:bVjY9oIRGBNMkOicaoXWjzNV7ZucqCDGLL+48+3pPzI=
Expand All @@ -136,8 +136,8 @@ github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.70.0 h1:DeAqe11n
github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.70.0/go.mod h1:LmtIJyc0o3ZgAHDMC0Vx/GiQG4TbPT07dcllPqwlItw=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.325.1 h1:rL19vNlxMMJHDSbX5JAwnpR/94kRgcebkdFRvmG6MWM=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.325.1/go.mod h1:M8AJ/M7737nKBNqZvXUNrADGBy+d3PNggJGmAStCWxI=
github.com/aws/aws-sdk-go-v2/service/eks v1.95.1 h1:Xz6LhWPiYuE5BzHgBS07a3GMR0kVXHkzOPzQVheQ0Vw=
github.com/aws/aws-sdk-go-v2/service/eks v1.95.1/go.mod h1:VW9+jZicSbAPGHczf4tlIwgjkNT+5KXYYDbz/PxsRTs=
github.com/aws/aws-sdk-go-v2/service/eks v1.105.0 h1:+bTTJtMBFZQopQKHC/JhJP6liBN057nl6agVeQur17g=
github.com/aws/aws-sdk-go-v2/service/eks v1.105.0/go.mod h1:yqmvzWK8FGGbWvjhW1wIpbjxpJNXgz0ciG2ISBXho+Q=
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.38.1 h1:k2gT2b6kesMfFreEyOM86U3Vu/IgVz6lPZDUpECJfSM=
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.38.1/go.mod h1:rp/ZIrMxsdYHnUW9urnQ5EroaDmT1OJAg1Pc9LF8eWI=
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.60.1 h1:FiQmqRTw/46KRhlefi+0PlHscSuw6wcuosjRfau7b2g=
Expand Down Expand Up @@ -176,8 +176,8 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.40.1 h1:6yeYCWFvgbI2TI3K6jr9LtBN
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.40.1/go.mod h1:naFe83jSMuYkH+QjQPX8n1MLhBkeCFM5Lsnh5m5wz3c=
github.com/aws/aws-sdk-go-v2/service/sts v1.47.1 h1:Sv2xPnRHlThSUtVujYuUBPI/Il8si6UPHXL8DMiB/F0=
github.com/aws/aws-sdk-go-v2/service/sts v1.47.1/go.mod h1:mKo/CzaCz8qytGW70NG4vIIGAx1HXTlb5lHNkC5k3lk=
github.com/aws/smithy-go v1.28.1 h1:R/nXH00c8qcfCzQVELtRw+eLQWtzv+VAIEFJ1/xxXlQ=
github.com/aws/smithy-go v1.28.1/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
github.com/aws/smithy-go v1.28.6 h1:Pj+/sUviNYjow8ELRtNwKHZ9ECeF+7pATX3+shjLIrw=
github.com/aws/smithy-go v1.28.6/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
github.com/awslabs/amazon-eks-ami/nodeadm v0.0.0-20260213141146-147b13ea3f4a h1:xGY9gNZ4pGlqZti3DlsR8WiHz9sjjfaofG0KH0UgAhg=
github.com/awslabs/amazon-eks-ami/nodeadm v0.0.0-20260213141146-147b13ea3f4a/go.mod h1:JndTvVCUQsR9TiNZ6g9J5V2LGQkuhhgUGuxzWhNZLA0=
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
Expand Down
14 changes: 11 additions & 3 deletions pkg/actions/automode/auto_mode_updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ type Updater struct {
PodsGetter corev1client.PodsGetter
EKSUpdater EKSUpdater
Drainer NodeGroupDrainer
// ElasticLoadBalancing is the requested load balancing capability config sent when enabling Auto Mode.
// It must be captured before the cluster state is refreshed, and defaults to enabled when unset.
ElasticLoadBalancing *ekstypes.ElasticLoadBalancing
}

// Update updates the cluster to match the autoModeConfig settings supplied in clusterConfig.
Expand Down Expand Up @@ -129,9 +132,7 @@ func (u *Updater) enableAutoMode(ctx context.Context, autoModeConfig *api.AutoMo
Name: aws.String(clusterName),
ComputeConfig: computeConfigReq,
KubernetesNetworkConfig: &ekstypes.KubernetesNetworkConfigRequest{
ElasticLoadBalancing: &ekstypes.ElasticLoadBalancing{
Enabled: aws.Bool(true),
},
ElasticLoadBalancing: u.elasticLoadBalancing(),
},
StorageConfig: &ekstypes.StorageConfigRequest{
BlockStorage: &ekstypes.BlockStorage{
Expand Down Expand Up @@ -223,3 +224,10 @@ func (u *Updater) preflightCheck(ctx context.Context) error {
}
return nil
}

func (u *Updater) elasticLoadBalancing() *ekstypes.ElasticLoadBalancing {
if u.ElasticLoadBalancing != nil {
return u.ElasticLoadBalancing
}
return &ekstypes.ElasticLoadBalancing{Enabled: aws.Bool(true)}
}
47 changes: 37 additions & 10 deletions pkg/actions/automode/auto_mode_updater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ import (
)

type updaterTest struct {
autoModeConfig *api.AutoModeConfig
vpc *api.ClusterVPC
currentCluster *ekstypes.Cluster
updateMocks func(*updaterMocks)
drainNodes bool
autoModeConfig *api.AutoModeConfig
elasticLoadBalancing *ekstypes.ElasticLoadBalancing
vpc *api.ClusterVPC
currentCluster *ekstypes.Cluster
updateMocks func(*updaterMocks)
drainNodes bool

expectedErr string
}
Expand All @@ -49,10 +50,11 @@ var _ = DescribeTable("Auto Mode Updater", func(t updaterTest) {
clusterConfig.AutoModeConfig = t.autoModeConfig
clusterConfig.VPC = t.vpc
updater := &automodeactions.Updater{
RoleManager: &um.roleManager,
ClusterRoleManager: &um.clusterRoleManager,
PodsGetter: um.clientSet.CoreV1(),
EKSUpdater: &um.eksUpdater,
RoleManager: &um.roleManager,
ClusterRoleManager: &um.clusterRoleManager,
PodsGetter: um.clientSet.CoreV1(),
EKSUpdater: &um.eksUpdater,
ElasticLoadBalancing: t.elasticLoadBalancing,
}
if t.drainNodes {
updater.Drainer = &um.drainer
Expand Down Expand Up @@ -131,6 +133,27 @@ var _ = DescribeTable("Auto Mode Updater", func(t updaterTest) {
mockEnableAutoMode(u, "arn:aws:iam::000:role/CustomNodeRole", []string{api.AutoModeNodePoolGeneralPurpose})
},
}),
Entry("enabling Auto Mode with elasticLoadBalancing explicitly disabled", updaterTest{
autoModeConfig: &api.AutoModeConfig{
Enabled: api.Enabled(),
NodeRoleARN: api.MustParseARN("arn:aws:iam::000:role/CustomNodeRole"),
NodePools: &[]string{api.AutoModeNodePoolGeneralPurpose},
},
elasticLoadBalancing: &ekstypes.ElasticLoadBalancing{Enabled: aws.Bool(false)},
currentCluster: &ekstypes.Cluster{
ComputeConfig: &ekstypes.ComputeConfigResponse{
Enabled: aws.Bool(false),
},
},
updateMocks: func(u *updaterMocks) {
u.clusterRoleManager.EXPECT().UpdateRoleForAutoMode(mock.Anything).Return(nil).Once()
mockUpdateClusterConfigWithELB(u, &ekstypes.ComputeConfigRequest{
Enabled: aws.Bool(true),
NodePools: []string{api.AutoModeNodePoolGeneralPurpose},
NodeRoleArn: aws.String("arn:aws:iam::000:role/CustomNodeRole"),
}, aws.Bool(false))
},
}),
Entry("enabling Auto Mode with a pre-existing VPC", updaterTest{
autoModeConfig: &api.AutoModeConfig{
Enabled: aws.Bool(true),
Expand Down Expand Up @@ -227,12 +250,16 @@ func mockEnableAutoMode(u *updaterMocks, nodeRoleARN string, nodePools []string)
}

func mockUpdateClusterConfig(u *updaterMocks, computeConfig *ekstypes.ComputeConfigRequest) {
mockUpdateClusterConfigWithELB(u, computeConfig, computeConfig.Enabled)
}

func mockUpdateClusterConfigWithELB(u *updaterMocks, computeConfig *ekstypes.ComputeConfigRequest, elbEnabled *bool) {
u.eksUpdater.EXPECT().UpdateClusterConfig(mock.Anything, &awseks.UpdateClusterConfigInput{
Name: aws.String("cluster"),
ComputeConfig: computeConfig,
KubernetesNetworkConfig: &ekstypes.KubernetesNetworkConfigRequest{
ElasticLoadBalancing: &ekstypes.ElasticLoadBalancing{
Enabled: computeConfig.Enabled,
Enabled: elbEnabled,
},
},
StorageConfig: &ekstypes.StorageConfigRequest{
Expand Down
59 changes: 58 additions & 1 deletion pkg/apis/eksctl.io/v1alpha5/assets/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,27 @@
"description": "holds control plane scaling configuration.",
"x-intellij-html-description": "holds control plane scaling configuration."
},
"ElasticLoadBalancing": {
"properties": {
"enabled": {
"type": "boolean",
"description": "enables or disables the load balancing capability",
"x-intellij-html-description": "enables or disables the load balancing capability"
},
"gatewayApi": {
"$ref": "#/definitions/GatewayAPI",
"description": "holds the Gateway API config for the load balancing capability",
"x-intellij-html-description": "holds the Gateway API config for the load balancing capability"
}
},
"preferredOrder": [
"enabled",
"gatewayApi"
],
"additionalProperties": false,
"description": "holds the config for the load balancing capability",
"x-intellij-html-description": "holds the config for the load balancing capability"
},
"FargateProfile": {
"required": [
"name"
Expand Down Expand Up @@ -1446,6 +1467,36 @@
"x-intellij-html-description": "a map of string for passing arbitrary flags to Flux bootstrap",
"default": "{}"
},
"GatewayAPI": {
"properties": {
"crds": {
"$ref": "#/definitions/GatewayAPICRDs",
"description": "holds the config for the Gateway API CRDs",
"x-intellij-html-description": "holds the config for the Gateway API CRDs"
}
},
"preferredOrder": [
"crds"
],
"additionalProperties": false,
"description": "holds the Gateway API config for the load balancing capability",
"x-intellij-html-description": "holds the Gateway API config for the load balancing capability"
},
"GatewayAPICRDs": {
"properties": {
"managed": {
"type": "boolean",
"description": "lets EKS install and upgrade the Gateway API CRDs",
"x-intellij-html-description": "lets EKS install and upgrade the Gateway API CRDs"
}
},
"preferredOrder": [
"managed"
],
"additionalProperties": false,
"description": "holds the config for the Gateway API CRDs",
"x-intellij-html-description": "holds the config for the Gateway API CRDs"
},
"GitOps": {
"properties": {
"flux": {
Expand Down Expand Up @@ -1715,6 +1766,11 @@
},
"KubernetesNetworkConfig": {
"properties": {
"elasticLoadBalancing": {
"$ref": "#/definitions/ElasticLoadBalancing",
"description": "holds the config for the load balancing capability",
"x-intellij-html-description": "holds the config for the load balancing capability"
},
"ipFamily": {
"type": "string",
"description": "Valid variants are: `\"IPv4\"` defines an IP family of v4 to be used when creating a new VPC and cluster., `\"IPv6\"` defines an IP family of v6 to be used when creating a new VPC and cluster..",
Expand All @@ -1738,7 +1794,8 @@
"preferredOrder": [
"ipFamily",
"serviceIPv4CIDR",
"serviceIPv6CIDR"
"serviceIPv6CIDR",
"elasticLoadBalancing"
],
"additionalProperties": false,
"description": "contains cluster networking options",
Expand Down
107 changes: 107 additions & 0 deletions pkg/apis/eksctl.io/v1alpha5/elastic_load_balancing_validation_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
package v1alpha5_test

import (
"github.com/aws/aws-sdk-go-v2/aws"
ekstypes "github.com/aws/aws-sdk-go-v2/service/eks/types"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

api "github.com/weaveworks/eksctl/pkg/apis/eksctl.io/v1alpha5"
)

var _ = DescribeTable("Elastic Load Balancing Validation", func(c *api.ClusterConfig, expectedErr string) {
err := api.ValidateElasticLoadBalancing(c)
if expectedErr != "" {
Expect(err).To(MatchError(expectedErr))
} else {
Expect(err).NotTo(HaveOccurred())
}
},
Entry("no kubernetesNetworkConfig", &api.ClusterConfig{}, ""),
Entry("no elasticLoadBalancing", &api.ClusterConfig{
KubernetesNetworkConfig: &api.KubernetesNetworkConfig{},
}, ""),
Entry("elasticLoadBalancing enabled without gatewayApi", &api.ClusterConfig{
KubernetesNetworkConfig: &api.KubernetesNetworkConfig{
ElasticLoadBalancing: &api.ElasticLoadBalancing{
Enabled: api.Enabled(),
},
},
}, ""),
Entry("gatewayApi when the capability is disabled", &api.ClusterConfig{
KubernetesNetworkConfig: &api.KubernetesNetworkConfig{
ElasticLoadBalancing: &api.ElasticLoadBalancing{
Enabled: api.Disabled(),
GatewayAPI: &api.GatewayAPI{
CRDs: &api.GatewayAPICRDs{Managed: api.Enabled()},
},
},
},
}, "cannot set kubernetesNetworkConfig.elasticLoadBalancing.gatewayApi when the load balancing capability is disabled"),
Entry("gatewayApi without crds.managed", &api.ClusterConfig{
KubernetesNetworkConfig: &api.KubernetesNetworkConfig{
ElasticLoadBalancing: &api.ElasticLoadBalancing{
Enabled: api.Enabled(),
GatewayAPI: &api.GatewayAPI{},
},
},
}, "kubernetesNetworkConfig.elasticLoadBalancing.gatewayApi.crds.managed must be set to either true or false"),
Entry("gatewayApi with crds.managed", &api.ClusterConfig{
KubernetesNetworkConfig: &api.KubernetesNetworkConfig{
ElasticLoadBalancing: &api.ElasticLoadBalancing{
Enabled: api.Enabled(),
GatewayAPI: &api.GatewayAPI{
CRDs: &api.GatewayAPICRDs{Managed: api.Enabled()},
},
},
},
}, ""),
)

var _ = DescribeTable("ElasticLoadBalancingEnabled", func(c *api.ClusterConfig, expected bool) {
Expect(c.ElasticLoadBalancingEnabled()).To(Equal(expected))
},
Entry("no config", &api.ClusterConfig{}, false),
Entry("defaults to Auto Mode when unset", &api.ClusterConfig{
AutoModeConfig: &api.AutoModeConfig{Enabled: api.Enabled()},
}, true),
Entry("explicitly disabled with Auto Mode enabled", &api.ClusterConfig{
AutoModeConfig: &api.AutoModeConfig{Enabled: api.Enabled()},
KubernetesNetworkConfig: &api.KubernetesNetworkConfig{
ElasticLoadBalancing: &api.ElasticLoadBalancing{Enabled: api.Disabled()},
},
}, false),
Entry("explicitly enabled without Auto Mode", &api.ClusterConfig{
KubernetesNetworkConfig: &api.KubernetesNetworkConfig{
ElasticLoadBalancing: &api.ElasticLoadBalancing{Enabled: api.Enabled()},
},
}, true),
)

var _ = DescribeTable("ElasticLoadBalancingRequest", func(c *api.ClusterConfig, expected *ekstypes.ElasticLoadBalancing) {
Expect(c.ElasticLoadBalancingRequest()).To(Equal(expected))
},
Entry("defaults to Auto Mode", &api.ClusterConfig{
AutoModeConfig: &api.AutoModeConfig{Enabled: api.Enabled()},
}, &ekstypes.ElasticLoadBalancing{Enabled: aws.Bool(true)}),
Entry("omits gatewayApi when unset", &api.ClusterConfig{
KubernetesNetworkConfig: &api.KubernetesNetworkConfig{
ElasticLoadBalancing: &api.ElasticLoadBalancing{Enabled: api.Disabled()},
},
}, &ekstypes.ElasticLoadBalancing{Enabled: aws.Bool(false)}),
Entry("includes gatewayApi.crds.managed", &api.ClusterConfig{
KubernetesNetworkConfig: &api.KubernetesNetworkConfig{
ElasticLoadBalancing: &api.ElasticLoadBalancing{
Enabled: api.Enabled(),
GatewayAPI: &api.GatewayAPI{
CRDs: &api.GatewayAPICRDs{Managed: api.Enabled()},
},
},
},
}, &ekstypes.ElasticLoadBalancing{
Enabled: aws.Bool(true),
GatewayApi: &ekstypes.GatewayApiConfiguration{
Crds: &ekstypes.CrdManagementConfiguration{Managed: aws.Bool(true)},
},
}),
)
Loading
Loading