Skip to content

Potential issue with backends not being rendered when using named service/pod ports #25

Description

@robert-sokol

Hello, I've encountered a strange issue with gateway not creating any backend servers, if the backend pod/service are using named 80/tcp ports.

This results in requests returning 503s, and the haproxy.cfg in HUG pods having no server lines for that backend. Both Service and Pod listens do return 200s. Issue only seems to happen if the named http port is 80, for 8080/tcp for example, it doesn't fail to add backend servers. It also doesn't manifest if targetPort in service is using exact port instead of a name reference.

Example backend port snippet:

    ports:
    - containerPort: 80
      name: http
      protocol: TCP
    - containerPort: 2111
      name: metrics
      protocol: TCP

Example Service snippet:

  ports:
  - name: api
    port: 80
    protocol: TCP
    targetPort: http
  - name: metrics
    port: 2111
    protocol: TCP
    targetPort: metrics

HTTPRoute snippet:

spec:
  hostnames:
  - test.foobar.com
  parentRefs:
  - group: gateway.networking.k8s.io
    kind: Gateway
    name: haproxy-gateway
    namespace: haproxy-unified-gateway
  rules:
  - backendRefs:
    - group: ""
      kind: Service
      name: foobar
      port: 80
      weight: 1
    matches:
    - path:
        type: PathPrefix
        value: /

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions