Skip to content

Comments

fix(chart): port value for websecure Gateway listener in the traefik chart#1673

Open
falzm wants to merge 1 commit intotraefik:masterfrom
falzm:fix-websecure-listener-port
Open

fix(chart): port value for websecure Gateway listener in the traefik chart#1673
falzm wants to merge 1 commit intotraefik:masterfrom
falzm:fix-websecure-listener-port

Conversation

@falzm
Copy link

@falzm falzm commented Feb 15, 2026

What does this PR do?

This change fixes an error when trying to use the pre-set websecure listener in the traefik chart values. Apparently, there is a known issue issue with go-yaml deserializing numbers into float64 instead of int64, and the usual workaround is to cast it manually to an int type.

I've also updated the JSON Schema to actually include support for the gateway.listeners.websecure object in addition to gateway.listeners.web, as it was previously missing – probably related to the fact that this value is optional and disabled by default, however the schema should include it anyway.

Motivation

Currently, trying to use the pre-set websecure Gateway listener results in this error:

$ helm template --set api.dashboard=false \
  --set providers.kubernetesGateway.enabled=true \
  --set gateway.listeners.web.namespacePolicy.from=All \
  --set gateway.listeners.websecure.namespacePolicy.from=All \
  --set gateway.listeners.websecure.port=8443 \
  --set gateway.listeners.websecure.protocol=TLS \
  --set gateway.listeners.websecure.mode=Passthrough \
  traefik ./traefik-39.0.1 # <- local template obtained via `helm pull traefik/traefik --version 39.0.1`
Error: template: traefik/templates/gateway.yaml:34:15: executing "traefik/templates/gateway.yaml" at <eq $portConfig.port $config.port>: error calling eq: incompatible types for comparison: float64 and int64

With this fix, the Gateway resource is correctly rendered:

$ helm template --set api.dashboard=false \
  --set providers.kubernetesGateway.enabled=true \
  --set gateway.listeners.web.namespacePolicy.from=All \
  --set gateway.listeners.websecure.namespacePolicy.from=All \
  --set gateway.listeners.websecure.port=8443 \
  --set gateway.listeners.websecure.protocol=TLS \
  --set gateway.listeners.websecure.mode=Passthrough \
  --show-only templates/gateway.yaml \
  traefik ./traefik-helm-chart/traefik # <-- local Git repository fork including fix

---
# Source: traefik/templates/gateway.yaml
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: traefik-gateway
  namespace: default
  labels:
    app.kubernetes.io/name: traefik
    app.kubernetes.io/instance: traefik-default
    helm.sh/chart: traefik-39.0.1
    app.kubernetes.io/managed-by: Helm
spec:
  gatewayClassName: traefik
  listeners:
    - name: web
      port: 8000
      protocol: HTTP
      allowedRoutes:
        namespaces:
          from: All


    - name: websecure
      port: 8443
      protocol: TLS
      allowedRoutes:
        namespaces:
          from: All


      tls:

        mode: Passthrough

More

  • Yes, I updated the tests accordingly
  • Yes, I updated the schema accordingly
  • Yes, I ran make test and all the tests passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant