puppetlabs / puppetserver-helm-chart

The Helm Chart for Puppet Server
Apache License 2.0
52 stars 56 forks source link

Enabling JMX Monitoring Results in Duplicate Labels #237

Open trexx opened 3 months ago

trexx commented 3 months ago

Describe the Bug

A clear and concise description of what the bug is.

The configmap for the JMX configuration contains duplicate labels.

apiVersion: v1
kind: ConfigMap
metadata:
  name: release-name-puppetserver-jmx-config
  labels:
    app.kubernetes.io/component: puppetserver
    app.kubernetes.io/name: puppetserver
    app.kubernetes.io/instance: release-name
    app.kubernetes.io/managed-by: Helm
    helm.sh/chart: puppetserver-9.5.2
    app.kubernetes.io/version: 7.17.0
    app.kubernetes.io/component: puppetserver-compilers
    app.kubernetes.io/name: puppetserver
    app.kubernetes.io/instance: release-name
    app.kubernetes.io/managed-by: Helm
    helm.sh/chart: puppetserver-9.5.2
    app.kubernetes.io/version: 7.17.0

This causes helm / argocd to barf.

Expected Behavior (Behaviour)

No duplicate labels.

Steps to Reproduce

Steps to reproduce the behavior (Behaviour):

  metrics:
    prometheus:
      disableAPICheck: true
      puppetdb:
        enabled: true
      jmx:
        enabled: true

Its likely its unnecessary we have the compiler labels and it maybe possible to have them removed.

Xtigyro commented 3 months ago

Hey @trexx - this chart is 100% community maintained. Please feel free to send our way a PR if you have the time and energy for helping us.

davidphay commented 1 week ago

for information, the issue is generated with both lines:

https://github.com/puppetlabs/puppetserver-helm-chart/blob/619cbb8a85fa2e9890a56bfb819baa7cc3c588e0/templates/jmx-configmap.yaml#L7 https://github.com/puppetlabs/puppetserver-helm-chart/blob/619cbb8a85fa2e9890a56bfb819baa7cc3c588e0/templates/jmx-configmap.yaml#L8

Both have a reference on {{ include "puppetserver.common.metaLabels" . }} in _helpers.tpl.

Possible solutions (but not tested):

Based on the other files, I guess the first solution should be used and preserve puppetserver.puppetserver.labels