Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Support for BoostrapSelfManagedAddons flag for EKS cluster creation #5222

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
Original file line number Diff line number Diff line change
Expand Up @@ -2198,6 +2198,13 @@ spec:
will be the default.
type: string
type: object
bootstrapSelfManagedAddons:
default: true
description: |-
BootstrapSelfManagedAddons is used to set configuration options for
bare EKS cluster without EKS default networking addons
If you set this value to false when creating a cluster, the default networking add-ons will not be installed
type: boolean
controlPlaneEndpoint:
description: ControlPlaneEndpoint represents the endpoint used to
communicate with the control plane.
Expand Down
1 change: 1 addition & 0 deletions controlplane/eks/api/v1beta1/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func (r *AWSManagedControlPlane) ConvertTo(dstRaw conversion.Hub) error {
dst.Spec.VpcCni.Disable = r.Spec.DisableVPCCNI
dst.Spec.Partition = restored.Spec.Partition
dst.Spec.RestrictPrivateSubnets = restored.Spec.RestrictPrivateSubnets
dst.Spec.BootstrapSelfManagedAddons = restored.Spec.BootstrapSelfManagedAddons

return nil
}
Expand Down
1 change: 1 addition & 0 deletions controlplane/eks/api/v1beta1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions controlplane/eks/api/v1beta2/awsmanagedcontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ type AWSManagedControlPlaneSpec struct { //nolint: maligned
// +optional
VpcCni VpcCni `json:"vpcCni,omitempty"`

// BootstrapSelfManagedAddons is used to set configuration options for
// bare EKS cluster without EKS default networking addons
// If you set this value to false when creating a cluster, the default networking add-ons will not be installed
// +kubebuilder:default=true
BootstrapSelfManagedAddons bool `json:"bootstrapSelfManagedAddons,omitempty"`

// RestrictPrivateSubnets indicates that the EKS control plane should only use private subnets.
// +kubebuilder:default=false
RestrictPrivateSubnets bool `json:"restrictPrivateSubnets,omitempty"`
Expand Down
5 changes: 5 additions & 0 deletions pkg/cloud/scope/managedcontrolplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,11 @@ func (s *ManagedControlPlaneScope) DisableVPCCNI() bool {
return s.ControlPlane.Spec.VpcCni.Disable
}

// BootstrapSelfManagedAddons returns whether the AWS EKS networking addons should be disabled.
func (s *ManagedControlPlaneScope) BootstrapSelfManagedAddons() bool {
return s.ControlPlane.Spec.BootstrapSelfManagedAddons
}

// VpcCni returns a list of environment variables to apply to the `aws-node` DaemonSet.
func (s *ManagedControlPlaneScope) VpcCni() ekscontrolplanev1.VpcCni {
return s.ControlPlane.Spec.VpcCni
Expand Down
5 changes: 5 additions & 0 deletions pkg/cloud/services/eks/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,11 @@ func (s *Service) createCluster(eksClusterName string) (*eks.Cluster, error) {
Tags: tags,
KubernetesNetworkConfig: netConfig,
}
// Outside of input since we want to set it only when BootstrapSelfManagedAddons set to false.
// Default is true.
if !s.scope.ControlPlane.Spec.BootstrapSelfManagedAddons {
input.BootstrapSelfManagedAddons = &s.scope.ControlPlane.Spec.BootstrapSelfManagedAddons
}

var out *eks.CreateClusterOutput
if err := wait.WaitForWithRetryable(wait.NewBackoff(), func() (bool, error) {
Expand Down