argo-helm icon indicating copy to clipboard operation
argo-helm copied to clipboard

[argo-cd helm] ServiceMonitors from argoCD helm installation not working

Open ellipsis-me opened this issue 2 months ago • 5 comments

Describe the bug

I was trying to install argoCD with metrics and serviceMonitors enabled, but I noticed a error with serviceMonitors template, which the if condition to enable the serviceMonitor was not being satisfied. Turning impossible my installation with the remote official Charts repository, in which I must need to install with Metrics for my prometheus exporter. My label for prometheus was already checked.

Related helm chart

argo-cd

Helm chart version

6.7.11

To Reproduce

My configuration accordingly the documentation:

controller:
    metrics:
      enabled: true
      serviceMonitor:
        enabled: true
        selector:
        release: kube-prometheus
dex:
    metrics:
      enabled: true
      serviceMonitor:
        enabled: true
        selector:
        release: kube-prometheus
  
redis:
    metrics:
      enabled: true
      serviceMonitor:
        enabled: true
        selector:
        release: kube-prometheus

server:
    metrics:
      enabled: true
      serviceMonitor:
        enabled: true
        selector:
        release: kube-prometheus

Refering to the official template, the if condition that tried to render locally isn't working: https://github.com/argoproj/argo-helm/blob/main/charts/argo-cd/templates/argocd-application-controller/servicemonitor.yaml#L1

As above, metrics.enabled AND serviceMonitor.enabled was defined as true, and my cluster has the necessary API to handle that:
image

Expected behavior

I was expecting, the serviceMonitors resources for argoCD beeing deployed in my installation, but it isn't beeing possible so far.

Screenshots

image

Additional context

No response

ellipsis-me avatar Apr 12 '24 00:04 ellipsis-me

Hi @ellipsis-me , In the yaml you shared above, metrics has 4 indent, not 2 indent. So I wonder if your values.yaml is correct. 🤔

# This doesn't work
controller:
    metrics:
      enabled: true
      serviceMonitor:
        enabled: true
        selector:
        release: kube-prometheus

# But this works, I think.
controller:
  metrics:
    enabled: true
    serviceMonitor:
      enabled: true
      selector:
      release: kube-prometheus

yu-croco avatar Apr 17 '24 01:04 yu-croco

Hi @yu-croco YAML don't have the need of more spaces, I already did 1 indent, more than that is the same. https://yaml.org/spec/1.2-old/spec.html#id2777534

I even used yq tool to find the value

But ignore that indentation, I just typed more in my comment, but the code is Ok.

ellipsis-me avatar Apr 17 '24 14:04 ellipsis-me

Hi @ellipsis-me , thank you for your reply.

Maybe this is the cause... 👀 https://github.com/helm/helm/issues/10760#issuecomment-1065225097

yu-croco avatar Apr 18 '24 10:04 yu-croco

The issue I faced was that that the dex deployment metric's port is named metrics, but the default value used in the service monitor is http-metrics. If you change .Values.dex.metrics.service.portName to metrics it should work.

QustodioPablo avatar May 10 '24 10:05 QustodioPablo