Skip to content
Snippets Groups Projects
Unverified Commit b6768640 authored by paulfantom's avatar paulfantom
Browse files

jsonnet: remove wrapping prometheus-operator lib

parent 255cd9a1
No related branches found
No related tags found
No related merge requests found
...@@ -25,26 +25,13 @@ local defaults = { ...@@ -25,26 +25,13 @@ local defaults = {
}, },
}; };
function(params) { function(params)
local po = self, local config = defaults + params;
config:: defaults + params,
// Safety check // Safety check
assert std.isObject(po.config.resources), assert std.isObject(config.resources);
//TODO(paulfantom): it would be better to include it on the same level as self. prometheusOperator(config) {
local polib = prometheusOperator(po.config), service+: {
'0alertmanagerConfigCustomResourceDefinition': polib['0alertmanagerConfigCustomResourceDefinition'],
'0alertmanagerCustomResourceDefinition': polib['0alertmanagerCustomResourceDefinition'],
'0podmonitorCustomResourceDefinition': polib['0podmonitorCustomResourceDefinition'],
'0probeCustomResourceDefinition': polib['0probeCustomResourceDefinition'],
'0prometheusCustomResourceDefinition': polib['0prometheusCustomResourceDefinition'],
'0prometheusruleCustomResourceDefinition': polib['0prometheusruleCustomResourceDefinition'],
'0servicemonitorCustomResourceDefinition': polib['0servicemonitorCustomResourceDefinition'],
'0thanosrulerCustomResourceDefinition': polib['0thanosrulerCustomResourceDefinition'],
serviceAccount: polib.serviceAccount,
service: polib.service {
spec+: { spec+: {
ports: [ ports: [
{ {
...@@ -56,7 +43,7 @@ function(params) { ...@@ -56,7 +43,7 @@ function(params) {
}, },
}, },
serviceMonitor: polib.serviceMonitor { serviceMonitor+: {
spec+: { spec+: {
endpoints: [ endpoints: [
{ {
...@@ -72,8 +59,7 @@ function(params) { ...@@ -72,8 +59,7 @@ function(params) {
}, },
}, },
clusterRoleBinding: polib.clusterRoleBinding, clusterRole+: {
clusterRole: polib.clusterRole {
rules+: [ rules+: [
{ {
apiGroups: ['authentication.k8s.io'], apiGroups: ['authentication.k8s.io'],
...@@ -97,7 +83,7 @@ function(params) { ...@@ -97,7 +83,7 @@ function(params) {
], ],
}), }),
deployment: polib.deployment { deployment+: {
spec+: { spec+: {
template+: { template+: {
spec+: { spec+: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment