From d7fc1eb32b53b914820d7777698f71f9a339234c Mon Sep 17 00:00:00 2001 From: Frederic Branczyk <fbranczyk@gmail.com> Date: Wed, 21 Nov 2018 16:22:06 +0100 Subject: [PATCH] kube-prometheus: Adapt CoreDNS default configuration to default CoreDNS installs --- jsonnet/kube-prometheus/kube-prometheus.libsonnet | 2 ++ jsonnet/kube-prometheus/prometheus/prometheus.libsonnet | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jsonnet/kube-prometheus/kube-prometheus.libsonnet b/jsonnet/kube-prometheus/kube-prometheus.libsonnet index 2dd32b50..f59cc80f 100644 --- a/jsonnet/kube-prometheus/kube-prometheus.libsonnet +++ b/jsonnet/kube-prometheus/kube-prometheus.libsonnet @@ -29,6 +29,7 @@ local configMapList = k.core.v1.configMapList; kubeSchedulerSelector: 'job="kube-scheduler"', kubeControllerManagerSelector: 'job="kube-controller-manager"', kubeApiserverSelector: 'job="apiserver"', + coreDNSSelector: 'job="kube-dns"', podLabel: 'pod', alertmanagerSelector: 'job="alertmanager-main"', @@ -45,6 +46,7 @@ local configMapList = k.core.v1.configMapList; Alertmanager: $._config.alertmanagerSelector, Prometheus: $._config.prometheusSelector, PrometheusOperator: $._config.prometheusOperatorSelector, + CoreDNS: $._config.coreDNSSelector, }, prometheus+:: { diff --git a/jsonnet/kube-prometheus/prometheus/prometheus.libsonnet b/jsonnet/kube-prometheus/prometheus/prometheus.libsonnet index fafcd4d6..f9de222e 100644 --- a/jsonnet/kube-prometheus/prometheus/prometheus.libsonnet +++ b/jsonnet/kube-prometheus/prometheus/prometheus.libsonnet @@ -386,11 +386,9 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; }, }, spec: { - jobLabel: 'k8s-app', selector: { matchLabels: { - 'k8s-app': 'coredns', - component: 'metrics', + 'k8s-app': 'kube-dns', }, }, namespaceSelector: { @@ -400,7 +398,7 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; }, endpoints: [ { - port: 'http-metrics', + port: 'metrics', interval: '15s', bearerTokenFile: '/var/run/secrets/kubernetes.io/serviceaccount/token', }, -- GitLab