consul-k8s
consul-k8s copied to clipboard
Add named metrics port to envoy sidecar
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 Thanks for the PR, looking forward to the tests so we can review.
@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
Can we please have this checked?
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.