Created
June 28, 2019 15:00
-
-
Save towens/0a2b30ae56025bd2d031134f5d75d156 to your computer and use it in GitHub Desktop.
jsonnet - kube-prometheus monitoring extra namespace and adding a persistent volume claim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; | |
local pvc = k.core.v1.persistentVolumeClaim; | |
local kp = | |
(import 'kube-prometheus/kube-prometheus.libsonnet') + | |
// Uncomment the following imports to enable its patches | |
// (import 'kube-prometheus/kube-prometheus-anti-affinity.libsonnet') + | |
// (import 'kube-prometheus/kube-prometheus-managed-cluster.libsonnet') + | |
// (import 'kube-prometheus/kube-prometheus-node-ports.libsonnet') + | |
// (import 'kube-prometheus/kube-prometheus-static-etcd.libsonnet') + | |
// (import 'kube-prometheus/kube-prometheus-thanos.libsonnet') + | |
{ | |
_config+:: { | |
namespace: 'monitoring', | |
prometheus+:: { | |
namespaces+: ['other-namespace'], | |
prometheus+:{ | |
spec+: { | |
retention: '30d', | |
storage: { | |
volumeClaimTemplate: | |
pvc.new() + | |
pvc.mixin.spec.withAccessModes('ReadWriteOnce') + | |
pvc.mixin.spec.resources.withRequests({ storage: '50Gi'}) + | |
pvc.mixin.spec.withStorageClassName('gp2'), | |
}, | |
}, | |
}, | |
}, | |
}, | |
}; | |
{ ['00namespace-' + name]: kp.kubePrometheus[name] for name in std.objectFields(kp.kubePrometheus) } + | |
{ ['0prometheus-operator-' + name]: kp.prometheusOperator[name] for name in std.objectFields(kp.prometheusOperator) } + | |
{ ['node-exporter-' + name]: kp.nodeExporter[name] for name in std.objectFields(kp.nodeExporter) } + | |
{ ['kube-state-metrics-' + name]: kp.kubeStateMetrics[name] for name in std.objectFields(kp.kubeStateMetrics) } + | |
{ ['alertmanager-' + name]: kp.alertmanager[name] for name in std.objectFields(kp.alertmanager) } + | |
{ ['prometheus-' + name]: kp.prometheus[name] for name in std.objectFields(kp.prometheus) } + | |
{ ['prometheus-adapter-' + name]: kp.prometheusAdapter[name] for name in std.objectFields(kp.prometheusAdapter) } + | |
{ ['grafana-' + name]: kp.grafana[name] for name in std.objectFields(kp.grafana) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Contents of
manifests/prometheus-prometheus.yaml