Skip to content
Dhall types for Kubernetes Prometheus Operator
Dhall
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
v1
LICENSE
README.md
imports.dhall
package.dhall

README.md

dhall-prometheus-operator

standard-readme compliant

Dhall types for Kubernetes Prometheus Operator

This repository includes types, default records, and functions that produce default records in the Dhall language which model the Prometheus Operator API domain. They are based off the Prometheus Operator documentation reference.

This allows the user to more easily generate type-safe Kubernetes resources for Prometheus/Alertmanager, through the use of the Dhall project's dhall-to-yaml tool.

Note

This project relies upon resources provided by the dhall-kubernetes project. However, as these resources are imported directly from raw.githubusercontent.com, they do not need to be manually installed.

Install

For stability, users are encouraged to import from a tagged release, not from the master branch, and to watch for new releases. This project does not yet have rigorous testing set up for it and new commits on the master branch are prone to break compatibility and are almost sure to change the import hash for the expression.

https://raw.githubusercontent.com/coralogix/dhall-prometheus-operator/v3.1.1/package.dhall sha256:1160d4c0f3d0f4750dd1644b2ba8351b197ebad4b1f577b42e7ae590f4706726

Example Usage

Example ServiceMonitor

let kubernetes = https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/4ad58156b7fdbbb6da0543d8b314df899feca077/defaults.dhall sha256:4450e23dc81975d111650e06c0238862944bf699537af6cbacac9c7e471dfabe

let Kubernetes = https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/4ad58156b7fdbbb6da0543d8b314df899feca077/types.dhall sha256:e48e21b807dad217a6c3e631fcaf3e950062310bfb4a8bbcecc330eb7b2f60ed

let PrometheusOperator = (https://raw.githubusercontent.com/coralogix/dhall-prometheus-operator/v3.1.1/package.dhall sha256:1160d4c0f3d0f4750dd1644b2ba8351b197ebad4b1f577b42e7ae590f4706726).v1

in PrometheusOperator.ServiceMonitor::{
   , metadata =
         kubernetes.ObjectMeta // { name = "example" }
   , spec =
       PrometheusOperator.ServiceMonitorSpec::{
       , selector =
             kubernetes.LabelSelector 
          // { matchLabels =
                toMap { app = "example" }
             }
       , endpoints =
         [ PrometheusOperator.Endpoint.Union.TargetPort
             PrometheusOperator.Endpoint.TargetPort::{
             , targetPort = Kubernetes.IntOrString.String "example"
             , interval = Some "60s"
             , scrapeTimeout = Some "40s"
             }
         ]
       , namespaceSelector =
           Some
             ( PrometheusOperator.NamespaceSelector.Any { any = True }
             )
       }
   }

Maintainers

Ari Becker Oded David

Contributing

TBD

License

Apache License 2.0 © Coralogix, Inc.

You can’t perform that action at this time.