consul-k8s icon indicating copy to clipboard operation
consul-k8s copied to clipboard

Add named metrics port to envoy sidecar

Open hamishforbes opened this issue 3 years ago • 2 comments

Relates to #671

Changes proposed in this PR:

  • Adds a containerPort configuration to the injected Envoy sidecar for the metrics port
  • TODO: A test! draft until i add that

The targetPort field on Prometheus Operator ports accepts a port name, using an integer port number is deprecated.

Without any named ports on the injected container it is not possible to configure a ServiceMonitor or PodMonitor resource (without using a deprecated feature) in order to scrape metrics from a Prometheus Operator managed Prometheus instance

How I've tested this PR: I've been running this patch in production for nearly a year

How I expect reviewers to test this PR: Confirm the injected envoy sidecar on a Connect enabled pod has a ports configuration:

  name: envoy-sidecar
  ports:
  - containerPort: 20200
    name: envoy-metrics
    protocol: TCP

Checklist:

  • [ ] Tests added
  • [ ] CHANGELOG entry added

    HashiCorp engineers only, community PRs should not add a changelog entry. Entries should use present tense (e.g. Add support for...)

hamishforbes avatar Aug 22 '22 03:08 hamishforbes

@hamishforbes Thanks for the PR, looking forward to the tests so we can review.

david-yu avatar Sep 07 '22 05:09 david-yu

@david-yu I've added a basic test Is it possible to get CI to run here?

Most of the tests fail in my local environment (not the one i've added, that I can see anyway) and I don't really want to waste time figuring out why, there's no doco that I can find on how to setup the local dev env either

hamishforbes avatar Sep 12 '22 22:09 hamishforbes

Can we please have this checked?

mokrinsky avatar Sep 15 '23 23:09 mokrinsky

Hey all 👋 . I put up a new PR that is updated for both consul-dataplane usage and our new multiport API. I made sure to add the OP as a co-author. Let's track any further discussion there.

DanStough avatar Nov 16 '23 16:11 DanStough