The purpose of this repository is to provide a means of creating Prometheus Operator custom resources using Terraform.
What is Prometheus Operator?
Prometheus Operator provides Kubernetes native deployment and management of Prometheus and related monitoring components. Notably, Prometheus Operator includes custom resources to deploy and manage Prometheus, Alertmanager, and related components.
Why not Jsonnet?
The Prometheus community wrote a design document to present a technique for packaging and deploying extensible and customizable configurations of dashboards, alert definitions, and exporters. The design, known as "Monitoring Mixins", uses Jsonnet to package together said resources.
While Jsonnet is an incredibly powerful data templating language, it comes with a steep learning curve. For example, The kube-prometheus
project uses Jsonnet to create dashboards and alerts used to monitor Kubernetes clusters. Understanding how to customize or create new resources using these libraries is not very straightforward and becomes problematic when using the kube-prometheus-stack
Helm chart.
Moreover, Terraform offers numerous providers to add resources that it can manage. For example, the AWS provider can be used to interact with the many resources supported by AWS.
This repository comes with the following Terraform modules:
prometheusrule
- Creates aPrometheusRule
object which defines a desired set of Prometheus alerting and/or recording rules
Instructions for using each module is described in their respective README files. Each module also contains an examples
directory that contains valid and tested Terraform configurations.
Please refer to the CONTRIBUTING document for more information.
Name | Version |
---|---|
terraform | >= 1.0 |
helm | >= 2.6.0 |
kubernetes | >= 2.12.1 |
Name | Version |
---|---|
kubernetes | >= 2.12.1 |
Name | Source | Version |
---|---|---|
grafana | ./modules/grafana | n/a |
prometheus | ./modules/prometheus | n/a |
Name | Type |
---|---|
kubernetes_config_map.this | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
namespace | Namespace defines the space within which each name must be unique. | string |
"default" |
no |
No outputs.