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

Fix servicemonitor relabeling #456

Merged
merged 2 commits into from
Jun 8, 2023
Merged

Conversation

kubroid
Copy link
Contributor

@kubroid kubroid commented Jun 5, 2023

Trying to deploy keda using this values file:

prometheus:
  operator:
    enabled: true
    port: 8080
    serviceMonitor:
      enabled: true
      relabellings:
      - regex: (rest_client_.*|go_.*|workqueue_.*)
        action: drop

Result is:

Error: YAML parse error on keda/templates/manager/servicemonitor.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key

Checklist

Fixes #
Helm chart fixed to use right indents.

helm template -f a.yaml -n keda . | grep ServiceMonitor -A20
kind: ServiceMonitor
metadata:
  name: keda-operator
  annotations:
    {}
  labels:
    app.kubernetes.io/name: keda-operator    
    helm.sh/chart: keda-2.10.2
    app.kubernetes.io/component: operator
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/instance: release-name
    app.kubernetes.io/part-of: keda-operator
    app.kubernetes.io/version: 2.10.1
spec:
  endpoints:
  - port: metrics
    path: /metrics
    relabelings:
      - action: drop
        regex: (rest_client_.*|go_.*|workqueue_.*)
  namespaceSelector:

@kubroid kubroid requested a review from a team as a code owner June 5, 2023 16:36
@JorTurFer
Copy link
Member

Looking good, could you update the test values yaml to use service monitor on all the resources with a relabeling (to prevent this in the future)?
You can achieve it modifying this section: https://github.com/kedacore/charts/blob/main/.github/workflows/ci-core.yml#L107-L115

@kubroid
Copy link
Contributor Author

kubroid commented Jun 6, 2023

Sure. Test data updated. Templating is ok, but helm deploy failing on timeout. Is it common?

@JorTurFer
Copy link
Member

Is it common?

No it isn't. Metrics server pod is failing to start, which shouldn't happen. I don't think that it's related with your commit, let me check

@kubroid
Copy link
Contributor Author

kubroid commented Jun 6, 2023

The only idea I have is an invalid regex expression. Had no chance to check it in real deployment.

@JorTurFer
Copy link
Member

The only idea I have is an invalid regex expression. Had no chance to check it in real deployment.

I don't think that it's enough to break the metrics server startup as it's something related with Prometheus, not with the metrics server itself. I'll test it locally during the morning

@kubroid
Copy link
Contributor Author

kubroid commented Jun 6, 2023

Thanks Jorge.
One more thing to discuss: here is inconsistency between relabellings and relabelings. Do we want to fix this?

@JorTurFer
Copy link
Member

Thanks Jorge. One more thing to discuss: here is inconsistency between relabellings and relabelings. Do we want to fix this?

It'd be nice, but we should maintain backward compatibility, so we can't just rename it, we have to maintain both, the old one and the new one (adding a deprecation note on the old one)

@JorTurFer
Copy link
Member

It's because there is a PR merged in core but still not merged here: #432
Let me push it

@JorTurFer
Copy link
Member

JorTurFer commented Jun 6, 2023

Could you rebase your branch? The pending PR has been merged

@kubroid
Copy link
Contributor Author

kubroid commented Jun 6, 2023

Done

Signed-off-by: Alexey Kubrinsky <akubrinsky@zetaglobal.com>
@JorTurFer
Copy link
Member

I'm on top of main:

* 0bd1bc1 - (18 hours ago) Fix servicemonitor relabeling - Alexey Kubrinsky (HEAD -> fix-servicemonitor, origin/fix-servicemonitor)                                                                                                                                                       
* c5fad71 - (5 days ago) fix(http-add-on): Fix resources variables for the http-add-on deploym… (#454) - Jocelyn Thode (origin/main, origin/HEAD, main)                                                                                                                                   

This is the commit that you need: 502980f

@kubroid
Copy link
Contributor Author

kubroid commented Jun 6, 2023

Sorry, did pull from my fork instead of keda repo

Signed-off-by: Alexey Kubrinsky <akubrinsky@zetaglobal.com>
@kubroid
Copy link
Contributor Author

kubroid commented Jun 6, 2023

Jorge, please check last commit. Made relabelling deprecated. Is it good?

@JorTurFer
Copy link
Member

I think so.
Do we need to create an issue for the deprecation @tomkerkhove ?

@tomkerkhove
Copy link
Member

Yes, we should follow https://github.com/kedacore/governance/blob/main/DEPRECATIONS.md#introducing-new-deprecations.

I'll do this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants