MartinPotier / dhall-prometheus-operator

Dhall types for Kubernetes Prometheus Operator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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/v8.0.0/package.dhall sha256:ebc5f0c5f57d410412c2b7cbb64d0883be648eafc094f0c3e10dba4e6bd46ed4

Example Usage

Example ServiceMonitor

let Kubernetes = https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/v6.0.0/package.dhall sha256:532e110f424ea8a9f960a13b2ca54779ddcac5d5aa531f86d82f41f8f18d7ef1

let PrometheusOperator = (https://raw.githubusercontent.com/coralogix/dhall-prometheus-operator/v8.0.0/package.dhall sha256:ebc5f0c5f57d410412c2b7cbb64d0883be648eafc094f0c3e10dba4e6bd46ed4).v1

in PrometheusOperator.ServiceMonitor::{
   , metadata =
         Kubernetes.ObjectMeta::{ name = Some "example" }
   , spec =
       PrometheusOperator.ServiceMonitorSpec::{
       , selector =
             Kubernetes.LabelSelector::{
             , matchLabels = Some
                (toMap { app = "example" })
             }
       , endpoints =
         Some [ 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 Shauli Solomovich

Contributing

TBD

License

Apache License 2.0 © Coralogix, Inc.

About

Dhall types for Kubernetes Prometheus Operator

License:Other


Languages

Language:Dhall 97.4%Language:Nix 1.8%Language:Shell 0.8%