Skip to content

Commit

Permalink
Open source release candidate
Browse files Browse the repository at this point in the history
  • Loading branch information
oded-dd authored and Ari Becker committed Mar 24, 2019
1 parent 9cbca2a commit 9ec4200
Show file tree
Hide file tree
Showing 75 changed files with 1,591 additions and 1 deletion.
43 changes: 43 additions & 0 deletions ImportTypes.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{ Kubernetes =
{ core =
{ v1 =
{ Affinity =
https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/ced5c10af3b80f2053697c8d2b4621044e5e3646/types/io.k8s.api.core.v1.Affinity.dhall sha256:6221fdff507444ae05790364baa0be18eca18f7a8ba826672c66702a5d12e256
, Container =
https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/ced5c10af3b80f2053697c8d2b4621044e5e3646/types/io.k8s.api.core.v1.Container.dhall sha256:c2d62c79f10368ae923aeac4a07708c85b9a987ce3a5ec7a081e335d100b2ab1
, EmptyDirVolumeSource =
https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/ced5c10af3b80f2053697c8d2b4621044e5e3646/types/io.k8s.api.core.v1.EmptyDirVolumeSource.dhall sha256:46361385b85996dc46983a9c78d87ecc2e592ce4fc2f3df0bcc6f621bdd9d43d
, LocalObjectReference =
https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/ced5c10af3b80f2053697c8d2b4621044e5e3646/types/io.k8s.api.core.v1.LocalObjectReference.dhall sha256:30bd7e61dae821a9532f640611a37bbebac3dc2ba02b82298a5c295280f1501f
, PodSecurityContext =
https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/ced5c10af3b80f2053697c8d2b4621044e5e3646/types/io.k8s.api.core.v1.PodSecurityContext.dhall sha256:4dc5f6a586a21647d85251edf6d0348a972b5282f4d2871dfdcbbcc96b60e76b
, ResourceRequirements =
https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/ced5c10af3b80f2053697c8d2b4621044e5e3646/types/io.k8s.api.core.v1.ResourceRequirements.dhall sha256:e6a52f46fab854b0ba0f7267cbea09584e22585481acfc0959e205dd5f1cb30a
, SecretKeySelector =
https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/ced5c10af3b80f2053697c8d2b4621044e5e3646/types/io.k8s.api.core.v1.SecretKeySelector.dhall sha256:9c4e3bea86f7f805947acbf73e2886b8527517926ff5165981da2c47ed72c27c
, SELinuxOptions =
https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/ced5c10af3b80f2053697c8d2b4621044e5e3646/types/io.k8s.api.core.v1.SELinuxOptions.dhall sha256:0d7767ca8fb43a84f1301ecce981d48f09d6d8891ef56f5342709e79e2b62064
, Sysctl =
https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/ced5c10af3b80f2053697c8d2b4621044e5e3646/types/io.k8s.api.core.v1.Sysctl.dhall sha256:b8c3c0c4ceb36ba4e6674df5de20ad1d97e120b93b9ce9914a41d0036770dcc4
, Toleration =
https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/ced5c10af3b80f2053697c8d2b4621044e5e3646/types/io.k8s.api.core.v1.Toleration.dhall sha256:311a6571242358d7b210631d506dc09e89671c2012bee5799c05f0a2c0024d71
, PersistentVolumeClaim =
https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/ced5c10af3b80f2053697c8d2b4621044e5e3646/types/io.k8s.api.core.v1.PersistentVolumeClaim.dhall sha256:d400eb296094ffe392ece227c253808766ae83a2765cc7d0000971b4be9375d5
}
}
, meta =
{ v1 =
{ LabelSelector =
https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/ced5c10af3b80f2053697c8d2b4621044e5e3646/types/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector.dhall sha256:42d27b2708fa26aff105ab514c1d2db674891c9f9cdee0850e0d647435aeddb7
, ListMeta =
https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/ced5c10af3b80f2053697c8d2b4621044e5e3646/types/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta.dhall sha256:96b722fff4d997e9c32020312107b8730133ff9aedee32c5a8e30d4b762e9dcb
, ObjectMeta =
https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/ced5c10af3b80f2053697c8d2b4621044e5e3646/types/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta.dhall sha256:c952a3addcdff7cefb456dfdb8d173f068ccbc09fb971922f7b314cdd734c51f
}
}
, util =
{ IntOrString =
https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/ced5c10af3b80f2053697c8d2b4621044e5e3646/types/io.k8s.apimachinery.pkg.util.intstr.IntOrString.dhall sha256:04a91539533a52bf0bf114690cceee43b656915bd83c2731ce26ad31f516d47f
}
}
}
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2019 Coralogix, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
# dhall-prometheus-operator
# dhall-prometheus-operator
[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)

> Dhall types for Kubernetes Prometheus Operator
This repository includes types, default records, and functions that produce default records in the [Dhall language](https://github.com/dhall-lang/dhall-lang) which model the Prometheus Operator API domain. They are based off the [Prometheus Operator documentation reference](https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md).

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`](https://github.com/dhall-lang/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/v1.0.0/default/package.dhall sha256:838e95bb1a7fa385bbfdfbd56e63d9c9c157064b399c6cbc58380b5266e28be1
https://raw.githubusercontent.com/coralogix/dhall-prometheus-operator/v1.0.0/types/package.dhall sha256:92f53c84d92cda3970414a4077071b95d02a0dc701cbfc4c32e1ec8acaa252de
```

## Usage
Same as `dhall-kubernetes`.

## Maintainers
[Ari Becker](https://github.com/ari-becker)
[Oded David](https://github.com/oded-dd)

## Contributing
TBD

## License
[Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0) © Coralogix, Inc.
1 change: 1 addition & 0 deletions default/package.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ v1 = ./v1/package.dhall }
19 changes: 19 additions & 0 deletions default/v1/APIServerConfig.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
let APIServerConfig = ../../types/v1/APIServerConfig.dhall

let BasicAuth = ../../types/v1/BasicAuth.dhall

let TLSConfig = ../../types/v1/TLSConfig.dhall

in λ(_param : { host : Text })
{ host =
_param.host
, basicAuth =
None BasicAuth
, bearerToken =
None Text
, bearerTokenFile =
None Text
, tlsConfig =
None TLSConfig
}
: APIServerConfig
6 changes: 6 additions & 0 deletions default/v1/AlertingSpec.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
let AlertingSpec = ../../types/v1/AlertingSpec.dhall

let AlertmanagerEndpoints = ../../types/v1/AlertmanagerEndpoints.dhall

in λ(_param : { alertmanagers : List AlertmanagerEndpoints })
{ alertmanagers = _param.alertmanagers } : AlertingSpec
21 changes: 21 additions & 0 deletions default/v1/Alertmanager.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
let ObjectMeta = (../../ImportTypes.dhall).Kubernetes.meta.v1.ObjectMeta

let Alertmanager = ../../types/v1/Alertmanager.dhall

let AlertmanagerSpec = ../../types/v1/AlertmanagerSpec.dhall

let AlertmanagerStatus = ../../types/v1/AlertmanagerStatus.dhall

in λ(_param : { spec : AlertmanagerSpec })
{ apiVersion =
"monitoring.coreos.com/v1"
, kind =
"Alertmanager"
, metadata =
None ObjectMeta
, spec =
_param.spec
, status =
None AlertmanagerStatus
}
: Alertmanager
23 changes: 23 additions & 0 deletions default/v1/AlertmanagerEndpoints.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
let IntOrString = (../../ImportTypes.dhall).Kubernetes.util.IntOrString

let AlertmanagerEndpoints = ../../types/v1/AlertmanagerEndpoints.dhall

let TLSConfig = ../../types/v1/TLSConfig.dhall

in λ(_param : { namespace : Text, name : Text, port : IntOrString })
{ namespace =
_param.namespace
, name =
_param.name
, port =
_param.port
, scheme =
None Text
, pathPrefix =
None Text
, tlsConfig =
None TLSConfig
, bearerTokenFile =
None Text
}
: AlertmanagerEndpoints
17 changes: 17 additions & 0 deletions default/v1/AlertmanagerList.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
let ListMeta = (../../ImportTypes.dhall).Kubernetes.meta.v1.ListMeta

let AlertmanagerList = ../../types/v1/AlertmanagerList.dhall

let Alertmanager = ../../types/v1/Alertmanager.dhall

in λ(_param : { items : List Alertmanager })
{ apiVersion =
"monitoring.coreos.com/v1"
, kind =
"AlertmanagerList"
, metadata =
None ListMeta
, items =
_param.items
}
: AlertmanagerList
60 changes: 60 additions & 0 deletions default/v1/AlertmanagerSpec.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
let Kubernetes = (../../ImportTypes.dhall).Kubernetes

let AlertmanagerSpec = ../../types/v1/AlertmanagerSpec.dhall

let StorageSpec = ../../types/v1/StorageSpec.dhall

in { podMetadata =
None Kubernetes.meta.v1.ObjectMeta
, image =
None Text
, version =
None Text
, tag =
None Text
, sha =
None Text
, baseImage =
None Text
, imagePullSecrets =
None (List Kubernetes.core.v1.LocalObjectReference)
, secrets =
None (List Text)
, configMaps =
None (List Text)
, logLevel =
None Text
, replicas =
None Natural
, retention =
None Text
, storage =
None StorageSpec
, externalUrl =
None Text
, routePrefix =
None Text
, paused =
None Bool
, nodeSelector =
None (List { mapKey : Text, mapValue : Text })
, resources =
None Kubernetes.core.v1.ResourceRequirements
, affinity =
None Kubernetes.core.v1.Affinity
, tolerations =
None (List Kubernetes.core.v1.Toleration)
, securityContext =
None Kubernetes.core.v1.PodSecurityContext
, serviceAccountName =
None Text
, listenLocal =
None Bool
, containers =
None (List Kubernetes.core.v1.Container)
, priorityClassName =
None Text
, additionalPeers =
None (List Text)
}
: AlertmanagerSpec
10 changes: 10 additions & 0 deletions default/v1/BasicAuth.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
let SecretKeySelector =
(../../ImportTypes.dhall).Kubernetes.core.v1.SecretKeySelector

let BasicAuth = ../../types/v1/BasicAuth.dhall

in λ ( _params
: { username : SecretKeySelector, password : SecretKeySelector }
)
{ username = Some _params.username, password = Some _params.password }
: BasicAuth
40 changes: 40 additions & 0 deletions default/v1/Endpoint.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
let IntOrString = (../../ImportTypes.dhall).Kubernetes.util.IntOrString

let BasicAuth = ../../types/v1/BasicAuth.dhall

let RelabelConfig = ../../types/v1/RelabelConfig.dhall

let TLSConfig = ../../types/v1/TLSConfig.dhall

let Endpoint = ../../types/v1/Endpoint.dhall

in { port =
None Text
, targetPort =
None IntOrString
, path =
None Text
, scheme =
None Text
, params =
None (List { mapKey : Text, mapValue : Text })
, interval =
None Text
, scrapeTimeout =
None Text
, tlsConfig =
None TLSConfig
, bearerTokenFile =
None Text
, honorLabels =
None Bool
, basicAuth =
None BasicAuth
, metricRelabelings =
None (List RelabelConfig)
, relabelings =
None (List RelabelConfig)
, proxyUrl =
None Text
}
: Endpoint
3 changes: 3 additions & 0 deletions default/v1/NamespaceSelector.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
let NamespaceSelector = ../../types/v1/NamespaceSelector.dhall

in { any = None Bool, matchNames = None (List Text) } : NamespaceSelector
21 changes: 21 additions & 0 deletions default/v1/Prometheus.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
let Kubernetes = (../../ImportTypes.dhall).Kubernetes

let Prometheus = ../../types/v1/Prometheus.dhall

let PrometheusSpec = ../../types/v1/PrometheusSpec.dhall

let PrometheusStatus = ../../types/v1/PrometheusStatus.dhall

in λ(_param : { spec : PrometheusSpec })
{ apiVersion =
"monitoring.coreos.com/v1"
, kind =
"Prometheus"
, metadata =
None Kubernetes.meta.v1.ObjectMeta
, spec =
_param.spec
, status =
None PrometheusStatus
}
: Prometheus
17 changes: 17 additions & 0 deletions default/v1/PrometheusList.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
let Kubernetes = (../../ImportTypes.dhall).Kubernetes

let Prometheus = ../../types/v1/Prometheus.dhall

let PrometheusList = ../../types/v1/PrometheusList.dhall

in λ(_param : { items : List Prometheus })
{ apiVersion =
"monitoring.coreos.com/v1"
, kind =
"PrometheusList"
, metadata =
None Kubernetes.meta.v1.ListMeta
, items =
_param.items
}
: PrometheusList
17 changes: 17 additions & 0 deletions default/v1/PrometheusRule.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
let Kubernetes = (../../ImportTypes.dhall).Kubernetes

let PrometheusRule = ../../types/v1/PrometheusRule.dhall

let PrometheusRuleSpec = ../../types/v1/PrometheusRuleSpec.dhall

in λ(_param : { spec : PrometheusRuleSpec })
{ apiVersion =
"monitoring.coreos.com/v1"
, kind =
"PrometheusRule"
, metadata =
None Kubernetes.meta.v1.ObjectMeta
, spec =
_param.spec
}
: PrometheusRule
17 changes: 17 additions & 0 deletions default/v1/PrometheusRuleList.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
let Kubernetes = (../../ImportTypes.dhall).Kubernetes

let PrometheusRule = ../../types/v1/PrometheusRule.dhall

let PrometheusRuleList = ../../types/v1/PrometheusRuleList.dhall

in λ(_param : { items : List PrometheusRule })
{ apiVersion =
"monitoring.coreos.com/v1"
, kind =
"PrometheusRuleList"
, metadata =
None Kubernetes.meta.v1.ListMeta
, items =
_param.items
}
: PrometheusRuleList
5 changes: 5 additions & 0 deletions default/v1/PrometheusRuleSpec.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
let PrometheusRuleSpec = ../../types/v1/PrometheusRuleSpec.dhall

let RuleGroup = ../../types/v1/RuleGroup.dhall

in { groups = None (List RuleGroup) } : PrometheusRuleSpec
Loading

0 comments on commit 9ec4200

Please sign in to comment.