Skip to content

Old ACM certificate is not removed from ALB #4662

@MartinEmrich

Description

@MartinEmrich

Bug Description

Old certificate stays in use by the ALB.

When replacing the TLS certificate, by updating the alb.ingress.kubernetes.io/certificate-arn: annotation, the new certificate is added as an SNI certificate, and replaced as the default certificate. But the previous certificate ARN, despite being never mentioned on the EKS cluster, is still bound as an additional SNI certificate.

AWS support also confirmed to me that adding the "new" certificate both as default certificate and again as SNI certificate is unnecessary and redundant.

Steps to Reproduce

  • Create an ACM certificicate, and an Ingress with TLS, configure that ACM certificate.
  • Create another ACM certificate (same hostname(s)).
  • Replace the ARN in the Ingress resource, let ALB controller reconcile.

Expected Behavior

Only the new certificate should be the default certificate, no need for any additional SNI certificate entries.

Actual Behavior

See above: both are still bound to the ALB.
Removing the wrong entries from the Listener is useless, they reappear after next reconcile.

Current Workarounds

Disable ALB controller.
Manually edit the ALB listener settings after the change.
Delete the old certificate before ALB controller has a chance to discover them
Re-Enable ALB controller.

Environment

  • AWS Load Balancer controller version: 3.0.0
  • Kubernetes version: 1.35
  • Using EKS (yes/no), if so version?: yes, 1.35
  • Using Service or Ingress: Ingess
  • AWS region: eu-central-1
  • How was the aws-load-balancer-controller installed: Helm chart (via Flux, thus no helm command line)
values:
  clusterName: {{ .Values.clusterName }}
  serviceAccount:
    name: aws-load-balancer-controller
    create: false
  ingressClassConfig:
    default: true

Possible Solution (Optional)

This is most likely a bug in the TLS ACM certificate autodiscovery. First, it seems to be enabled, while we both have a certificate explicitly configured, and no configuration or annotation explicitly enabling it.

Even if, if it discovers multiple certificates for the same domain name(s), it should deterministically one of them (The "best" crypto-wise, or even better, just the newest based on creation time stamp).

The documentation rather uses wordings like "can be discovered" suggesting it is optional, not mandatory. Indeed the examples all omit an explicit certificate-arn annotation, or use the tls: object in the Ingress spec.

Another cause could be that

if the spec.certificateArn in IngressClassParams or alb.ingress.kubernetes.io/certificate-arn annotation is not specified.

Is evaluated for each Ingress in the same ingress group before merge, instead of after the annotation merge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage/needs-informationIndicates an issue needs more information in order to work on it.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions