Skip to content

Commit

Permalink
Add bootstrap self managed addons flag to eks controlplane spec
Browse files Browse the repository at this point in the history
  • Loading branch information
jas-nik committed Nov 20, 2024
1 parent df09e6c commit 7e4ed51
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 0 deletions.
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

0 comments on commit 7e4ed51

Please sign in to comment.