Skip to content

ELB healthcheck misconfigured when annotation value is lowercase #1181

@samuel-esp

Description

@samuel-esp

This issue is only valid for Classic ELB, the equivalent configuration for NLB healthchecks works fine

Behavior:

When a Classic ELB is created with the following annotation

service.beta.kubernetes.io/aws-load-balancer-healthcheck-protocol: http

if the value is written in lowercase ("http" or "tcp") the entire healthcheck configuration gets corrupted as shown in the AWS Console

Image

Expected Behavior:

The ELB should have been created with the following configuration

Image

To Reproduce:

Starting from a YAML like this

apiVersion: v1
kind: Service
metadata:
  name: test
  namespace: default
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
    service.beta.kubernetes.io/aws-load-balancer-healthcheck-path: /test
    service.beta.kubernetes.io/aws-load-balancer-healthcheck-port: "31001"
    service.beta.kubernetes.io/aws-load-balancer-healthcheck-protocol: http
spec:
  type: LoadBalancer
  selector:
    app: test
  ports:
    - name: http
      port: 80
      targetPort: 8080
      nodePort: 31001

the healthcheck configuration gets corrupted as shown above

while the following configurations (with "HTTP" written uppercase) creates the expected configuration

apiVersion: v1
kind: Service
metadata:
  name: test
  namespace: default
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
    service.beta.kubernetes.io/aws-load-balancer-healthcheck-path: /test
    service.beta.kubernetes.io/aws-load-balancer-healthcheck-port: "31001"
    service.beta.kubernetes.io/aws-load-balancer-healthcheck-protocol: HTTP
spec:
  type: LoadBalancer
  selector:
    app: test
  ports:
    - name: http
      port: 80
      targetPort: 8080
      nodePort: 31001

Since other annotations support values written in lowercase, it should be also possible to specify the healthcheck protocol lowercase

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version): EKS 1.31
  • Cloud provider or hardware configuration: AWS

/kind bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions