From 0af131844517e47edf92bf1234c3d862779f8a0d Mon Sep 17 00:00:00 2001 From: Louise Champ Date: Tue, 15 Jan 2019 19:19:29 +0000 Subject: [PATCH] add configmap and secret collectors (#10665) Signed-off-by: Louise Champ --- stable/kube-state-metrics/Chart.yaml | 2 +- stable/kube-state-metrics/README.md | 2 ++ stable/kube-state-metrics/templates/clusterrole.yaml | 12 ++++++++++++ stable/kube-state-metrics/templates/deployment.yaml | 6 ++++++ stable/kube-state-metrics/values.yaml | 2 ++ 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/stable/kube-state-metrics/Chart.yaml b/stable/kube-state-metrics/Chart.yaml index faaddbd5bd9b..3b0bad43d13b 100644 --- a/stable/kube-state-metrics/Chart.yaml +++ b/stable/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.12.1 +version: 0.12.2 appVersion: 1.4.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/stable/kube-state-metrics/README.md b/stable/kube-state-metrics/README.md index 50f070760b84..3f4d6d044a63 100644 --- a/stable/kube-state-metrics/README.md +++ b/stable/kube-state-metrics/README.md @@ -29,6 +29,7 @@ $ helm install stable/kube-state-metrics | `tolerations` | Tolerations for pod assignment | [] | | `podAnnotations` | Annotations to be added to the pod | {} | | `resources` | kube-state-metrics resource requests and limits | {} | +| `collectors.configmaps` | Enable the configmaps collector. | true | | `collectors.cronjobs` | Enable the cronjobs collector. | true | | `collectors.daemonsets` | Enable the daemonsets collector. | true | | `collectors.deployments` | Enable the deployments collector. | true | @@ -44,5 +45,6 @@ $ helm install stable/kube-state-metrics | `collectors.replicasets` | Enable the replicasets collector. | true | | `collectors.replicationcontrollers` | Enable the replicationcontrollers collector. | true | | `collectors.resourcequotas` | Enable the resourcequotas collector. | true | +| `collectors.secrets` | Enable the secrets collector. | true | | `collectors.services` | Enable the services collector. | true | | `collectors.statefulsets` | Enable the statefulsets collector. | true | diff --git a/stable/kube-state-metrics/templates/clusterrole.yaml b/stable/kube-state-metrics/templates/clusterrole.yaml index b12e8712ccab..756a06ad30cb 100644 --- a/stable/kube-state-metrics/templates/clusterrole.yaml +++ b/stable/kube-state-metrics/templates/clusterrole.yaml @@ -9,6 +9,12 @@ metadata: release: {{ .Release.Name }} name: {{ template "kube-state-metrics.fullname" . }} rules: +{{ if .Values.collectors.configmaps }} +- apiGroups: [""] + resources: + - configmaps + verbs: ["list", "watch"] +{{ end -}} {{ if .Values.collectors.cronjobs }} - apiGroups: ["batch"] resources: @@ -99,6 +105,12 @@ rules: - resourcequotas verbs: ["list", "watch"] {{ end -}} +{{ if .Values.collectors.secrets }} +- apiGroups: [""] + resources: + - secrets + verbs: ["list", "watch"] +{{ end -}} {{ if .Values.collectors.services }} - apiGroups: [""] resources: diff --git a/stable/kube-state-metrics/templates/deployment.yaml b/stable/kube-state-metrics/templates/deployment.yaml index 14f2352cfd29..9fd2878e7b53 100644 --- a/stable/kube-state-metrics/templates/deployment.yaml +++ b/stable/kube-state-metrics/templates/deployment.yaml @@ -31,6 +31,9 @@ spec: containers: - name: {{ .Chart.Name }} args: +{{ if .Values.collectors.configmaps }} + - --collectors=configmaps +{{ end }} {{ if .Values.collectors.cronjobs }} - --collectors=cronjobs {{ end }} @@ -76,6 +79,9 @@ spec: {{ if .Values.collectors.resourcequotas }} - --collectors=resourcequotas {{ end }} +{{ if .Values.collectors.secrets }} + - --collectors=secrets +{{ end }} {{ if .Values.collectors.services }} - --collectors=services {{ end }} diff --git a/stable/kube-state-metrics/values.yaml b/stable/kube-state-metrics/values.yaml index bdc64fb6ea15..626b17d9e259 100644 --- a/stable/kube-state-metrics/values.yaml +++ b/stable/kube-state-metrics/values.yaml @@ -38,6 +38,7 @@ podAnnotations: {} # Available collectors for kube-state-metrics. By default all available # collectors are enabled. collectors: + configmaps: true cronjobs: true daemonsets: true deployments: true @@ -53,6 +54,7 @@ collectors: replicasets: true replicationcontrollers: true resourcequotas: true + secrets: true services: true statefulsets: true