From 4eb7caab28c8e1acae179f99c20e01c72e24ff01 Mon Sep 17 00:00:00 2001 From: Frederic Branczyk Date: Mon, 30 Apr 2018 19:48:14 +0200 Subject: [PATCH] Address comments --- .../user-guides/cluster-monitoring.md | 12 +-- Makefile | 4 +- contrib/kube-prometheus/.gitignore | 2 + contrib/kube-prometheus/Makefile | 10 +- contrib/kube-prometheus/README.md | 100 ++++++++++++------ contrib/kube-prometheus/build.sh | 7 ++ contrib/kube-prometheus/example.jsonnet | 13 +++ .../kube-prometheus/examples/minikube.jsonnet | 17 +++ .../hack/cluster-monitoring/deploy | 38 ------- .../hack/cluster-monitoring/teardown | 4 - .../hack/scripts/build-jsonnet.sh | 21 ---- .../hack/scripts/kube-prometheus-base.jsonnet | 12 --- .../scripts/kube-prometheus-minikube.jsonnet | 16 --- .../kube-prometheus/kube-prometheus.libsonnet | 9 +- contrib/kube-prometheus/jsonnetfile.json | 14 +++ .../manifests/00namespace-namespace.yaml | 4 + ...alertmanagerCustomResourceDefinition.yaml} | 0 ...-0prometheusCustomResourceDefinition.yaml} | 0 ...rvicemonitorCustomResourceDefinition.yaml} | 0 ... => 0prometheus-operator-clusterRole.yaml} | 0 ...ometheus-operator-clusterRoleBinding.yaml} | 0 ... 0prometheus-operator-serviceAccount.yaml} | 0 ....yaml => alertmanager-serviceAccount.yaml} | 0 ....yaml => alertmanager-serviceMonitor.yaml} | 0 ...yaml => grafana-dashboardDatasources.yaml} | 0 ...yaml => grafana-dashboardDefinitions.yaml} | 0 ...ces.yaml => grafana-dashboardSources.yaml} | 0 ...count.yaml => grafana-serviceAccount.yaml} | 0 ...ml => kube-state-metrics-clusterRole.yaml} | 0 ...ube-state-metrics-clusterRoleBinding.yaml} | 0 ...ml => kube-state-metrics-roleBinding.yaml} | 0 ...=> kube-state-metrics-serviceAccount.yaml} | 0 ...=> kube-state-metrics-serviceMonitor.yaml} | 0 ...le.yaml => node-exporter-clusterRole.yaml} | 0 ... => node-exporter-clusterRoleBinding.yaml} | 0 ...yaml => node-exporter-serviceAccount.yaml} | 0 ...yaml => node-exporter-serviceMonitor.yaml} | 0 ...-role.yaml => prometheus-clusterRole.yaml} | 0 ...aml => prometheus-clusterRoleBinding.yaml} | 0 ...yaml => prometheus-roleBindingConfig.yaml} | 0 ...aml => prometheus-roleBindingDefault.yaml} | 0 ... => prometheus-roleBindingKubeSystem.yaml} | 0 ...l => prometheus-roleBindingNamespace.yaml} | 0 ...config.yaml => prometheus-roleConfig.yaml} | 0 ...fault.yaml => prometheus-roleDefault.yaml} | 0 ...em.yaml => prometheus-roleKubeSystem.yaml} | 0 ...ace.yaml => prometheus-roleNamespace.yaml} | 0 ...nt.yaml => prometheus-serviceAccount.yaml} | 0 ...> prometheus-serviceMonitorApiserver.yaml} | 0 ... => prometheus-serviceMonitorCoreDNS.yaml} | 0 ...-serviceMonitorKubeControllerManager.yaml} | 0 ...ometheus-serviceMonitorKubeScheduler.yaml} | 0 ... => prometheus-serviceMonitorKubelet.yaml} | 0 ... prometheus-serviceMonitorPrometheus.yaml} | 0 ...eus-serviceMonitorPrometheusOperator.yaml} | 0 55 files changed, 146 insertions(+), 137 deletions(-) create mode 100755 contrib/kube-prometheus/build.sh create mode 100644 contrib/kube-prometheus/example.jsonnet create mode 100644 contrib/kube-prometheus/examples/minikube.jsonnet delete mode 100755 contrib/kube-prometheus/hack/cluster-monitoring/deploy delete mode 100755 contrib/kube-prometheus/hack/cluster-monitoring/teardown delete mode 100755 contrib/kube-prometheus/hack/scripts/build-jsonnet.sh delete mode 100644 contrib/kube-prometheus/hack/scripts/kube-prometheus-base.jsonnet delete mode 100644 contrib/kube-prometheus/hack/scripts/kube-prometheus-minikube.jsonnet create mode 100644 contrib/kube-prometheus/jsonnetfile.json create mode 100644 contrib/kube-prometheus/manifests/00namespace-namespace.yaml rename contrib/kube-prometheus/manifests/{0prometheus-operator-0alertmanager-custom-resource-definition.yaml => 0prometheus-operator-0alertmanagerCustomResourceDefinition.yaml} (100%) rename contrib/kube-prometheus/manifests/{0prometheus-operator-0prometheus-custom-resource-definition.yaml => 0prometheus-operator-0prometheusCustomResourceDefinition.yaml} (100%) rename contrib/kube-prometheus/manifests/{0prometheus-operator-0servicemonitor-custom-resource-definition.yaml => 0prometheus-operator-0servicemonitorCustomResourceDefinition.yaml} (100%) rename contrib/kube-prometheus/manifests/{0prometheus-operator-cluster-role.yaml => 0prometheus-operator-clusterRole.yaml} (100%) rename contrib/kube-prometheus/manifests/{0prometheus-operator-cluster-role-binding.yaml => 0prometheus-operator-clusterRoleBinding.yaml} (100%) rename contrib/kube-prometheus/manifests/{0prometheus-operator-service-account.yaml => 0prometheus-operator-serviceAccount.yaml} (100%) rename contrib/kube-prometheus/manifests/{alertmanager-service-account.yaml => alertmanager-serviceAccount.yaml} (100%) rename contrib/kube-prometheus/manifests/{alertmanager-service-monitor.yaml => alertmanager-serviceMonitor.yaml} (100%) rename contrib/kube-prometheus/manifests/{grafana-dashboard-datasources.yaml => grafana-dashboardDatasources.yaml} (100%) rename contrib/kube-prometheus/manifests/{grafana-dashboard-definitions.yaml => grafana-dashboardDefinitions.yaml} (100%) rename contrib/kube-prometheus/manifests/{grafana-dashboard-sources.yaml => grafana-dashboardSources.yaml} (100%) rename contrib/kube-prometheus/manifests/{grafana-service-account.yaml => grafana-serviceAccount.yaml} (100%) rename contrib/kube-prometheus/manifests/{kube-state-metrics-cluster-role.yaml => kube-state-metrics-clusterRole.yaml} (100%) rename contrib/kube-prometheus/manifests/{kube-state-metrics-cluster-role-binding.yaml => kube-state-metrics-clusterRoleBinding.yaml} (100%) rename contrib/kube-prometheus/manifests/{kube-state-metrics-role-binding.yaml => kube-state-metrics-roleBinding.yaml} (100%) rename contrib/kube-prometheus/manifests/{kube-state-metrics-service-account.yaml => kube-state-metrics-serviceAccount.yaml} (100%) rename contrib/kube-prometheus/manifests/{kube-state-metrics-service-monitor.yaml => kube-state-metrics-serviceMonitor.yaml} (100%) rename contrib/kube-prometheus/manifests/{node-exporter-cluster-role.yaml => node-exporter-clusterRole.yaml} (100%) rename contrib/kube-prometheus/manifests/{node-exporter-cluster-role-binding.yaml => node-exporter-clusterRoleBinding.yaml} (100%) rename contrib/kube-prometheus/manifests/{node-exporter-service-account.yaml => node-exporter-serviceAccount.yaml} (100%) rename contrib/kube-prometheus/manifests/{node-exporter-service-monitor.yaml => node-exporter-serviceMonitor.yaml} (100%) rename contrib/kube-prometheus/manifests/{prometheus-cluster-role.yaml => prometheus-clusterRole.yaml} (100%) rename contrib/kube-prometheus/manifests/{prometheus-cluster-role-binding.yaml => prometheus-clusterRoleBinding.yaml} (100%) rename contrib/kube-prometheus/manifests/{prometheus-role-binding-config.yaml => prometheus-roleBindingConfig.yaml} (100%) rename contrib/kube-prometheus/manifests/{prometheus-role-binding-default.yaml => prometheus-roleBindingDefault.yaml} (100%) rename contrib/kube-prometheus/manifests/{prometheus-role-binding-kube-system.yaml => prometheus-roleBindingKubeSystem.yaml} (100%) rename contrib/kube-prometheus/manifests/{prometheus-role-binding-namespace.yaml => prometheus-roleBindingNamespace.yaml} (100%) rename contrib/kube-prometheus/manifests/{prometheus-role-config.yaml => prometheus-roleConfig.yaml} (100%) rename contrib/kube-prometheus/manifests/{prometheus-role-default.yaml => prometheus-roleDefault.yaml} (100%) rename contrib/kube-prometheus/manifests/{prometheus-role-kube-system.yaml => prometheus-roleKubeSystem.yaml} (100%) rename contrib/kube-prometheus/manifests/{prometheus-role-namespace.yaml => prometheus-roleNamespace.yaml} (100%) rename contrib/kube-prometheus/manifests/{prometheus-service-account.yaml => prometheus-serviceAccount.yaml} (100%) rename contrib/kube-prometheus/manifests/{prometheus-service-monitor-apiserver.yaml => prometheus-serviceMonitorApiserver.yaml} (100%) rename contrib/kube-prometheus/manifests/{prometheus-service-monitor-core-dns.yaml => prometheus-serviceMonitorCoreDNS.yaml} (100%) rename contrib/kube-prometheus/manifests/{prometheus-service-monitor-kube-controller-manager.yaml => prometheus-serviceMonitorKubeControllerManager.yaml} (100%) rename contrib/kube-prometheus/manifests/{prometheus-service-monitor-kube-scheduler.yaml => prometheus-serviceMonitorKubeScheduler.yaml} (100%) rename contrib/kube-prometheus/manifests/{prometheus-service-monitor-kubelet.yaml => prometheus-serviceMonitorKubelet.yaml} (100%) rename contrib/kube-prometheus/manifests/{prometheus-service-monitor-prometheus.yaml => prometheus-serviceMonitorPrometheus.yaml} (100%) rename contrib/kube-prometheus/manifests/{prometheus-service-monitor-prometheus-operator.yaml => prometheus-serviceMonitorPrometheusOperator.yaml} (100%) diff --git a/Documentation/user-guides/cluster-monitoring.md b/Documentation/user-guides/cluster-monitoring.md index e40388439..fa7fdc4e1 100644 --- a/Documentation/user-guides/cluster-monitoring.md +++ b/Documentation/user-guides/cluster-monitoring.md @@ -402,7 +402,7 @@ spec: The expression to match for selecting `ServiceMonitor`s here is that they must have a label which has a key called `k8s-app`. If you look closely at all the `Service` objects described above they all have a label called `k8s-app` and their component name this allows to conveniently select them with `ServiceMonitor`s. -[embedmd]:# (../../contrib/kube-prometheus/manifests/prometheus-service-monitor-apiserver.yaml) +[embedmd]:# (../../contrib/kube-prometheus/manifests/prometheus-serviceMonitorApiserver.yaml) ```yaml apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor @@ -430,7 +430,7 @@ spec: provider: kubernetes ``` -[embedmd]:# (../../contrib/kube-prometheus/manifests/prometheus-service-monitor-kubelet.yaml) +[embedmd]:# (../../contrib/kube-prometheus/manifests/prometheus-serviceMonitorKubelet.yaml) ```yaml apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor @@ -464,7 +464,7 @@ spec: k8s-app: kubelet ``` -[embedmd]:# (../../contrib/kube-prometheus/manifests/prometheus-service-monitor-kube-controller-manager.yaml) +[embedmd]:# (../../contrib/kube-prometheus/manifests/prometheus-serviceMonitorKubeControllerManager.yaml) ```yaml apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor @@ -486,7 +486,7 @@ spec: k8s-app: kube-controller-manager ``` -[embedmd]:# (../../contrib/kube-prometheus/manifests/prometheus-service-monitor-kube-scheduler.yaml) +[embedmd]:# (../../contrib/kube-prometheus/manifests/prometheus-serviceMonitorKubeScheduler.yaml) ```yaml apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor @@ -508,7 +508,7 @@ spec: k8s-app: kube-scheduler ``` -[embedmd]:# (../../contrib/kube-prometheus/manifests/kube-state-metrics-service-monitor.yaml) +[embedmd]:# (../../contrib/kube-prometheus/manifests/kube-state-metrics-serviceMonitor.yaml) ```yaml apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor @@ -541,7 +541,7 @@ spec: k8s-app: kube-state-metrics ``` -[embedmd]:# (../../contrib/kube-prometheus/manifests/node-exporter-service-monitor.yaml) +[embedmd]:# (../../contrib/kube-prometheus/manifests/node-exporter-serviceMonitor.yaml) ```yaml apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor diff --git a/Makefile b/Makefile index 9caf2afca..f0240e89e 100644 --- a/Makefile +++ b/Makefile @@ -102,7 +102,7 @@ generate-kube-prometheus: # Update the Prometheus Operator version in kube-prometheus sed -i \ "s/prometheusOperator: 'v.*',/prometheusOperator: 'v$(shell cat VERSION)',/" \ - contrib/kube-prometheus/jsonnet/kube-prometheus/prometheus-operator/prometheus-operator.libsonnet; + contrib/kube-prometheus/jsonnet/kube-prometheus/prometheus-operator/prometheus-operator.libsonnet; cd contrib/kube-prometheus; $(MAKE) generate-raw jsonnet: jb @@ -127,4 +127,4 @@ generate-crd: generate-openapi po-crdgen po-crdgen alertmanager > example/prometheus-operator-crd/alertmanager.crd.yaml po-crdgen servicemonitor > example/prometheus-operator-crd/servicemonitor.crd.yaml -.PHONY: all build crossbuild test format check-license container e2e-test e2e-status e2e clean-e2e embedmd apidocgen docs generate-crd +.PHONY: all build crossbuild test format check-license container e2e-test e2e-status e2e clean-e2e embedmd apidocgen docs generate-crd jb diff --git a/contrib/kube-prometheus/.gitignore b/contrib/kube-prometheus/.gitignore index 0887fe6e1..133fdf90d 100644 --- a/contrib/kube-prometheus/.gitignore +++ b/contrib/kube-prometheus/.gitignore @@ -1,2 +1,4 @@ tmp/ minikube-manifests/ +jsonnetfile.lock.json +vendor/ diff --git a/contrib/kube-prometheus/Makefile b/contrib/kube-prometheus/Makefile index 90736d616..a7903cf83 100644 --- a/contrib/kube-prometheus/Makefile +++ b/contrib/kube-prometheus/Makefile @@ -1,11 +1,9 @@ -.PHONY: image - image: docker build -f ../../scripts/jsonnet/Dockerfile -t po-jsonnet ../../ generate: image @echo ">> Compiling assets and generating Kubernetes manifests" - docker run --rm -u=$(shell id -u $(USER)):$(shell id -g $(USER)) -v `pwd`:/go/src/github.com/coreos/prometheus-operator/contrib/kube-prometheus --workdir /go/src/github.com/coreos/prometheus-operator/contrib/kube-prometheus po-jsonnet make generate-raw + docker run --rm -u=$(shell id -u $(USER)):$(shell id -g $(USER)) -v $(shell dirname $(dir $(abspath $(dir $$PWD)))):/go/src/github.com/coreos/prometheus-operator/ --workdir /go/src/github.com/coreos/prometheus-operator/contrib/kube-prometheus po-jsonnet make crdtojsonnet generate-raw crdtojsonnet: cat ../../example/prometheus-operator-crd/alertmanager.crd.yaml | gojsontoyaml -yamltojson > jsonnet/kube-prometheus/prometheus-operator/alertmanager-crd.libsonnet @@ -13,5 +11,7 @@ crdtojsonnet: cat ../../example/prometheus-operator-crd/servicemonitor.crd.yaml | gojsontoyaml -yamltojson > jsonnet/kube-prometheus/prometheus-operator/servicemonitor-crd.libsonnet generate-raw: - cd jsonnet/kube-prometheus; jb install - ./hack/scripts/build-jsonnet.sh hack/scripts/kube-prometheus-base.jsonnet manifests + jb install + ./build.sh + +.PHONY: image generate crdtojsonnet generate-raw diff --git a/contrib/kube-prometheus/README.md b/contrib/kube-prometheus/README.md index ac4497d27..3d1d27f83 100644 --- a/contrib/kube-prometheus/README.md +++ b/contrib/kube-prometheus/README.md @@ -31,7 +31,7 @@ $ minikube delete && minikube start --kubernetes-version=v1.10.1 --memory=4096 - ## Quickstart -Although this project is intended to be used as a library, a compiled version of the Kubernetes manifests generated with this library is checked into this repository in order to try the content our quickly. +Although this project is intended to be used as a library, a compiled version of the Kubernetes manifests generated with this library is checked into this repository in order to try the content out quickly. Simply create the stack: @@ -55,47 +55,44 @@ $ jb install github.com/coreos/prometheus-operator/contrib/kube-prometheus/jsonn You may wish to not use ksonnet and simply render the generated manifests to files on disk, this can be done with: -[embedmd]:# (hack/scripts/kube-prometheus-base.jsonnet) +[embedmd]:# (example.jsonnet) ```jsonnet -local kp = (import "kube-prometheus/kube-prometheus.libsonnet") + { - _config+:: { - namespace: "monitoring", - } +local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + { + _config+:: { + namespace: 'monitoring', + }, }; -{["0prometheus-operator-"+name+".yaml"]: std.manifestYamlDoc(kp.prometheusOperator[name]) for name in std.objectFields(kp.prometheusOperator)} + -{["node-exporter-"+name+".yaml"]: std.manifestYamlDoc(kp.nodeExporter[name]) for name in std.objectFields(kp.nodeExporter)} + -{["kube-state-metrics-"+name+".yaml"]: std.manifestYamlDoc(kp.kubeStateMetrics[name]) for name in std.objectFields(kp.kubeStateMetrics)} + -{["alertmanager-"+name+".yaml"]: std.manifestYamlDoc(kp.alertmanager[name]) for name in std.objectFields(kp.alertmanager)} + -{["prometheus-"+name+".yaml"]: std.manifestYamlDoc(kp.prometheus[name]) for name in std.objectFields(kp.prometheus)} + -{["grafana-"+name+".yaml"]: std.manifestYamlDoc(kp.grafana[name]) for name in std.objectFields(kp.grafana)} +{ ['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) } + +{ ['grafana-' + name]: kp.grafana[name] for name in std.objectFields(kp.grafana) } ``` -This renders all manifests in a json structure of `{filename: manifest-content}`. To split this into files on disk use: +This renders all manifests in a json structure of `{filename: manifest-content}`. -> Note you need `jsonnet`, `jq`, `sed`, `tr` and `gojsonyaml` (`go get github.com/brancz/gojsontoyaml`) installed. +### Compiling -```bash -jsonnet -J vendor example.jsonnet > tmp.json +To compile the above and get each manifest in a separate file on disk use the following script: -files=$(jq -r 'keys[]' tmp.json) +[embedmd]:# (build.sh) +```sh +#!/usr/bin/env bash +set -e +set -x -for file in ${files}; do - # prepare directory - dir=$(dirname "${file}") - path="${dir}" - mkdir -p ${path} + # optional, but we would like to generate yaml, not json +jsonnet -J vendor -m manifests example.jsonnet | xargs -I{} sh -c 'cat $1 | gojsontoyaml > $1.yaml; rm $1' -- {} - # covert file name to snake case with dashes - fullfile=$(echo ${file} | sed -r 's/([a-z0-9])([A-Z])/\1-\L\2/g' | tr '[:upper:]' '[:lower:]') - - # write each value to the path in key; convert multiple times to prettify yaml - jq -r ".[\"${file}\"]" tmp.json | gojsontoyaml -yamltojson | gojsontoyaml > "${fullfile}" -done - -rm tmp.json ``` +> Note you need `jsonnet` and `gojsonyaml` (`go get github.com/brancz/gojsontoyaml`) installed. If you just want json output, not yaml, then you can skip the pipe and everything afterwards. + +This script reads each key of the generated json and uses that as the file name, and writes the value of that key to that file. + ## Configuration A hidden `_config` field is located at the top level of the object this library provides. These are the available fields with their respective default values: @@ -145,14 +142,28 @@ Jsonnet is a turing complete language, any logic can be reflected in it. It also A common example is that not all Kubernetes clusters are created exactly the same way, meaning the configuration to monitor them may be slightly different. For [kubeadm]() and [bootkube]() clusters there are mixins available to easily configure these: kubeadm: + [embedmd]:# (examples/kubeadm.jsonnet) +```jsonnet +(import "kube-prometheus/kube-prometheus.libsonnet") + +(import "kube-prometheus/kube-prometheus-kubeadm.libsonnet") +``` bootkube: + [embedmd]:# (examples/bootkube.jsonnet) +```jsonnet +(import "kube-prometheus/kube-prometheus.libsonnet") + +(import "kube-prometheus/kube-prometheus-bootkube.libsonnet") +``` Another mixin that may be useful for exploring the stack is to expose the UIs of Prometheus, Alertmanager and Grafana on NodePorts: [embedmd]:# (examples/node-ports.jsonnet) +```jsonnet +(import "kube-prometheus/kube-prometheus.libsonnet") + +(import "kube-prometheus/kube-prometheus-node-ports.libsonnet") +``` For example the name of the `Prometheus` object provided by this library can be overridden: @@ -179,7 +190,34 @@ local daemonset = k.apps.v1beta2.daemonSet; ((import "kube-prometheus/kube-prometheus.libsonnet") + { nodeExporter+: { daemonset+: - daemonset.mixin.metadata.withNamespace("my-custom-namespace") + + daemonset.mixin.metadata.withNamespace("my-custom-namespace") } }).nodeExporter.daemonset ``` + +## Example + +To use an easy to reproduce example, let's take the minikube setup as demonstrated in [prerequisites](#Prerequisites). It is a kubeadm cluster (as we use the kubeadm bootstrapper) and because we would like easy access to our Prometheus, Alertmanager and Grafana UI we want the services to be exposed as NodePort type services: + +> Note that NodePort type services is likely not a good idea for your production use case, it is only used for demonstration purposes here. + +[embedmd]:# (examples/minikube.jsonnet) +```jsonnet +local kp = + (import 'kube-prometheus/kube-prometheus.libsonnet') + + (import 'kube-prometheus/kube-prometheus-kubeadm.libsonnet') + + (import 'kube-prometheus/kube-prometheus-node-ports.libsonnet') + + { + _config+:: { + namespace: 'monitoring', + }, + }; + +{ ['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) } + +{ ['grafana-' + name]: kp.grafana[name] for name in std.objectFields(kp.grafana) } +``` diff --git a/contrib/kube-prometheus/build.sh b/contrib/kube-prometheus/build.sh new file mode 100755 index 000000000..cefa57e89 --- /dev/null +++ b/contrib/kube-prometheus/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -e +set -x + + # optional, but we would like to generate yaml, not json +jsonnet -J vendor -m manifests example.jsonnet | xargs -I{} sh -c 'cat $1 | gojsontoyaml > $1.yaml; rm $1' -- {} + diff --git a/contrib/kube-prometheus/example.jsonnet b/contrib/kube-prometheus/example.jsonnet new file mode 100644 index 000000000..1d36eb1fc --- /dev/null +++ b/contrib/kube-prometheus/example.jsonnet @@ -0,0 +1,13 @@ +local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + { + _config+:: { + namespace: 'monitoring', + }, +}; + +{ ['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) } + +{ ['grafana-' + name]: kp.grafana[name] for name in std.objectFields(kp.grafana) } diff --git a/contrib/kube-prometheus/examples/minikube.jsonnet b/contrib/kube-prometheus/examples/minikube.jsonnet new file mode 100644 index 000000000..ed1a05c44 --- /dev/null +++ b/contrib/kube-prometheus/examples/minikube.jsonnet @@ -0,0 +1,17 @@ +local kp = + (import 'kube-prometheus/kube-prometheus.libsonnet') + + (import 'kube-prometheus/kube-prometheus-kubeadm.libsonnet') + + (import 'kube-prometheus/kube-prometheus-node-ports.libsonnet') + + { + _config+:: { + namespace: 'monitoring', + }, + }; + +{ ['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) } + +{ ['grafana-' + name]: kp.grafana[name] for name in std.objectFields(kp.grafana) } diff --git a/contrib/kube-prometheus/hack/cluster-monitoring/deploy b/contrib/kube-prometheus/hack/cluster-monitoring/deploy deleted file mode 100755 index 6be94e012..000000000 --- a/contrib/kube-prometheus/hack/cluster-monitoring/deploy +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash -# exit immediately when a command fails -set -e -# only exit with zero if all commands of the pipeline exit successfully -set -o pipefail -# error on unset variables -set -u -# print each command before executing it -set -x - -manifest_prefix=${1-./manifests} - -kubectl create namespace monitoring - -find ${manifest_prefix}/prometheus-operator/ -type f ! -name service-monitor.yaml -exec kubectl apply -f {} \; - -# Wait for CRDs to be ready. -printf "Waiting for Operator to register custom resource definitions..." -until kubectl get customresourcedefinitions servicemonitors.monitoring.coreos.com > /dev/null 2>&1; do sleep 1; printf "."; done -until kubectl get customresourcedefinitions prometheuses.monitoring.coreos.com > /dev/null 2>&1; do sleep 1; printf "."; done -until kubectl get customresourcedefinitions alertmanagers.monitoring.coreos.com > /dev/null 2>&1; do sleep 1; printf "."; done -until kubectl get servicemonitors.monitoring.coreos.com > /dev/null 2>&1; do sleep 1; printf "."; done -until kubectl get prometheuses.monitoring.coreos.com > /dev/null 2>&1; do sleep 1; printf "."; done -until kubectl get alertmanagers.monitoring.coreos.com > /dev/null 2>&1; do sleep 1; printf "."; done -echo "done!" - -# need to ensure that ServiceMonitors are registered before we can create the prometheus-operator ServiceMonitor -kubectl apply -f ${manifest_prefix}/prometheus-operator/service-monitor.yaml - -kubectl apply -f ${manifest_prefix}/node-exporter/ -kubectl apply -f ${manifest_prefix}/kube-state-metrics/ -find ${manifest_prefix}/grafana/ -type f ! -name dashboard-definitions.yaml -exec kubectl apply -f {} \; - -# kubectl apply wants to put the previous version in an annotation, which is too large, therefore create instead of apply -kubectl create -f ${manifest_prefix}/grafana/dashboard-definitions.yaml -kubectl apply -f ${manifest_prefix}/prometheus/ -kubectl apply -f ${manifest_prefix}/alertmanager/ - diff --git a/contrib/kube-prometheus/hack/cluster-monitoring/teardown b/contrib/kube-prometheus/hack/cluster-monitoring/teardown deleted file mode 100755 index 0ef9a6b3d..000000000 --- a/contrib/kube-prometheus/hack/cluster-monitoring/teardown +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -kubectl delete namespace monitoring - diff --git a/contrib/kube-prometheus/hack/scripts/build-jsonnet.sh b/contrib/kube-prometheus/hack/scripts/build-jsonnet.sh deleted file mode 100755 index 7a754e6c3..000000000 --- a/contrib/kube-prometheus/hack/scripts/build-jsonnet.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash -set -e -set -x - -jsonnet="${1-kube-prometheus.jsonnet}" -prefix="${2-manifests}" -json="tmp/manifests.json" - -rm -rf ${prefix} -mkdir -p $(dirname "${json}") -jsonnet -J jsonnet/kube-prometheus/vendor -J jsonnet ${jsonnet} > ${json} - -files=$(jq -r 'keys[]' ${json}) - -for file in ${files}; do - dir=$(dirname "${file}") - path="${prefix}/${dir}" - mkdir -p ${path} - fullfile=$(echo ${file} | sed -r 's/([a-z0-9])([A-Z])/\1-\L\2/g' | tr '[:upper:]' '[:lower:]') - jq -r ".[\"${file}\"]" ${json} | gojsontoyaml -yamltojson | gojsontoyaml > "${prefix}/${fullfile}" -done diff --git a/contrib/kube-prometheus/hack/scripts/kube-prometheus-base.jsonnet b/contrib/kube-prometheus/hack/scripts/kube-prometheus-base.jsonnet deleted file mode 100644 index 84eb3c29e..000000000 --- a/contrib/kube-prometheus/hack/scripts/kube-prometheus-base.jsonnet +++ /dev/null @@ -1,12 +0,0 @@ -local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + { - _config+:: { - namespace: 'monitoring', - }, -}; - -{ ['0prometheus-operator-' + name + '.yaml']: std.manifestYamlDoc(kp.prometheusOperator[name]) for name in std.objectFields(kp.prometheusOperator) } + -{ ['node-exporter-' + name + '.yaml']: std.manifestYamlDoc(kp.nodeExporter[name]) for name in std.objectFields(kp.nodeExporter) } + -{ ['kube-state-metrics-' + name + '.yaml']: std.manifestYamlDoc(kp.kubeStateMetrics[name]) for name in std.objectFields(kp.kubeStateMetrics) } + -{ ['alertmanager-' + name + '.yaml']: std.manifestYamlDoc(kp.alertmanager[name]) for name in std.objectFields(kp.alertmanager) } + -{ ['prometheus-' + name + '.yaml']: std.manifestYamlDoc(kp.prometheus[name]) for name in std.objectFields(kp.prometheus) } + -{ ['grafana-' + name + '.yaml']: std.manifestYamlDoc(kp.grafana[name]) for name in std.objectFields(kp.grafana) } diff --git a/contrib/kube-prometheus/hack/scripts/kube-prometheus-minikube.jsonnet b/contrib/kube-prometheus/hack/scripts/kube-prometheus-minikube.jsonnet deleted file mode 100644 index 9a6fff17d..000000000 --- a/contrib/kube-prometheus/hack/scripts/kube-prometheus-minikube.jsonnet +++ /dev/null @@ -1,16 +0,0 @@ -local kp = - (import 'kube-prometheus/kube-prometheus.libsonnet') + - (import 'kube-prometheus/kube-prometheus-kubeadm.libsonnet') + - (import 'kube-prometheus/kube-prometheus-node-ports.libsonnet') + - { - _config+:: { - namespace: 'monitoring', - }, - }; - -{ ['0prometheus-operator-' + name + '.yaml']: std.manifestYamlDoc(kp.prometheusOperator[name]) for name in std.objectFields(kp.prometheusOperator) } + -{ ['node-exporter-' + name + '.yaml']: std.manifestYamlDoc(kp.nodeExporter[name]) for name in std.objectFields(kp.nodeExporter) } + -{ ['kube-state-metrics-' + name + '.yaml']: std.manifestYamlDoc(kp.kubeStateMetrics[name]) for name in std.objectFields(kp.kubeStateMetrics) } + -{ ['alertmanager-' + name + '.yaml']: std.manifestYamlDoc(kp.alertmanager[name]) for name in std.objectFields(kp.alertmanager) } + -{ ['prometheus-' + name + '.yaml']: std.manifestYamlDoc(kp.prometheus[name]) for name in std.objectFields(kp.prometheus) } + -{ ['grafana-' + name + '.yaml']: std.manifestYamlDoc(kp.grafana[name]) for name in std.objectFields(kp.grafana) } diff --git a/contrib/kube-prometheus/jsonnet/kube-prometheus/kube-prometheus.libsonnet b/contrib/kube-prometheus/jsonnet/kube-prometheus/kube-prometheus.libsonnet index 36eae76d5..e79b75676 100644 --- a/contrib/kube-prometheus/jsonnet/kube-prometheus/kube-prometheus.libsonnet +++ b/contrib/kube-prometheus/jsonnet/kube-prometheus/kube-prometheus.libsonnet @@ -6,9 +6,14 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; (import 'alertmanager/alertmanager.libsonnet') + (import 'prometheus-operator/prometheus-operator.libsonnet') + (import 'prometheus/prometheus.libsonnet') + -(import 'kubernetes-mixin/mixin.libsonnet') + -{ +(import 'kubernetes-mixin/mixin.libsonnet') + { + kubePrometheus+:: { + namespace: k.core.v1.namespace.new($._config.namespace), + }, +} + { _config+:: { + namespace: 'default', + kubeStateMetricsSelector: 'job="kube-state-metrics"', cadvisorSelector: 'job="kubelet"', nodeExporterSelector: 'job="node-exporter"', diff --git a/contrib/kube-prometheus/jsonnetfile.json b/contrib/kube-prometheus/jsonnetfile.json new file mode 100644 index 000000000..b4ebb0f2d --- /dev/null +++ b/contrib/kube-prometheus/jsonnetfile.json @@ -0,0 +1,14 @@ +{ + "dependencies": [ + { + "name": "kube-prometheus", + "source": { + "git": { + "remote": "../../", + "subdir": "contrib/kube-prometheus/jsonnet/kube-prometheus" + } + }, + "version": "." + } + ] +} \ No newline at end of file diff --git a/contrib/kube-prometheus/manifests/00namespace-namespace.yaml b/contrib/kube-prometheus/manifests/00namespace-namespace.yaml new file mode 100644 index 000000000..d32523606 --- /dev/null +++ b/contrib/kube-prometheus/manifests/00namespace-namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: monitoring diff --git a/contrib/kube-prometheus/manifests/0prometheus-operator-0alertmanager-custom-resource-definition.yaml b/contrib/kube-prometheus/manifests/0prometheus-operator-0alertmanagerCustomResourceDefinition.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/0prometheus-operator-0alertmanager-custom-resource-definition.yaml rename to contrib/kube-prometheus/manifests/0prometheus-operator-0alertmanagerCustomResourceDefinition.yaml diff --git a/contrib/kube-prometheus/manifests/0prometheus-operator-0prometheus-custom-resource-definition.yaml b/contrib/kube-prometheus/manifests/0prometheus-operator-0prometheusCustomResourceDefinition.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/0prometheus-operator-0prometheus-custom-resource-definition.yaml rename to contrib/kube-prometheus/manifests/0prometheus-operator-0prometheusCustomResourceDefinition.yaml diff --git a/contrib/kube-prometheus/manifests/0prometheus-operator-0servicemonitor-custom-resource-definition.yaml b/contrib/kube-prometheus/manifests/0prometheus-operator-0servicemonitorCustomResourceDefinition.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/0prometheus-operator-0servicemonitor-custom-resource-definition.yaml rename to contrib/kube-prometheus/manifests/0prometheus-operator-0servicemonitorCustomResourceDefinition.yaml diff --git a/contrib/kube-prometheus/manifests/0prometheus-operator-cluster-role.yaml b/contrib/kube-prometheus/manifests/0prometheus-operator-clusterRole.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/0prometheus-operator-cluster-role.yaml rename to contrib/kube-prometheus/manifests/0prometheus-operator-clusterRole.yaml diff --git a/contrib/kube-prometheus/manifests/0prometheus-operator-cluster-role-binding.yaml b/contrib/kube-prometheus/manifests/0prometheus-operator-clusterRoleBinding.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/0prometheus-operator-cluster-role-binding.yaml rename to contrib/kube-prometheus/manifests/0prometheus-operator-clusterRoleBinding.yaml diff --git a/contrib/kube-prometheus/manifests/0prometheus-operator-service-account.yaml b/contrib/kube-prometheus/manifests/0prometheus-operator-serviceAccount.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/0prometheus-operator-service-account.yaml rename to contrib/kube-prometheus/manifests/0prometheus-operator-serviceAccount.yaml diff --git a/contrib/kube-prometheus/manifests/alertmanager-service-account.yaml b/contrib/kube-prometheus/manifests/alertmanager-serviceAccount.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/alertmanager-service-account.yaml rename to contrib/kube-prometheus/manifests/alertmanager-serviceAccount.yaml diff --git a/contrib/kube-prometheus/manifests/alertmanager-service-monitor.yaml b/contrib/kube-prometheus/manifests/alertmanager-serviceMonitor.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/alertmanager-service-monitor.yaml rename to contrib/kube-prometheus/manifests/alertmanager-serviceMonitor.yaml diff --git a/contrib/kube-prometheus/manifests/grafana-dashboard-datasources.yaml b/contrib/kube-prometheus/manifests/grafana-dashboardDatasources.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/grafana-dashboard-datasources.yaml rename to contrib/kube-prometheus/manifests/grafana-dashboardDatasources.yaml diff --git a/contrib/kube-prometheus/manifests/grafana-dashboard-definitions.yaml b/contrib/kube-prometheus/manifests/grafana-dashboardDefinitions.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/grafana-dashboard-definitions.yaml rename to contrib/kube-prometheus/manifests/grafana-dashboardDefinitions.yaml diff --git a/contrib/kube-prometheus/manifests/grafana-dashboard-sources.yaml b/contrib/kube-prometheus/manifests/grafana-dashboardSources.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/grafana-dashboard-sources.yaml rename to contrib/kube-prometheus/manifests/grafana-dashboardSources.yaml diff --git a/contrib/kube-prometheus/manifests/grafana-service-account.yaml b/contrib/kube-prometheus/manifests/grafana-serviceAccount.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/grafana-service-account.yaml rename to contrib/kube-prometheus/manifests/grafana-serviceAccount.yaml diff --git a/contrib/kube-prometheus/manifests/kube-state-metrics-cluster-role.yaml b/contrib/kube-prometheus/manifests/kube-state-metrics-clusterRole.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/kube-state-metrics-cluster-role.yaml rename to contrib/kube-prometheus/manifests/kube-state-metrics-clusterRole.yaml diff --git a/contrib/kube-prometheus/manifests/kube-state-metrics-cluster-role-binding.yaml b/contrib/kube-prometheus/manifests/kube-state-metrics-clusterRoleBinding.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/kube-state-metrics-cluster-role-binding.yaml rename to contrib/kube-prometheus/manifests/kube-state-metrics-clusterRoleBinding.yaml diff --git a/contrib/kube-prometheus/manifests/kube-state-metrics-role-binding.yaml b/contrib/kube-prometheus/manifests/kube-state-metrics-roleBinding.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/kube-state-metrics-role-binding.yaml rename to contrib/kube-prometheus/manifests/kube-state-metrics-roleBinding.yaml diff --git a/contrib/kube-prometheus/manifests/kube-state-metrics-service-account.yaml b/contrib/kube-prometheus/manifests/kube-state-metrics-serviceAccount.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/kube-state-metrics-service-account.yaml rename to contrib/kube-prometheus/manifests/kube-state-metrics-serviceAccount.yaml diff --git a/contrib/kube-prometheus/manifests/kube-state-metrics-service-monitor.yaml b/contrib/kube-prometheus/manifests/kube-state-metrics-serviceMonitor.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/kube-state-metrics-service-monitor.yaml rename to contrib/kube-prometheus/manifests/kube-state-metrics-serviceMonitor.yaml diff --git a/contrib/kube-prometheus/manifests/node-exporter-cluster-role.yaml b/contrib/kube-prometheus/manifests/node-exporter-clusterRole.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/node-exporter-cluster-role.yaml rename to contrib/kube-prometheus/manifests/node-exporter-clusterRole.yaml diff --git a/contrib/kube-prometheus/manifests/node-exporter-cluster-role-binding.yaml b/contrib/kube-prometheus/manifests/node-exporter-clusterRoleBinding.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/node-exporter-cluster-role-binding.yaml rename to contrib/kube-prometheus/manifests/node-exporter-clusterRoleBinding.yaml diff --git a/contrib/kube-prometheus/manifests/node-exporter-service-account.yaml b/contrib/kube-prometheus/manifests/node-exporter-serviceAccount.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/node-exporter-service-account.yaml rename to contrib/kube-prometheus/manifests/node-exporter-serviceAccount.yaml diff --git a/contrib/kube-prometheus/manifests/node-exporter-service-monitor.yaml b/contrib/kube-prometheus/manifests/node-exporter-serviceMonitor.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/node-exporter-service-monitor.yaml rename to contrib/kube-prometheus/manifests/node-exporter-serviceMonitor.yaml diff --git a/contrib/kube-prometheus/manifests/prometheus-cluster-role.yaml b/contrib/kube-prometheus/manifests/prometheus-clusterRole.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/prometheus-cluster-role.yaml rename to contrib/kube-prometheus/manifests/prometheus-clusterRole.yaml diff --git a/contrib/kube-prometheus/manifests/prometheus-cluster-role-binding.yaml b/contrib/kube-prometheus/manifests/prometheus-clusterRoleBinding.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/prometheus-cluster-role-binding.yaml rename to contrib/kube-prometheus/manifests/prometheus-clusterRoleBinding.yaml diff --git a/contrib/kube-prometheus/manifests/prometheus-role-binding-config.yaml b/contrib/kube-prometheus/manifests/prometheus-roleBindingConfig.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/prometheus-role-binding-config.yaml rename to contrib/kube-prometheus/manifests/prometheus-roleBindingConfig.yaml diff --git a/contrib/kube-prometheus/manifests/prometheus-role-binding-default.yaml b/contrib/kube-prometheus/manifests/prometheus-roleBindingDefault.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/prometheus-role-binding-default.yaml rename to contrib/kube-prometheus/manifests/prometheus-roleBindingDefault.yaml diff --git a/contrib/kube-prometheus/manifests/prometheus-role-binding-kube-system.yaml b/contrib/kube-prometheus/manifests/prometheus-roleBindingKubeSystem.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/prometheus-role-binding-kube-system.yaml rename to contrib/kube-prometheus/manifests/prometheus-roleBindingKubeSystem.yaml diff --git a/contrib/kube-prometheus/manifests/prometheus-role-binding-namespace.yaml b/contrib/kube-prometheus/manifests/prometheus-roleBindingNamespace.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/prometheus-role-binding-namespace.yaml rename to contrib/kube-prometheus/manifests/prometheus-roleBindingNamespace.yaml diff --git a/contrib/kube-prometheus/manifests/prometheus-role-config.yaml b/contrib/kube-prometheus/manifests/prometheus-roleConfig.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/prometheus-role-config.yaml rename to contrib/kube-prometheus/manifests/prometheus-roleConfig.yaml diff --git a/contrib/kube-prometheus/manifests/prometheus-role-default.yaml b/contrib/kube-prometheus/manifests/prometheus-roleDefault.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/prometheus-role-default.yaml rename to contrib/kube-prometheus/manifests/prometheus-roleDefault.yaml diff --git a/contrib/kube-prometheus/manifests/prometheus-role-kube-system.yaml b/contrib/kube-prometheus/manifests/prometheus-roleKubeSystem.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/prometheus-role-kube-system.yaml rename to contrib/kube-prometheus/manifests/prometheus-roleKubeSystem.yaml diff --git a/contrib/kube-prometheus/manifests/prometheus-role-namespace.yaml b/contrib/kube-prometheus/manifests/prometheus-roleNamespace.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/prometheus-role-namespace.yaml rename to contrib/kube-prometheus/manifests/prometheus-roleNamespace.yaml diff --git a/contrib/kube-prometheus/manifests/prometheus-service-account.yaml b/contrib/kube-prometheus/manifests/prometheus-serviceAccount.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/prometheus-service-account.yaml rename to contrib/kube-prometheus/manifests/prometheus-serviceAccount.yaml diff --git a/contrib/kube-prometheus/manifests/prometheus-service-monitor-apiserver.yaml b/contrib/kube-prometheus/manifests/prometheus-serviceMonitorApiserver.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/prometheus-service-monitor-apiserver.yaml rename to contrib/kube-prometheus/manifests/prometheus-serviceMonitorApiserver.yaml diff --git a/contrib/kube-prometheus/manifests/prometheus-service-monitor-core-dns.yaml b/contrib/kube-prometheus/manifests/prometheus-serviceMonitorCoreDNS.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/prometheus-service-monitor-core-dns.yaml rename to contrib/kube-prometheus/manifests/prometheus-serviceMonitorCoreDNS.yaml diff --git a/contrib/kube-prometheus/manifests/prometheus-service-monitor-kube-controller-manager.yaml b/contrib/kube-prometheus/manifests/prometheus-serviceMonitorKubeControllerManager.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/prometheus-service-monitor-kube-controller-manager.yaml rename to contrib/kube-prometheus/manifests/prometheus-serviceMonitorKubeControllerManager.yaml diff --git a/contrib/kube-prometheus/manifests/prometheus-service-monitor-kube-scheduler.yaml b/contrib/kube-prometheus/manifests/prometheus-serviceMonitorKubeScheduler.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/prometheus-service-monitor-kube-scheduler.yaml rename to contrib/kube-prometheus/manifests/prometheus-serviceMonitorKubeScheduler.yaml diff --git a/contrib/kube-prometheus/manifests/prometheus-service-monitor-kubelet.yaml b/contrib/kube-prometheus/manifests/prometheus-serviceMonitorKubelet.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/prometheus-service-monitor-kubelet.yaml rename to contrib/kube-prometheus/manifests/prometheus-serviceMonitorKubelet.yaml diff --git a/contrib/kube-prometheus/manifests/prometheus-service-monitor-prometheus.yaml b/contrib/kube-prometheus/manifests/prometheus-serviceMonitorPrometheus.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/prometheus-service-monitor-prometheus.yaml rename to contrib/kube-prometheus/manifests/prometheus-serviceMonitorPrometheus.yaml diff --git a/contrib/kube-prometheus/manifests/prometheus-service-monitor-prometheus-operator.yaml b/contrib/kube-prometheus/manifests/prometheus-serviceMonitorPrometheusOperator.yaml similarity index 100% rename from contrib/kube-prometheus/manifests/prometheus-service-monitor-prometheus-operator.yaml rename to contrib/kube-prometheus/manifests/prometheus-serviceMonitorPrometheusOperator.yaml