Terraform module to deploy blackbox-exporter on kubernetes.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Christophe van de Kerchove c257487a70
fix: Error in alert rule groups output
1 week ago
examples/default tech: adapt example to changes 2 weeks ago
templates fix: Make dashboard generic for import 1 week ago
.gitignore feat: Initial import of module 4 weeks ago
.pre-commit-config.yaml feat: Initial import of module 4 weeks ago
AUTHORS feat: Initial import of module 4 weeks ago
CHANGELOG.md fix: Make dashboard generic for import 1 week ago
Jenkinsfile tech: improve Jenkinsfile 4 weeks ago
LICENSE feat: Initial import of module 4 weeks ago
README.md feat: Add default alerts as output of the module. 1 week ago
main.tf fix: Error in alert rule groups output 1 week ago
outputs.tf fix: Output descriptions 4 weeks ago
variables.tf feat: Add default alerts as output of the module. 1 week ago
versions.tf feat: Initial import of module 4 weeks ago

README.md

terraform-module-kubernetes-blackbox-exporter

Terraform module to deploy blackbox-exporter on kubernetes.

Providers

Name Version
kubernetes >= 1.10.0
random >= 2.0.0

Inputs

Name Description Type Default Required
annotations Additionnal annotations that will be merged on all resources. map {} no
config_map_annotations Additionnal annotations that will be merged for the config map. map {} no
config_map_labels Additionnal labels that will be merged for the config map. map {} no
config_map_name Name of the config map that will be created. string "blackbox-exporter" no
configuration Object representating the configuration for blackbox-exporter. documentation (will be converted into yaml) any
{
“modules”: {
“http_2xx”: {
“prober”: “http"
},
“http_post_2xx”: {
“http”: {
“method”: “POST"
},
“prober”: “http"
},
“icmp”: {
“prober”: “icmp"
},
“irc_banner”: {
“prober”: “tcp”,
“tcp”: {
“query_response”: [
{
“send”: “NICK prober"
},
{
“send”: “USER prober prober prober :prober"
},
{
“expect”: “PING :([^ ]+)",
“send”: “PONG 1"
},
{
“expect”: “^:[^ ]+ 001"
}
]
}
},
“pop3s_banner”: {
“prober”: “tcp”,
“tcp”: {
“query_response”: [
{
“expect”: “^+OK"
}
],
“tls”: true,
“tls_config”: {
“insecure_skip_verify”: false
}
}
},
“ssh_banner”: {
“prober”: “tcp”,
“tcp”: {
“query_response”: [
{
“expect”: “^SSH-2.0-“
}
]
}
},
“tcp_connect”: {
“prober”: “tcp"
}
}
}
no
deployment_annotations Additionnal annotations that will be merged on the deployment. map {} no
deployment_labels Additionnal labels that will be merged on the deployment. map {} no
deployment_name Name of the deployment that will be create. string "blackbox-exporter" no
deployment_template_annotations Additionnal annotations that will be merged on the deployment template. map {} no
deployment_template_labels Additionnal labels that will be merged on the deployment template. map {} no
enabled Whether or not to enable this module. bool true no
image_name Name of the docker image to use. string "prom/blackbox-exporter" no
image_pull_policy Image pull policy on the main container. string "IfNotPresent" no
image_version Tag of the docker image to use. string "v0.16.0" no
labels Additionnal labels that will be merged on all resources. map {} no
module_targets List of objects representing all the targets you want to activate the blackbox-exporter on (with it's modules). Note: This value is used by the prometheus configuration helper which is the prometheus_scrape_configs output.
list(object({
name = string
targets = list(string)
labels = map(string)
}))
[] no
namespace Namespace in which the module will be deployed. string "default" no
prometheus_alert_groups_rules_annotations Map of strings that will be merge on all prometheus alert groups rules annotations. map {} no
prometheus_alert_groups_rules_labels Map of strings that will be merge on all prometheus alert groups rules labels. map {} no
replicas Number of replicas to deploy. number 1 no
service_annotations Additionnal annotations that will be merged for the service. map {} no
service_labels Additionnal labels that will be merged for the service. map {} no
service_name Name of the service that will be create string "blackbox-exporter" no

Outputs

Name Description
config_map_annotations Map of annotations that are configured on the config_map.
config_map_labels Map of labels that are configured on the config_map.
config_map_name Name of the config_map created by the module.
deployment_annotations Map of annotations that are configured on the deployment.
deployment_labels Map of labels that are configured on the deployment.
deployment_name Name of the deployment created by the module.
deployment_template_annotations Map of annotations that are configured on the deployment.
deployment_template_labels Map of labels that are configured on the deployment.
grafana_dashboards List of strings representing grafana dashbaords under the form of json strings.
image_name Name of the docker image used for the blackbox-exporter container.
image_pull_policy Image pull policy defined on the blackbox-exporter container.
image_version Tag of the docker image used for the blackbox-exporter container.
namespace Name of the namespace in which the resources have been deployed.
prometheus_alert_groups List of object representing prometheus alert groups you can importer for prometheus to alert you in case of problems.
prometheus_scrape_configs List of objects representing the promehteus scrape configs you need import for prometheus to scrape this exporter.
selector_labels Map of the labels that are used as selectors.
service_annotations Map of annotations that are configured on the service.
service_labels Map of labels that are configured on the service.
service_name Name of the service created by the module.
service_port Port number of the service port.
service_port_name Name of the service port.

prometheus_scrape_configs

The prometheus scrape config output is a helper to generate static prometheus scrape configs for the targets passed as vairable. The following assumptions are made:

  • prometheus is scraping from the same kubernetes cluster
  • there are no blocking network policies

In addition, the eporter's metrics will automatically be discovered by prometheus if the kubernetes_to_sd configuration is correctly configured.