cert-exporter icon indicating copy to clipboard operation
cert-exporter copied to clipboard

How to configure cert-exporter on existing prometheus NS?

Open laurentiuspurba opened this issue 4 years ago • 2 comments

Hello @joe-elliott ,

I recently configured cert-exporter on sandbox environment. I used helm for the installation and installed it in cert-exporter namespace.

I can see Pod, Service, and ReplicaSet were created on cert-exporter namespace.

 kubectl -n cert-exporter get all
NAME                                              READY   STATUS    RESTARTS   AGE
pod/cert-exporter-cert-manager-67c8ffb99d-djf62   1/1     Running   0          3d21h

NAME                    TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
service/cert-exporter   ClusterIP   XX.XX.XX.XX   <none>        8080/TCP   3d21h

NAME                                         READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/cert-exporter-cert-manager   1/1     1            1           3d21h

NAME                                                    DESIRED   CURRENT   READY   AGE
replicaset.apps/cert-exporter-cert-manager-67c8ffb99d   1         1         1       3d21h

I issued kubectl port-forward --namespace cert-exporter service/cert-exporter 8080:8080 and was able to see:

  • cert_exporter_error_total, and
  • cert_exporter_secret_expires_in_seconds

from http://localhost:8080/metrics

Since, I have Prometheus configured in prometheus namespace on sandbox environment, how can I scrap the above metrics from prometheus instead of cert-exporter namespace?

Should I just configure cert-exporter helm chart to be installed on prometheus instead of cert-exporter namespace?

I appreciate your input/help on this.

Thank you, Laurentius

laurentiuspurba avatar Jan 19 '21 17:01 laurentiuspurba

This sounds like a question of Prometheus configuration. I would refer you to the Prometheus configuration docs as well as any of a number of different tutorials online that show how to set this up. Things like:

https://medium.com/kubernetes-tutorials/monitoring-your-kubernetes-deployments-with-prometheus-5665eda54045 https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config

Unless you have some kind of NetworkPolicy preventing cross namespace traffic there should be no issues setting this up.

There's nothing inherently wrong about putting cert-exporter in a prometheus namespace if that's how you want to organize things, but you will need to refer to the above docs to configure prometheus correctly to scrape cert-exporter regardless.

joe-elliott avatar Jan 19 '21 20:01 joe-elliott

Hello @joe-elliott Thanks for your info. I will look into that document, and will also install cert-exporter on prometheus namespace.

Appreciate your input on this.

laurentiuspurba avatar Jan 19 '21 20:01 laurentiuspurba