Kong / charts

Helm chart for Kong
Apache License 2.0
247 stars 477 forks source link

feat(servicemonitor) add relabeling to ServiceMonitor #1095

Closed mcharriere closed 3 months ago

mcharriere commented 3 months ago

What this PR does / why we need it:

This PR adds support for ServiceMonitor relabeling option allowing for manipulation of labels before scraping.

Special notes for your reviewer:

relabelings is linked to the RelabelConfigs, which is applied to samples before scraping. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config

Checklist

mcharriere commented 3 months ago

I see the tests are failing with unrelated stuff:

@@ KIND=Deployment NAME=chartsnap-gateway LINE=758
      app.kubernetes.io/managed-by: Helm
      app.kubernetes.io/name: gateway
      app.kubernetes.io/version: "3.6"
-     helm.sh/chart: gateway-2.39.2
+     helm.sh/chart: gateway-2.39.3
    name: chartsnap-gateway
    namespace: default
  spec:

should I commit all these in this PR or should it go into a separated one?

pmalek commented 3 months ago

I see the tests are failing with unrelated stuff:

@@ KIND=Deployment NAME=chartsnap-gateway LINE=758
      app.kubernetes.io/managed-by: Helm
      app.kubernetes.io/name: gateway
      app.kubernetes.io/version: "3.6"
-     helm.sh/chart: gateway-2.39.2
+     helm.sh/chart: gateway-2.39.3
    name: chartsnap-gateway
    namespace: default
  spec:

should I commit all these in this PR or should it go into a separated one?

Hi 👋

make sure to rebase on the tip of main. The reason you're seeing these is that main already includes the changes that bumped the version to 2.39.3.

Or you can alternatively include the required changes yourself by running:

make test.golden.update
mcharriere commented 3 months ago

I'm based on main. not sure why those changes were not included in the previous PR.

I added then the test.golden.update changes

pmalek commented 3 months ago

The change that you see stems from the fact that use non strict version contraints in our "umbrella" chart ingress which uses kong as subchart: https://github.com/Kong/charts/blob/2854eb81582004446fc32ca095fde097fcc45cf6/charts/ingress/Chart.yaml#L15

If that constraint was not using >= but == we'd not see that change as outstanding when kong changes its version.

We plan to sort this out.

pmalek commented 3 months ago

Thanks for the contribution @mcharriere

mcharriere commented 3 months ago

awesome! thank you for the review :)