Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define container ports for MeshMetric so that PodMonitor can consume them #13281

Open
slonka opened this issue Apr 1, 2025 · 1 comment
Open
Labels
kind/improvement Improvement on an existing feature triage/accepted The issue was reviewed and is complete enough to start working on it

Comments

@slonka
Copy link
Contributor

slonka commented Apr 1, 2025

Description

PodMonitor requires a port to be defined so that it can be matched and configure prometheus. For sidecars we can work around this by having a container patch:

apiVersion: kuma.io/v1alpha1
kind: ContainerPatch
metadata:
  name: sc-container-patch
  namespace: kuma-system
spec:
  sidecarPatch:
    - op: add
      path: /ports
      value: '[{ "containerPort": 5670, "name":"metrics"}]'

and then the sidecar shows up:

Image

for Builtin Gateway we need to change the controller code:

container.Name = k8s_util.KumaGatewayContainerName

to generate the ports based on MeshMetric.

A possible other solution would be to have the Container Patch also patch gateways.

I used https://github.com/prometheus-operator/kube-prometheus?tab=readme-ov-file#quickstart to install prometheus operator.

xrel: #5180 (comment)

@slonka slonka added kind/improvement Improvement on an existing feature triage/pending This issue will be looked at on the next triage meeting labels Apr 1, 2025
@Automaat
Copy link
Contributor

Automaat commented Apr 7, 2025

Triage: If we really need this support in Gateway it should be done in MeshGatewayInstance podTemplate

@Automaat Automaat added triage/accepted The issue was reviewed and is complete enough to start working on it and removed triage/pending This issue will be looked at on the next triage meeting labels Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/improvement Improvement on an existing feature triage/accepted The issue was reviewed and is complete enough to start working on it
Projects
None yet
Development

No branches or pull requests

2 participants