Skip to content

Commit 3ebf018

Browse files
authored
Merge pull request #4346 from synthe102/main
feat: add support for EKS addon configuration
2 parents 2d96288 + 2d14efc commit 3ebf018

File tree

13 files changed

+72
-0
lines changed

13 files changed

+72
-0
lines changed

config/crd/bases/controlplane.cluster.x-k8s.io_awsmanagedcontrolplanes.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ spec:
7676
items:
7777
description: Addon represents a EKS addon.
7878
properties:
79+
configuration:
80+
description: Configuration of the EKS addon
81+
type: string
7982
conflictResolution:
8083
default: none
8184
description: ConflictResolution is used to declare what should
@@ -1530,6 +1533,9 @@ spec:
15301533
items:
15311534
description: Addon represents a EKS addon.
15321535
properties:
1536+
configuration:
1537+
description: Configuration of the EKS addon
1538+
type: string
15331539
conflictResolution:
15341540
default: overwrite
15351541
description: ConflictResolution is used to declare what should

controlplane/eks/api/v1beta1/types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ type Addon struct {
130130
Name string `json:"name"`
131131
// Version is the version of the addon to use
132132
Version string `json:"version"`
133+
// Configuration of the EKS addon
134+
// +optional
135+
Configuration string `json:"configuration,omitempty"`
133136
// ConflictResolution is used to declare what should happen if there
134137
// are parameter conflicts. Defaults to none
135138
// +kubebuilder:default=none

controlplane/eks/api/v1beta1/zz_generated.conversion.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

controlplane/eks/api/v1beta2/types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ type Addon struct {
130130
Name string `json:"name"`
131131
// Version is the version of the addon to use
132132
Version string `json:"version"`
133+
// Configuration of the EKS addon
134+
// +optional
135+
Configuration string `json:"configuration,omitempty"`
133136
// ConflictResolution is used to declare what should happen if there
134137
// are parameter conflicts. Defaults to none
135138
// +kubebuilder:default=overwrite

pkg/cloud/services/eks/addons.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ func (s *Service) getClusterAddonsInstalled(eksClusterName string, addonNames []
125125
Name: describeOutput.Addon.AddonName,
126126
Version: describeOutput.Addon.AddonVersion,
127127
ARN: describeOutput.Addon.AddonArn,
128+
Configuration: describeOutput.Addon.ConfigurationValues,
128129
Tags: infrav1.Tags{},
129130
Status: describeOutput.Addon.Status,
130131
ServiceAccountRoleARN: describeOutput.Addon.ServiceAccountRoleArn,
@@ -196,6 +197,7 @@ func (s *Service) translateAPIToAddon(addons []ekscontrolplanev1.Addon) []*eksad
196197
convertedAddon := &eksaddons.EKSAddon{
197198
Name: &addon.Name,
198199
Version: &addon.Version,
200+
Configuration: &addon.Configuration,
199201
Tags: ngTags(s.scope.Cluster.Name, s.scope.AdditionalTags()),
200202
ResolveConflict: convertConflictResolution(*addon.ConflictResolution),
201203
ServiceAccountRoleARN: addon.ServiceAccountRoleArn,

pkg/eks/addons/procedures.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ func (p *UpdateAddonProcedure) Do(ctx context.Context) error {
7979
AddonName: desired.Name,
8080
AddonVersion: desired.Version,
8181
ClusterName: &p.plan.clusterName,
82+
ConfigurationValues: desired.Configuration,
8283
ResolveConflicts: desired.ResolveConflict,
8384
ServiceAccountRoleArn: desired.ServiceAccountRoleARN,
8485
}
@@ -147,6 +148,7 @@ func (p *CreateAddonProcedure) Do(ctx context.Context) error {
147148
AddonName: desired.Name,
148149
AddonVersion: desired.Version,
149150
ClusterName: &p.plan.clusterName,
151+
ConfigurationValues: desired.Configuration,
150152
ServiceAccountRoleArn: desired.ServiceAccountRoleARN,
151153
ResolveConflicts: desired.ResolveConflict,
152154
Tags: convertTags(desired.Tags),

pkg/eks/addons/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type EKSAddon struct {
2727
Name *string
2828
Version *string
2929
ServiceAccountRoleARN *string
30+
Configuration *string
3031
Tags infrav1.Tags
3132
ResolveConflict *string
3233
ARN *string

test/e2e/data/e2e_eks_conf.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ variables:
128128
EXP_EKS_ADD_ROLES: "false"
129129
VPC_ADDON_VERSION: "v1.11.4-eksbuild.1"
130130
COREDNS_ADDON_VERSION: "v1.8.7-eksbuild.3"
131+
COREDNS_ADDON_CONFIGURATION: '{"replicaCount":3}'
131132
KUBE_PROXY_ADDON_VERSION: "v1.24.7-eksbuild.2"
132133
CONFORMANCE_CI_ARTIFACTS_KUBERNETES_VERSION: "1.24.4"
133134
IP_FAMILY: "IPv4"

test/e2e/data/eks/cluster-template-eks-control-plane-only-withaddon.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ spec:
4343
- name: "coredns"
4444
version: "${COREDNS_ADDON_VERSION}"
4545
conflictResolution: "overwrite"
46+
configuration: '${COREDNS_ADDON_CONFIGURATION}'
4647
identityRef:
4748
kind: AWSClusterStaticIdentity
4849
name: e2e-account

test/e2e/shared/defaults.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const (
4444
CNIResources = "CNI_RESOURCES"
4545
CNIAddonVersion = "VPC_ADDON_VERSION"
4646
CorednsAddonVersion = "COREDNS_ADDON_VERSION"
47+
CorednsAddonConfiguration = "COREDNS_ADDON_CONFIGURATION"
4748
GcWorkloadPath = "GC_WORKLOAD"
4849
KubeproxyAddonVersion = "KUBE_PROXY_ADDON_VERSION"
4950
AwsNodeMachineType = "AWS_NODE_MACHINE_TYPE"

0 commit comments

Comments
 (0)