Skip to content

charts: Allow extra Service ports and per-path Ingress backends for sidecar plugins #5077

@Soli0222

Description

@Soli0222

Is your feature request related to a problem? Please describe the impact that the lack of the feature requested is creating.

The Helm chart already supports adding sidecar containers to the Headlamp pod via extraContainers (e.g. for plugins or auxiliary processes), but exposing those sidecars to clients is currently awkward:

  • service.port only exposes a single port (http), so a sidecar listening on a different port cannot be reached through the Headlamp Service. Users have to either patch the Service after install or maintain a second Service resource alongside the chart.
  • The Ingress template renders every ingress.hosts[].paths[] entry with the same hardcoded backend (fullname Service / service.port). Multiple rules and paths can be defined, but they all point at the same backend port, so there is no way to route e.g. / to Headlamp and /plugin to a sidecar port through the same Ingress.

Describe the solution you'd like

Two additive, backward-compatible changes to charts/headlamp:

  1. service.extraServicePorts[] — append additional ports to the existing Headlamp Service. Each entry takes name / port / targetPort (defaults to port) / protocol (defaults to TCP) / nodePort (only honored when service.type is NodePort / LoadBalancer).
  2. ingress.hosts[].paths[].backend.service.{name,port} — allow each Ingress path to override the backend Service / port. When backend is not specified the existing behavior (default Service / service.port) is preserved, so existing values files keep working unchanged. port accepts either number or name, and name can reference an entry from service.extraServicePorts[].

Example:

service:
  extraServicePorts:
    - name: plugin
      port: 9090
      targetPort: plugin
ingress:
  enabled: true
  hosts:
    - host: headlamp.example.com
      paths:
        - path: /
          type: Prefix
        - path: /plugin
          type: Prefix
          backend:
            service:
              port:
                name: plugin

Combined with deployment.extraContainers (a sidecar listening on containerPort: 9090 named plugin), this routes /plugin/* to the sidecar and / to Headlamp through a single Service and Ingress.

Notes:

  • The chart does not auto-create matching containerPort entries — users wiring a sidecar via extraContainers are responsible for declaring the port on the container side.
  • The Gateway API path (httpRoute.rules) already accepts arbitrary backendRefs, so no template change is needed there; documenting how to combine it with extraServicePorts is enough.

What users will benefit from this feature?

Helm chart users who run Headlamp together with sidecar containers — most notably plugin developers who package a plugin backend as an extraContainers sidecar and want to expose it through the same Service/Ingress as Headlamp itself, without maintaining a separate Service resource outside the chart.

Are you able to implement this feature?

Yes (I will propose a PR).

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    chartskind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions