The snap-node-cert-exporter is a snap for the node-cert-exporter.
Install the snap from snap store and start the exporter:
$ snap install node-cert-exporterBy default, the exporter listening on port 9117. You can check the metric by
running:
$ curl localhost:9117/metrics(Optional) If the system-files interface is not connected automatically,
you can connect the system-files interface manually, this will allow the snap
to have read access to some directories in your host's /etc (/etc/ovn and
/etc/neutron in particular), which is needed for the exporter to read your
certificates:
$ snap connect node-cert-exporter:etc-ovn
$ snap connect node-cert-exporter:etc-neutronBy default, the snap will read and expose the expiration information of the
certificates reside in /etc/ovn and /etc/neutron with the extension of
[".pem", ".crt", ".cert", ".cer", ".pfx"] to Prometheus as metrics. However, you
can still fine-tune what certificates (within /etc/ovn and /etc/neutron) to
be included of the exporter via the snap configuration.
You can get a list of supported snap configuration via
$ snap get node-cert-exporterYou can change the default configuration by running snap set node-cert-exporter <key>=<value>. For example, you can include the certificates without the
appropriate extensions:
$ snap set node-cert-exporter include-glob="/etc/ovn/cert_host"You can also revert to the default vaule by running snap unset node-cert-exporter <key>. For example, you can revert the include-glob
option.
$ snap unset node-cert-exporter include-globYou need snapcraft to build the snap:
$ sudo snap install snapcraft --classicSnapcraft also requires backend to create isolated build environment, you can choose the following two backends:
- LXD, which creates container image build instances. It can be used inside virtual machines.
- Multipass, which creates virtual machine build instances. It cannot be reliably used on platforms that do not support nested virtualization. For instance, Multipass will most likely not run inside a virtual machine itself.
To build the snap:
$ make buildTo try the snap that was built, you can install it locally:
$ make installTo clean up, you can run:
$ make uninstall
$ make clean