Skip to content

charts: Add multi-port support for Service and Ingress backends#5078

Open
Soli0222 wants to merge 1 commit intokubernetes-sigs:mainfrom
Soli0222:helm-service-ingress-multi-port
Open

charts: Add multi-port support for Service and Ingress backends#5078
Soli0222 wants to merge 1 commit intokubernetes-sigs:mainfrom
Soli0222:helm-service-ingress-multi-port

Conversation

@Soli0222
Copy link
Copy Markdown

@Soli0222 Soli0222 commented Apr 7, 2026

Summary

This PR adds multi-port support to the Helm chart so that sidecar containers added via deployment.extraContainers can be exposed through the same Headlamp Service and Ingress without maintaining a separate Service resource.

Related Issue

Fixes #5077

Changes

  • Added service.extraServicePorts[] to append extra ports to the existing Headlamp Service (name / port / targetPort / protocol / nodePort).
  • Added ingress.hosts[].paths[].backend.service.{name,port} so each Ingress path can override its backend. When backend is omitted the existing behavior (default Service / service.port) is preserved, so existing values files keep working unchanged.
  • Updated values.yaml, values.schema.json, and README.md to document both fields.
  • Added chart tests covering extraServicePorts and multi-backend Ingress (default fallback / port.name / port.number / templated name).

Steps to Test

  1. bash charts/headlamp/tests/test.sh — all existing tests still pass (backward compatibility) and the two new test cases (service-extra-ports, ingress-multi-backend) pass.
  2. Render the chart with the example values below and confirm the Service has both http and plugin ports, and the Ingress routes /plugin to port name plugin:
    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
  3. helm lint charts/headlamp — clean.

Screenshots (if applicable)

N/A (chart-only change)

Notes for the Reviewer

  • The new fields are purely additive; the default rendered output is unchanged, which the existing test suite confirms.
  • The chart intentionally does not auto-create matching containerPort entries — users wiring a sidecar via extraContainers are expected to declare the port on the container side.
  • The Gateway API path (httpRoute.rules) already accepts arbitrary backendRefs, so no template change was needed there; the README notes how to combine it with extraServicePorts.
  • ingress.hosts[].paths[].backend.service.name is rendered through tpl so values like {{ .Release.Name }}-other work. Happy to drop this and treat the field as a literal string if you'd prefer to keep the trust boundary tighter.

Signed-off-by: Soli0222 <github@str08.net>
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Soli0222
Once this PR has been reviewed and has the lgtm label, please assign illume for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Apr 7, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: Soli0222 / name: Soli0222 (637ca9f)

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @Soli0222!

It looks like this is your first PR to kubernetes-sigs/headlamp 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/headlamp has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot requested review from illume and skoeva April 7, 2026 12:49
@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 7, 2026
@itvi-1234
Copy link
Copy Markdown
Contributor

Hey @Soli0222 , Kindly sign the CNCF-CLA

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Apr 7, 2026
@Soli0222
Copy link
Copy Markdown
Author

Soli0222 commented Apr 7, 2026

Hi @itvi-1234, I just signed the CNCF-CLA. Could you please review it?

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants