joe-elliott / cert-exporter

A Prometheus exporter that publishes cert expirations on disk and in Kubernetes secrets
Apache License 2.0
317 stars 87 forks source link

Export deployment fails in AKS #36

Closed kasunsjc closed 4 years ago

kasunsjc commented 4 years ago

I'm trying to deploy this to an AKS cluster and it gives me errors as below. I already have Prometheus and Grafana installed on the cluster.

Error 1

error: unable to recognize "cert-exporter-prom.yaml": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"

Error 2

Unable to mount volumes for pod "cert-exporter-687jg_monitoring(6ed154a9-f624-460c-9501-e3735a92c707)": timeout expired waiting for volumes to attach or mount for pod "monitoring"/"cert-exporter-687jg". list of unmounted volumes=[kube-proxy kube-root]. list of unattached volumes=[kubelet kube-proxy kube-root default-token-x9gwr]

MountVolume.SetUp failed for volume "kube-proxy" : hostPath type check failed: /var/lib/kube-proxy is not a directory

MountVolume.SetUp failed for volume "kube-root" : hostPath type check failed: /srv/kubernetes is not a directory

Any insight into how to resolve this

joe-elliott commented 4 years ago

You appear to be applying the daemonset-prom-operator.yaml. This was an example built for the prom operator and contributed to the project. It does not appear to meet your needs.

If you are looking to just monitor certs created by cert-manager then I recommend trying this file:

https://github.com/joe-elliott/cert-exporter/blob/master/docs/cert-manager.yaml

kasunsjc commented 4 years ago

In our case, we are not using cert-manager. But we want to monitor SSL expiration for certificates in Ingress controller

joe-elliott commented 4 years ago

Well this project monitors certificates on disk and in k8s secrets. Based on those details I am unsure if it will work for your use case.

You should also consider this project which will pull certs using an https request and print metrics: https://github.com/prometheus/blackbox_exporter

kasunsjc commented 4 years ago

Thanks !! will check this