Skip to content

Helm: expose kthena-router debug containerPort when debugPort is enabled #1276

Description

@StLeoX

Summary

The kthena-router Helm deployment already passes --debug-port={{ .Values.kthenaRouter.debugPort }} to the router process, but the Pod spec does not declare a matching debug containerPort.

As a result, the router's localhost-only debug server exists and serves /debug/pprof/*, but users who want to profile the router still need to carry a manual Deployment patch/overlay to make that debug port explicit in the rendered Pod spec.

Current behavior

Today the chart renders:

  • charts/kthena/charts/networking/templates/kthena-router/component/deployment.yaml
    • args include --debug-port={{ .Values.kthenaRouter.debugPort }}
    • ports: only includes:
      • http
      • webhook (conditional)

The router itself already starts a dedicated localhost debug server and exposes pprof handlers:

  • cmd/kthena-router/main.go
    • --debug-port flag defaults to 15000
  • cmd/kthena-router/app/router.go
    • debug server listens on localhost:<debugPort>
    • pprof endpoints are registered under /debug/pprof/*

Why this matters

Because the chart does not declare the debug containerPort, benchmark/debugging workflows need an extra manual patch like:

spec:
  template:
    spec:
      containers:
        - name: kthena-router
          ports:
            - containerPort: 15000
              name: debug

Even though the process already listens on that port.

Expected behavior

When kthenaRouter.debugPort is set, the Helm deployment should also declare a corresponding container port, for example:

ports:
  - containerPort: {{ .Values.kthenaRouter.port }}
    name: http
  - containerPort: {{ .Values.kthenaRouter.debugPort }}
    name: debug

This does not need a Service because the debug server is localhost-only; the main value is making the Pod spec complete and avoiding per-environment patch overlays for debugging workflows.

Possible implementation

Update:

  • charts/kthena/charts/networking/templates/kthena-router/component/deployment.yaml

So that ports: includes the debug entry when kthenaRouter.debugPort is non-zero.

Optionally document it in the chart values comments as well.

Acceptance criteria

  • kthena-router Deployment renders a debug containerPort when kthenaRouter.debugPort is enabled.
  • Existing default behavior remains backward compatible.
  • No external Service is added for the debug port.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions