Skip to content

(aws-eks): ALB Controller wrong value keys for repository and tag in HelmChart #18054

@sdomme

Description

@sdomme

What is the problem?

Hi,
it is not possible to define a different repository and version for albController in the aws-cdk-lib/aws-eks Cluster construct. The alb-controller.ts library use the wrong values schema for the Helm chart:

values: {
clusterName: props.cluster.clusterName,
serviceAccount: {
create: false,
name: serviceAccount.serviceAccountName,
},
region: Stack.of(this).region,
vpcId: props.cluster.vpc.vpcId,
repository: props.repository ?? '602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-load-balancer-controller',
tag: props.version.version,
},

It needs to be:

image:
  repository: 602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-load-balancer-controller
  tag: v2.3.1

See here:
https://github.com/aws/eks-charts/blob/a78f6372c9739ed4a2472ee2eeba4cb8810a0a93/stable/aws-load-balancer-controller/values.yaml#L7-L10

Reproduction Steps

this.cluster = new Cluster(this, props.clusterName, {
      clusterName: props.clusterName,
      version: KubernetesVersion.of(props.kubernetes_version),
      defaultCapacity: 0,
      mastersRole: mastersRole,
      ...
      albController: {
        version: AlbControllerVersion.V2_3_0,
        repository: '602401143452.dkr.ecr.eu-central-1.amazonaws.com/amazon/aws-load-balancer-controller'
      }
    })

What did you expect to happen?

ALB Controller is deployed to use the defined version and repository for container image.

What actually happened?

Because the chart version is pinned to:

ALB Controller deployment uses default values defined for this version.

https://github.com/aws/eks-charts/blob/676c3c25bfbabd9b0b916ac3f555a39e0b851ecb/stable/aws-load-balancer-controller/values.yaml

image:
  repository: 602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-load-balancer-controller
  tag: v2.2.4

CDK CLI Version

2.2.0 (build 4f5c27c)

Framework Version

No response

Node.js Version

v17.0.1

OS

MacOS

Language

Typescript

Language Version

typescript@4.5.2

Other information

No response

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-eksRelated to Amazon Elastic Kubernetes ServicebugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.p1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions