I&B Monitoring Platform documentation

ArgoCD metrics

To enable metrics expose from argocd controller you need to install in kubernetes with helm and set value

Bash
 helm install argocd argo/argo-cd \
   --set controller.metrics.enabled=true \
   --set <your values>

after this deploy your argocd expose metrics in kubernetes on http://argocd-application-controller-metrics.argocd.svc.cluster.local:8082/metrics

For access with basic auth and encryption from outside the kubernetes you need to deploy kubernetes ingress object with basic autentification and tls encryption. For this do.

  1. Create a Secret for Basic Authentication

First, generate a .htpasswd file containing the username and a hashed password. For example, to create a user named prometheus with a password, use the htpasswd utility:

htpasswd -c auth prometheus

This command will prompt for a password and create a file named auth in the current directory. Next, create a Kubernetes Secret from this file:

kubectl create secret generic basic-auth --from-file=auth

This creates a Secret named basic-auth in your current namespace, containing the auth file as a key in its data.

  1. Create self signed certificate as its created in section Authentication

  2. Create kubernetes secret from this certificate

kubectl create secret tls argocd-local-tls \
  --cert=exporter.crt \
  --key=exporter.key

Create the yaml file of ingress with tls and basic auth

nano argocd-metrics.yaml

and paste into opened file

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: argocd-metrics
  annotations:
    argocd.ingress.kubernetes.io/auth-type: basic  #basic auth annotation
    argocd.ingress.kubernetes.io/auth-secret: basic-auth   #basic auth annotation
    argocd.ingress.kubernetes.io/auth-realm: 'Authentication Required - user'   #basic auth annotation
spec:
  ingressClassName: nginx
  tls:
    - hosts:
        - argocd-metrics.com
      secretName: argocd-local-tls
  rules:
  - host: argocd-metrics.com
    http:
      paths:
      - path: /metrics
        pathType: Prefix
        backend:
          service:
            name: argocd-application-controller-metrics
            port:
              number: 8082

Save and exit from file. And create ingress object. For this run

kubectl apply -f argocd-metrics.yaml

After deploy ingress, metrics of your ingress controller will exposed on url: https://argocd-metrics.com/metrics

after login to this URL you will see some like this:

image-20251003-080407.png

Enjoy!)