From f56a6420849657b652d127d8e1484114d6d03b64 Mon Sep 17 00:00:00 2001 From: Jose Armesto Date: Tue, 30 May 2017 21:15:07 +0200 Subject: [PATCH 001/111] Added kube-state-metrics (#662) * Added kube-state-metrics * Updated kube-state-metrics version to v0.4.1 * Using different versioning * Moved to stable. Added NOTES.txt. * Fixed readme * Truncating fullname to 63 chars * Adding standard labels * Only add prometheus annotation if value is present * Fixed PR comments * Delete reference to service.name --- charts/kube-state-metrics/.helmignore | 21 +++++++++++++++ charts/kube-state-metrics/Chart.yaml | 14 ++++++++++ charts/kube-state-metrics/README.md | 21 +++++++++++++++ charts/kube-state-metrics/templates/NOTES.txt | 9 +++++++ .../kube-state-metrics/templates/_helpers.tpl | 15 +++++++++++ .../templates/deployment.yaml | 26 +++++++++++++++++++ .../kube-state-metrics/templates/service.yaml | 22 ++++++++++++++++ charts/kube-state-metrics/values.yaml | 8 ++++++ 8 files changed, 136 insertions(+) create mode 100644 charts/kube-state-metrics/.helmignore create mode 100644 charts/kube-state-metrics/Chart.yaml create mode 100644 charts/kube-state-metrics/README.md create mode 100644 charts/kube-state-metrics/templates/NOTES.txt create mode 100644 charts/kube-state-metrics/templates/_helpers.tpl create mode 100644 charts/kube-state-metrics/templates/deployment.yaml create mode 100644 charts/kube-state-metrics/templates/service.yaml create mode 100644 charts/kube-state-metrics/values.yaml diff --git a/charts/kube-state-metrics/.helmignore b/charts/kube-state-metrics/.helmignore new file mode 100644 index 000000000000..f0c131944441 --- /dev/null +++ b/charts/kube-state-metrics/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml new file mode 100644 index 000000000000..8215d7a68a77 --- /dev/null +++ b/charts/kube-state-metrics/Chart.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +name: kube-state-metrics +description: Install kube-state-metrics to generate and expose cluster-level metrics +keywords: +- metric +- monitoring +- prometheus +version: 0.1.0 +home: https://github.com/kubernetes/kube-state-metrics/ +sources: +- https://github.com/kubernetes/kube-state-metrics/ +maintainers: +- name: Jose Armesto + email: jose@armesto.net diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md new file mode 100644 index 000000000000..bd96a5122c5e --- /dev/null +++ b/charts/kube-state-metrics/README.md @@ -0,0 +1,21 @@ +# kube-state-metrics Helm Chart + +* Installs the [kube-state-metrics agent](https://github.com/kubernetes/kube-state-metrics). + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```bash +$ helm install stable/kube-state-metrics +``` + +## Configuration + +| Parameter | Description | Default | +|--------------------|-------------------------------------|----------------------------------------------| +| `image.repository` | The image repository to pull from | gcr.io/google_containers/kube-state-metrics | +| `image.tag` | The image tag to pull from | v0.4.1 | +| `image.pullPolicy` | Image pull policy | IfNotPresent | +| `service.port` | The port of the container | 8080 | +| `prometheusScrape` | Whether or not enable prom scrape | True | diff --git a/charts/kube-state-metrics/templates/NOTES.txt b/charts/kube-state-metrics/templates/NOTES.txt new file mode 100644 index 000000000000..89e3f80d3c12 --- /dev/null +++ b/charts/kube-state-metrics/templates/NOTES.txt @@ -0,0 +1,9 @@ +kube-state-metrics is a simple service that listens to the Kubernetes API server and generates metrics about the state of the objects. +The exposed metrics can be found here: https://github.com/kubernetes/kube-state-metrics/#node-metrics. + +The metrics are exported on the HTTP endpoint /metrics on the listening port. +In your case, {{ template "fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}/metrics + +They are served either as plaintext or protobuf depending on the Accept header. +They are designed to be consumed either by Prometheus itself or by a scraper that is compatible with scraping a Prometheus client endpoint. + diff --git a/charts/kube-state-metrics/templates/_helpers.tpl b/charts/kube-state-metrics/templates/_helpers.tpl new file mode 100644 index 000000000000..015baf59872c --- /dev/null +++ b/charts/kube-state-metrics/templates/_helpers.tpl @@ -0,0 +1,15 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{define "name"}}{{default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}{{end}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this +(by the DNS naming spec). +*/}} +{{define "fullname"}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{end}} diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml new file mode 100644 index 000000000000..915be1abeda8 --- /dev/null +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -0,0 +1,26 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ template "fullname" . }} + labels: + app: {{ template "name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + replicas: 1 + template: + metadata: + labels: + app: {{ template "name" . }} + version: "{{ .Values.image.tag }}" + release: "{{ .Release.Name }}" + spec: + containers: + - name: {{ .Chart.Name }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + ports: + - containerPort: 8080 + resources: +{{ toYaml .Values.resources | indent 12 }} diff --git a/charts/kube-state-metrics/templates/service.yaml b/charts/kube-state-metrics/templates/service.yaml new file mode 100644 index 000000000000..b141f0e97ccf --- /dev/null +++ b/charts/kube-state-metrics/templates/service.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "fullname" . }} + labels: + app: {{ template "name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + {{- if .Values.prometheusScrape }} + annotations: + prometheus.io/scrape: '{{ .Values.prometheusScrape }}' + {{- end }} +spec: + ports: + - name: "http" + protocol: TCP + port: {{ .Values.service.port }} + targetPort: 8080 + selector: + app: {{ template "name" . }} + release: {{ .Release.Name }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml new file mode 100644 index 000000000000..0379f4fb053f --- /dev/null +++ b/charts/kube-state-metrics/values.yaml @@ -0,0 +1,8 @@ +# Default values for kube-state-metrics. +prometheusScrape: true +image: + repository: gcr.io/google_containers/kube-state-metrics + tag: v0.4.1 + pullPolicy: IfNotPresent +service: + port: 8080 From ec2d2a2a225af3f3a9224b0dc2746fba9fc304c0 Mon Sep 17 00:00:00 2001 From: zoues Date: Thu, 10 Aug 2017 23:58:10 +0800 Subject: [PATCH 002/111] Upgrade kube-state-metrics version (#1700) * upgrade kube-state-metrics version * Bump chart version --- charts/kube-state-metrics/Chart.yaml | 3 ++- charts/kube-state-metrics/values.yaml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 8215d7a68a77..474a4a65f6e1 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,8 @@ keywords: - metric - monitoring - prometheus -version: 0.1.0 +version: 0.2.0 +appVersion: 1.0.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 0379f4fb053f..6554cccdba1b 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -2,7 +2,7 @@ prometheusScrape: true image: repository: gcr.io/google_containers/kube-state-metrics - tag: v0.4.1 + tag: v1.0.0 pullPolicy: IfNotPresent service: port: 8080 From 6a432fb5d4ae08cd9c6d8456dade30c011c7e494 Mon Sep 17 00:00:00 2001 From: Eben Freeman Date: Thu, 10 Aug 2017 20:24:24 -0700 Subject: [PATCH 003/111] [stable/kube-state-metrics] Update documented image version (#1710) [stable/kube-state-metrics] Update documented image version --- charts/kube-state-metrics/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index bd96a5122c5e..5344bcfc9bbf 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -15,7 +15,7 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |--------------------|-------------------------------------|----------------------------------------------| | `image.repository` | The image repository to pull from | gcr.io/google_containers/kube-state-metrics | -| `image.tag` | The image tag to pull from | v0.4.1 | +| `image.tag` | The image tag to pull from | v1.0.0 | | `image.pullPolicy` | Image pull policy | IfNotPresent | | `service.port` | The port of the container | 8080 | | `prometheusScrape` | Whether or not enable prom scrape | True | From feb667dd67bb84d46b01c53f4b3fcbc8072af6a1 Mon Sep 17 00:00:00 2001 From: zoues Date: Sat, 2 Sep 2017 08:04:45 +0800 Subject: [PATCH 004/111] kube-state-metrics image has been updated (#1877) * kube-state-metrics image has been updated * Bump chart version --- charts/kube-state-metrics/Chart.yaml | 4 ++-- charts/kube-state-metrics/values.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 474a4a65f6e1..f0d97829a361 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,8 +5,8 @@ keywords: - metric - monitoring - prometheus -version: 0.2.0 -appVersion: 1.0.0 +version: 0.2.1 +appVersion: 1.0.1 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 6554cccdba1b..33f27378f967 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -2,7 +2,7 @@ prometheusScrape: true image: repository: gcr.io/google_containers/kube-state-metrics - tag: v1.0.0 + tag: v1.0.1 pullPolicy: IfNotPresent service: port: 8080 From b87f8e6d1e1b8606f05687c33e72386fef80ed65 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Sat, 2 Sep 2017 12:15:48 +1200 Subject: [PATCH 005/111] name kubeStateMetrics port as 'metrics' (#1885) * name kubeStateMetrics port as 'metrics' * Bump chart version --- charts/kube-state-metrics/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index f0d97829a361..bd9fd3a5ac16 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.2.1 +version: 0.2.2 appVersion: 1.0.1 home: https://github.com/kubernetes/kube-state-metrics/ sources: From 44f9921d3ec7afa549b4ec7b266c0ab1133713db Mon Sep 17 00:00:00 2001 From: Kazuki Suda Date: Tue, 5 Sep 2017 00:30:03 +0900 Subject: [PATCH 006/111] [stable/kube-state-metrics] Add RBAC support (#1870) * [stable/kube-state-metrics] Add RBAC support This commit adds RBAC support for stable/kube-state-metrics. RBAC comes from https://github.com/kubernetes/kube-state-metrics/tree/v1.0.1/kubernetes. * Bump chart version --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 16 ++++---- .../templates/clusterrole.yaml | 37 +++++++++++++++++++ .../templates/clusterrolebinding.yaml | 19 ++++++++++ .../templates/deployment.yaml | 1 + .../templates/serviceaccount.yaml | 11 ++++++ charts/kube-state-metrics/values.yaml | 5 +++ 7 files changed, 83 insertions(+), 8 deletions(-) create mode 100644 charts/kube-state-metrics/templates/clusterrole.yaml create mode 100644 charts/kube-state-metrics/templates/clusterrolebinding.yaml create mode 100644 charts/kube-state-metrics/templates/serviceaccount.yaml diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index bd9fd3a5ac16..910f1fa16053 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.2.2 +version: 0.2.3 appVersion: 1.0.1 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 5344bcfc9bbf..e67beb888885 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -12,10 +12,12 @@ $ helm install stable/kube-state-metrics ## Configuration -| Parameter | Description | Default | -|--------------------|-------------------------------------|----------------------------------------------| -| `image.repository` | The image repository to pull from | gcr.io/google_containers/kube-state-metrics | -| `image.tag` | The image tag to pull from | v1.0.0 | -| `image.pullPolicy` | Image pull policy | IfNotPresent | -| `service.port` | The port of the container | 8080 | -| `prometheusScrape` | Whether or not enable prom scrape | True | +| Parameter | Description | Default | +|---------------------------|---------------------------------------------------------|---------------------------------------------| +| `image.repository` | The image repository to pull from | gcr.io/google_containers/kube-state-metrics | +| `image.tag` | The image tag to pull from | v1.0.1 | +| `image.pullPolicy` | Image pull policy | IfNotPresent | +| `service.port` | The port of the container | 8080 | +| `prometheusScrape` | Whether or not enable prom scrape | True | +| `rbac.create` | If true, create & use RBAC resources | False | +| `rbac.serviceAccountName` | ServiceAccount to be used (ignored if rbac.create=true) | default | diff --git a/charts/kube-state-metrics/templates/clusterrole.yaml b/charts/kube-state-metrics/templates/clusterrole.yaml new file mode 100644 index 000000000000..7c23e3292ad7 --- /dev/null +++ b/charts/kube-state-metrics/templates/clusterrole.yaml @@ -0,0 +1,37 @@ +{{- if .Values.rbac.create -}} +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRole +metadata: + labels: + app: {{ template "name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "fullname" . }} +rules: +- apiGroups: [""] + resources: + - nodes + - pods + - services + - resourcequotas + - replicationcontrollers + - limitranges + - persistentvolumeclaims + verbs: ["list", "watch"] +- apiGroups: ["extensions"] + resources: + - daemonsets + - deployments + - replicasets + verbs: ["list", "watch"] +- apiGroups: ["apps"] + resources: + - statefulsets + verbs: ["list", "watch"] +- apiGroups: ["batch"] + resources: + - cronjobs + - jobs + verbs: ["list", "watch"] +{{- end -}} diff --git a/charts/kube-state-metrics/templates/clusterrolebinding.yaml b/charts/kube-state-metrics/templates/clusterrolebinding.yaml new file mode 100644 index 000000000000..5a48ca212f18 --- /dev/null +++ b/charts/kube-state-metrics/templates/clusterrolebinding.yaml @@ -0,0 +1,19 @@ +{{- if .Values.rbac.create -}} +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRoleBinding +metadata: + labels: + app: {{ template "name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "fullname" . }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ template "fullname" . }} +subjects: + - kind: ServiceAccount + name: {{ template "fullname" . }} + namespace: {{ .Release.Namespace }} +{{- end -}} diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 915be1abeda8..028b53142a02 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -16,6 +16,7 @@ spec: version: "{{ .Values.image.tag }}" release: "{{ .Release.Name }}" spec: + serviceAccountName: {{ if .Values.rbac.create }}{{ template "fullname" . }}{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }} containers: - name: {{ .Chart.Name }} imagePullPolicy: {{ .Values.image.pullPolicy }} diff --git a/charts/kube-state-metrics/templates/serviceaccount.yaml b/charts/kube-state-metrics/templates/serviceaccount.yaml new file mode 100644 index 000000000000..8967eb1a75d8 --- /dev/null +++ b/charts/kube-state-metrics/templates/serviceaccount.yaml @@ -0,0 +1,11 @@ +{{- if .Values.rbac.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + app: {{ template "name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "fullname" . }} +{{- end -}} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 33f27378f967..a6ccf103aead 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -6,3 +6,8 @@ image: pullPolicy: IfNotPresent service: port: 8080 +rbac: + # If true, create & use RBAC resources + create: false + # Ignored if rbac.create is true + serviceAccountName: default From e45cec7b9e226def6a106d453d221f094094f900 Mon Sep 17 00:00:00 2001 From: Chris Knowles Date: Tue, 5 Sep 2017 00:39:24 +0800 Subject: [PATCH 007/111] [stable/kube-state-metrics] Enable chart upgrades (#1865) * Enable chart upgrades Fixed https://github.com/kubernetes/charts/issues/1726 * Bump chart version --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/deployment.yaml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 910f1fa16053..85a687e3dc24 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.2.3 +version: 0.2.4 appVersion: 1.0.1 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 028b53142a02..7365bce5b47c 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -13,7 +13,6 @@ spec: metadata: labels: app: {{ template "name" . }} - version: "{{ .Values.image.tag }}" release: "{{ .Release.Name }}" spec: serviceAccountName: {{ if .Values.rbac.create }}{{ template "fullname" . }}{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }} From 25cf83bb4a35dbc873cc1e1b21b2af0b98681e9e Mon Sep 17 00:00:00 2001 From: Kevin Schumacher Date: Tue, 19 Sep 2017 06:00:07 -0400 Subject: [PATCH 008/111] [stable/kube-state-metrics] #1785 namespace defined templates with chart name (#2133) --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/NOTES.txt | 2 +- charts/kube-state-metrics/templates/_helpers.tpl | 6 ++++-- charts/kube-state-metrics/templates/clusterrole.yaml | 4 ++-- .../kube-state-metrics/templates/clusterrolebinding.yaml | 8 ++++---- charts/kube-state-metrics/templates/deployment.yaml | 8 ++++---- charts/kube-state-metrics/templates/service.yaml | 6 +++--- charts/kube-state-metrics/templates/serviceaccount.yaml | 4 ++-- 8 files changed, 21 insertions(+), 19 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 85a687e3dc24..c51200d0fff5 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.2.4 +version: 0.3.0 appVersion: 1.0.1 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/NOTES.txt b/charts/kube-state-metrics/templates/NOTES.txt index 89e3f80d3c12..18a838405016 100644 --- a/charts/kube-state-metrics/templates/NOTES.txt +++ b/charts/kube-state-metrics/templates/NOTES.txt @@ -2,7 +2,7 @@ kube-state-metrics is a simple service that listens to the Kubernetes API server The exposed metrics can be found here: https://github.com/kubernetes/kube-state-metrics/#node-metrics. The metrics are exported on the HTTP endpoint /metrics on the listening port. -In your case, {{ template "fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}/metrics +In your case, {{ template "kube-state-metrics.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}/metrics They are served either as plaintext or protobuf depending on the Accept header. They are designed to be consumed either by Prometheus itself or by a scraper that is compatible with scraping a Prometheus client endpoint. diff --git a/charts/kube-state-metrics/templates/_helpers.tpl b/charts/kube-state-metrics/templates/_helpers.tpl index 015baf59872c..2e47c589f9f3 100644 --- a/charts/kube-state-metrics/templates/_helpers.tpl +++ b/charts/kube-state-metrics/templates/_helpers.tpl @@ -2,14 +2,16 @@ {{/* Expand the name of the chart. */}} -{{define "name"}}{{default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}{{end}} +{{- define "kube-state-metrics.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} {{/* Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} -{{define "fullname"}} +{{define "kube-state-metrics.fullname"}} {{- $name := default .Chart.Name .Values.nameOverride -}} {{printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{end}} diff --git a/charts/kube-state-metrics/templates/clusterrole.yaml b/charts/kube-state-metrics/templates/clusterrole.yaml index 7c23e3292ad7..25d4c12992b0 100644 --- a/charts/kube-state-metrics/templates/clusterrole.yaml +++ b/charts/kube-state-metrics/templates/clusterrole.yaml @@ -3,11 +3,11 @@ apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRole metadata: labels: - app: {{ template "name" . }} + app: {{ template "kube-state-metrics.name" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version }} heritage: {{ .Release.Service }} release: {{ .Release.Name }} - name: {{ template "fullname" . }} + name: {{ template "kube-state-metrics.fullname" . }} rules: - apiGroups: [""] resources: diff --git a/charts/kube-state-metrics/templates/clusterrolebinding.yaml b/charts/kube-state-metrics/templates/clusterrolebinding.yaml index 5a48ca212f18..a8fdebdef079 100644 --- a/charts/kube-state-metrics/templates/clusterrolebinding.yaml +++ b/charts/kube-state-metrics/templates/clusterrolebinding.yaml @@ -3,17 +3,17 @@ apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: labels: - app: {{ template "name" . }} + app: {{ template "kube-state-metrics.name" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version }} heritage: {{ .Release.Service }} release: {{ .Release.Name }} - name: {{ template "fullname" . }} + name: {{ template "kube-state-metrics.fullname" . }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: {{ template "fullname" . }} + name: {{ template "kube-state-metrics.fullname" . }} subjects: - kind: ServiceAccount - name: {{ template "fullname" . }} + name: {{ template "kube-state-metrics.fullname" . }} namespace: {{ .Release.Namespace }} {{- end -}} diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 7365bce5b47c..ad1c091ea462 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -1,9 +1,9 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: {{ template "fullname" . }} + name: {{ template "kube-state-metrics.fullname" . }} labels: - app: {{ template "name" . }} + app: {{ template "kube-state-metrics.name" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" @@ -12,10 +12,10 @@ spec: template: metadata: labels: - app: {{ template "name" . }} + app: {{ template "kube-state-metrics.name" . }} release: "{{ .Release.Name }}" spec: - serviceAccountName: {{ if .Values.rbac.create }}{{ template "fullname" . }}{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }} + serviceAccountName: {{ if .Values.rbac.create }}{{ template "kube-state-metrics.fullname" . }}{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }} containers: - name: {{ .Chart.Name }} imagePullPolicy: {{ .Values.image.pullPolicy }} diff --git a/charts/kube-state-metrics/templates/service.yaml b/charts/kube-state-metrics/templates/service.yaml index b141f0e97ccf..a591279eeada 100644 --- a/charts/kube-state-metrics/templates/service.yaml +++ b/charts/kube-state-metrics/templates/service.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: Service metadata: - name: {{ template "fullname" . }} + name: {{ template "kube-state-metrics.fullname" . }} labels: - app: {{ template "name" . }} + app: {{ template "kube-state-metrics.name" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" @@ -18,5 +18,5 @@ spec: port: {{ .Values.service.port }} targetPort: 8080 selector: - app: {{ template "name" . }} + app: {{ template "kube-state-metrics.name" . }} release: {{ .Release.Name }} diff --git a/charts/kube-state-metrics/templates/serviceaccount.yaml b/charts/kube-state-metrics/templates/serviceaccount.yaml index 8967eb1a75d8..f1e125971e8b 100644 --- a/charts/kube-state-metrics/templates/serviceaccount.yaml +++ b/charts/kube-state-metrics/templates/serviceaccount.yaml @@ -3,9 +3,9 @@ apiVersion: v1 kind: ServiceAccount metadata: labels: - app: {{ template "name" . }} + app: {{ template "kube-state-metrics.name" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version }} heritage: {{ .Release.Service }} release: {{ .Release.Name }} - name: {{ template "fullname" . }} + name: {{ template "kube-state-metrics.fullname" . }} {{- end -}} From 2e3dc2e47bcf2075dabb3ded92d8906b7d2f8ee5 Mon Sep 17 00:00:00 2001 From: Sumit Vij Date: Sat, 14 Oct 2017 10:51:12 -0700 Subject: [PATCH 009/111] [stable/kube-state-metrics] Add service type (#2002) * [stable/kube-state-metrics] Add service type * Incorporate code review feedback * Fix the ordering of type, nodePort and loadBalancerIP --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/service.yaml | 7 +++++++ charts/kube-state-metrics/values.yaml | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index c51200d0fff5..064aee65f6dd 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.3.0 +version: 0.3.1 appVersion: 1.0.1 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/service.yaml b/charts/kube-state-metrics/templates/service.yaml index a591279eeada..b6daacdf4629 100644 --- a/charts/kube-state-metrics/templates/service.yaml +++ b/charts/kube-state-metrics/templates/service.yaml @@ -12,11 +12,18 @@ metadata: prometheus.io/scrape: '{{ .Values.prometheusScrape }}' {{- end }} spec: + type: "{{ .Values.service.type }}" ports: - name: "http" protocol: TCP port: {{ .Values.service.port }} + {{- if .Values.service.nodePort }} + nodePort: {{ .Values.service.nodePort }} + {{- end }} targetPort: 8080 +{{- if .Values.service.loadBalancerIP }} + loadBalancerIP: "{{ .Values.service.loadBalancerIP }}" +{{- end }} selector: app: {{ template "kube-state-metrics.name" . }} release: {{ .Release.Name }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index a6ccf103aead..cb89236d003a 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -6,6 +6,10 @@ image: pullPolicy: IfNotPresent service: port: 8080 + # Default to clusterIP for backward compatibility + type: ClusterIP + nodePort: 0 + loadBalancerIP: "" rbac: # If true, create & use RBAC resources create: false From 1f4017f7d2c60edd7c2a15864093aaf08840a21b Mon Sep 17 00:00:00 2001 From: Frederic Branczyk Date: Fri, 17 Nov 2017 09:52:33 +0100 Subject: [PATCH 010/111] [stable/kube-state-metrics] allow configuring collectors (#2124) kube-state-metrics has a collector for each kind of Kubernetes resource it collects metrics from. Each of those collectors directly influences the RBAC requirements for the Pods. Additionally due to the nature of how kube-state-metrics is versioned and released it is not easy to determine which collectors are using "alpha" APIs, which are not necessarily enabled in a cluster, but kube-state-metrics by default has all collectors enabled. --- charts/kube-state-metrics/README.md | 32 +++++--- charts/kube-state-metrics/templates/NOTES.txt | 3 +- .../templates/clusterrole.yaml | 73 ++++++++++++++++--- .../templates/clusterrolebinding.yaml | 6 +- .../templates/deployment.yaml | 40 ++++++++++ charts/kube-state-metrics/values.yaml | 17 +++++ 6 files changed, 148 insertions(+), 23 deletions(-) diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index e67beb888885..f2c3a6cb154e 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -12,12 +12,26 @@ $ helm install stable/kube-state-metrics ## Configuration -| Parameter | Description | Default | -|---------------------------|---------------------------------------------------------|---------------------------------------------| -| `image.repository` | The image repository to pull from | gcr.io/google_containers/kube-state-metrics | -| `image.tag` | The image tag to pull from | v1.0.1 | -| `image.pullPolicy` | Image pull policy | IfNotPresent | -| `service.port` | The port of the container | 8080 | -| `prometheusScrape` | Whether or not enable prom scrape | True | -| `rbac.create` | If true, create & use RBAC resources | False | -| `rbac.serviceAccountName` | ServiceAccount to be used (ignored if rbac.create=true) | default | +| Parameter | Description | Default | +|-------------------------------------|---------------------------------------------------------|---------------------------------------------| +| `image.repository` | The image repository to pull from | gcr.io/google_containers/kube-state-metrics | +| `image.tag` | The image tag to pull from | v1.0.1 | +| `image.pullPolicy` | Image pull policy | IfNotPresent | +| `service.port` | The port of the container | 8080 | +| `prometheusScrape` | Whether or not enable prom scrape | True | +| `rbac.create` | If true, create & use RBAC resources | False | +| `rbac.serviceAccountName` | ServiceAccount to be used (ignored if rbac.create=true) | default | +| `resources` | kube-state-metrics resource requests and limits | {} | +| `collectors.daemonsets` | Enable the daemonsets collector. | true | +| `collectors.deployments` | Enable the deployments collector. | true | +| `collectors.limitranges` | Enable the limitranges collector. | true | +| `collectors.nodes` | Enable the nodes collector. | true | +| `collectors.pods` | Enable the pods collector. | true | +| `collectors.replicasets` | Enable the replicasets collector. | true | +| `collectors.replicationcontrollers` | Enable the replicationcontrollers collector. | true | +| `collectors.resourcequotas` | Enable the resourcequotas collector. | true | +| `collectors.services` | Enable the services collector. | true | +| `collectors.jobs` | Enable the jobs collector. | true | +| `collectors.cronjobs` | Enable the cronjobs collector. | true | +| `collectors.statefulsets` | Enable the statefulsets collector. | true | +| `collectors.persistentvolumeclaims` | Enable the persistentvolumeclaims collector. | true | diff --git a/charts/kube-state-metrics/templates/NOTES.txt b/charts/kube-state-metrics/templates/NOTES.txt index 18a838405016..8e8d9fe7e443 100644 --- a/charts/kube-state-metrics/templates/NOTES.txt +++ b/charts/kube-state-metrics/templates/NOTES.txt @@ -1,5 +1,6 @@ kube-state-metrics is a simple service that listens to the Kubernetes API server and generates metrics about the state of the objects. -The exposed metrics can be found here: https://github.com/kubernetes/kube-state-metrics/#node-metrics. +The exposed metrics can be found here: +https://github.com/kubernetes/kube-state-metrics/tree/master/Documentation#documentation. The metrics are exported on the HTTP endpoint /metrics on the listening port. In your case, {{ template "kube-state-metrics.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}/metrics diff --git a/charts/kube-state-metrics/templates/clusterrole.yaml b/charts/kube-state-metrics/templates/clusterrole.yaml index 25d4c12992b0..e752045addf3 100644 --- a/charts/kube-state-metrics/templates/clusterrole.yaml +++ b/charts/kube-state-metrics/templates/clusterrole.yaml @@ -9,29 +9,82 @@ metadata: release: {{ .Release.Name }} name: {{ template "kube-state-metrics.fullname" . }} rules: +{{ if .Values.collectors.daemonsets }} +- apiGroups: ["extensions"] + resources: + - daemonsets + verbs: ["list", "watch"] +{{ end -}} +{{ if .Values.collectors.deployments }} +- apiGroups: ["extensions"] + resources: + - deployments + verbs: ["list", "watch"] +{{ end -}} +{{ if .Values.collectors.limitranges }} +- apiGroups: [""] + resources: + - limitranges + verbs: ["list", "watch"] +{{ end -}} +{{ if .Values.collectors.nodes }} - apiGroups: [""] resources: - nodes + verbs: ["list", "watch"] +{{ end -}} +{{ if .Values.collectors.pods }} +- apiGroups: [""] + resources: - pods - - services - - resourcequotas - - replicationcontrollers - - limitranges - - persistentvolumeclaims verbs: ["list", "watch"] +{{ end -}} +{{ if .Values.collectors.replicasets }} - apiGroups: ["extensions"] resources: - - daemonsets - - deployments - replicasets verbs: ["list", "watch"] -- apiGroups: ["apps"] +{{ end -}} +{{ if .Values.collectors.replicationcontrollers }} +- apiGroups: [""] resources: - - statefulsets + - replicationcontrollers + verbs: ["list", "watch"] +{{ end -}} +{{ if .Values.collectors.resourcequotas }} +- apiGroups: [""] + resources: + - resourcequotas verbs: ["list", "watch"] +{{ end -}} +{{ if .Values.collectors.services }} +- apiGroups: [""] + resources: + - services + verbs: ["list", "watch"] +{{ end -}} +{{ if .Values.collectors.jobs }} - apiGroups: ["batch"] resources: - - cronjobs - jobs verbs: ["list", "watch"] +{{ end -}} +{{ if .Values.collectors.cronjobs }} +- apiGroups: ["batch"] + resources: + - cronjobs + verbs: ["list", "watch"] +{{ end -}} +{{ if .Values.collectors.statefulsets }} +- apiGroups: ["apps"] + resources: + - statefulsets + verbs: ["list", "watch"] +{{ end -}} +{{ if .Values.collectors.persistentvolumeclaims }} +- apiGroups: [""] + resources: + - persistentvolumeclaims + verbs: ["list", "watch"] +{{ end }} {{- end -}} diff --git a/charts/kube-state-metrics/templates/clusterrolebinding.yaml b/charts/kube-state-metrics/templates/clusterrolebinding.yaml index a8fdebdef079..e57b051f1f18 100644 --- a/charts/kube-state-metrics/templates/clusterrolebinding.yaml +++ b/charts/kube-state-metrics/templates/clusterrolebinding.yaml @@ -13,7 +13,7 @@ roleRef: kind: ClusterRole name: {{ template "kube-state-metrics.fullname" . }} subjects: - - kind: ServiceAccount - name: {{ template "kube-state-metrics.fullname" . }} - namespace: {{ .Release.Namespace }} +- kind: ServiceAccount + name: {{ template "kube-state-metrics.fullname" . }} + namespace: {{ .Release.Namespace }} {{- end -}} diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index ad1c091ea462..f390f46e7346 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -18,6 +18,46 @@ spec: serviceAccountName: {{ if .Values.rbac.create }}{{ template "kube-state-metrics.fullname" . }}{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }} containers: - name: {{ .Chart.Name }} + args: +{{ if .Values.collectors.daemonsets }} + - --collectors=daemonsets +{{ end }} +{{ if .Values.collectors.deployments }} + - --collectors=deployments +{{ end }} +{{ if .Values.collectors.limitranges }} + - --collectors=limitranges +{{ end }} +{{ if .Values.collectors.nodes }} + - --collectors=nodes +{{ end }} +{{ if .Values.collectors.pods }} + - --collectors=pods +{{ end }} +{{ if .Values.collectors.replicasets }} + - --collectors=replicasets +{{ end }} +{{ if .Values.collectors.replicationcontrollers }} + - --collectors=replicationcontrollers +{{ end }} +{{ if .Values.collectors.resourcequotas }} + - --collectors=resourcequotas +{{ end }} +{{ if .Values.collectors.services }} + - --collectors=services +{{ end }} +{{ if .Values.collectors.jobs }} + - --collectors=jobs +{{ end }} +{{ if .Values.collectors.cronjobs }} + - --collectors=cronjobs +{{ end }} +{{ if .Values.collectors.statefulsets }} + - --collectors=statefulsets +{{ end }} +{{ if .Values.collectors.persistentvolumeclaims }} + - --collectors=persistentvolumeclaims +{{ end }} imagePullPolicy: {{ .Values.image.pullPolicy }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" ports: diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index cb89236d003a..e4211eaaba06 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -15,3 +15,20 @@ rbac: create: false # Ignored if rbac.create is true serviceAccountName: default + +# Available collectors for kube-state-metrics. By default all available +# collectors are enabled. +collectors: + daemonsets: true + deployments: true + limitranges: true + nodes: true + pods: true + replicasets: true + replicationcontrollers: true + resourcequotas: true + services: true + jobs: true + cronjobs: true + statefulsets: true + persistentvolumeclaims: true From 9d0aacfc6fb3d00518821ed9cf4a96c5836108c5 Mon Sep 17 00:00:00 2001 From: Khris Richardson Date: Sat, 25 Nov 2017 07:01:50 -0800 Subject: [PATCH 011/111] [stable/kube-state-metrics] add readiness probe (#2718) --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/deployment.yaml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 064aee65f6dd..113189623325 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.3.1 +version: 0.3.2 appVersion: 1.0.1 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index f390f46e7346..e7a09d006658 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -62,5 +62,11 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" ports: - containerPort: 8080 + readinessProbe: + httpGet: + path: /healthz + port: 8080 + initialDelaySeconds: 5 + timeoutSeconds: 5 resources: {{ toYaml .Values.resources | indent 12 }} From 4cbdb4ca1a8f93fb0a9e0e14f1d5d83e62aa7137 Mon Sep 17 00:00:00 2001 From: Matt Farina Date: Tue, 5 Dec 2017 14:52:08 -0600 Subject: [PATCH 012/111] [stable/kube-state-metrics] Update to v1.1.0 (#2822) --- charts/kube-state-metrics/Chart.yaml | 4 ++-- charts/kube-state-metrics/values.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 113189623325..934ac408e4a0 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,8 +5,8 @@ keywords: - metric - monitoring - prometheus -version: 0.3.2 -appVersion: 1.0.1 +version: 0.4.0 +appVersion: 1.1.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index e4211eaaba06..5ce04254cfb5 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -2,7 +2,7 @@ prometheusScrape: true image: repository: gcr.io/google_containers/kube-state-metrics - tag: v1.0.1 + tag: v1.1.0 pullPolicy: IfNotPresent service: port: 8080 From f2e457497233dd1ca428f1b02f015a0e48b11fab Mon Sep 17 00:00:00 2001 From: Terje Sannum Date: Thu, 7 Dec 2017 21:57:31 +0100 Subject: [PATCH 013/111] [stable/kube-state-metrics] Add support for pod annotations (#2849) --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 1 + charts/kube-state-metrics/templates/deployment.yaml | 4 ++++ charts/kube-state-metrics/values.yaml | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 934ac408e4a0..6827b0ae6b23 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.4.0 +version: 0.5.0 appVersion: 1.1.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index f2c3a6cb154e..06d95eb87c51 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -21,6 +21,7 @@ $ helm install stable/kube-state-metrics | `prometheusScrape` | Whether or not enable prom scrape | True | | `rbac.create` | If true, create & use RBAC resources | False | | `rbac.serviceAccountName` | ServiceAccount to be used (ignored if rbac.create=true) | default | +| `podAnnotations` | Annotations to be added to the pod | {} | | `resources` | kube-state-metrics resource requests and limits | {} | | `collectors.daemonsets` | Enable the daemonsets collector. | true | | `collectors.deployments` | Enable the deployments collector. | true | diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index e7a09d006658..5146c4355cca 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -14,6 +14,10 @@ spec: labels: app: {{ template "kube-state-metrics.name" . }} release: "{{ .Release.Name }}" +{{- if .Values.podAnnotations }} + annotations: +{{ toYaml .Values.podAnnotations | indent 8 }} +{{- end }} spec: serviceAccountName: {{ if .Values.rbac.create }}{{ template "kube-state-metrics.fullname" . }}{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }} containers: diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 5ce04254cfb5..980b0da3c400 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -16,6 +16,9 @@ rbac: # Ignored if rbac.create is true serviceAccountName: default +# Annotations to be added to the pod +podAnnotations: {} + # Available collectors for kube-state-metrics. By default all available # collectors are enabled. collectors: From 783f69e7895d1ad73cd1dc54bd226808e47e1288 Mon Sep 17 00:00:00 2001 From: Matt Farina Date: Thu, 28 Dec 2017 05:30:35 -0500 Subject: [PATCH 014/111] [stable/kube-state-metrics] Convert registry to k8s.gcr.io (#3163) * Convert registry to k8s.gcr.io * fix hardcoded version in readme --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 4 ++-- charts/kube-state-metrics/values.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 6827b0ae6b23..97269f24bdeb 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.5.0 +version: 0.5.1 appVersion: 1.1.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 06d95eb87c51..bb4547a9e31f 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -14,8 +14,8 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |-------------------------------------|---------------------------------------------------------|---------------------------------------------| -| `image.repository` | The image repository to pull from | gcr.io/google_containers/kube-state-metrics | -| `image.tag` | The image tag to pull from | v1.0.1 | +| `image.repository` | The image repository to pull from | k8s.gcr.io/kube-state-metrics | +| `image.tag` | The image tag to pull from | | | `image.pullPolicy` | Image pull policy | IfNotPresent | | `service.port` | The port of the container | 8080 | | `prometheusScrape` | Whether or not enable prom scrape | True | diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 980b0da3c400..e07ad32f7002 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -1,7 +1,7 @@ # Default values for kube-state-metrics. prometheusScrape: true image: - repository: gcr.io/google_containers/kube-state-metrics + repository: k8s.gcr.io/kube-state-metrics tag: v1.1.0 pullPolicy: IfNotPresent service: From 4805df9e3f9cdb2a7f4c03f75b260d8056644111 Mon Sep 17 00:00:00 2001 From: Christopher Randles Date: Sat, 13 Jan 2018 10:33:20 -0500 Subject: [PATCH 015/111] [stable/kube-state-metrics] allow for nodeSelector to be configured (#3231) * [stable/kube-state-metrics] allow for nodeSelector to be configured * increment version --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 1 + charts/kube-state-metrics/templates/deployment.yaml | 5 +++++ charts/kube-state-metrics/values.yaml | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 97269f24bdeb..ab0f850fd244 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.5.1 +version: 0.5.2 appVersion: 1.1.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index bb4547a9e31f..4f4de401ca14 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -21,6 +21,7 @@ $ helm install stable/kube-state-metrics | `prometheusScrape` | Whether or not enable prom scrape | True | | `rbac.create` | If true, create & use RBAC resources | False | | `rbac.serviceAccountName` | ServiceAccount to be used (ignored if rbac.create=true) | default | +| `nodeSelector` | Node labels for pod assignment | {} | | `podAnnotations` | Annotations to be added to the pod | {} | | `resources` | kube-state-metrics resource requests and limits | {} | | `collectors.daemonsets` | Enable the daemonsets collector. | true | diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 5146c4355cca..7a48497eb628 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -74,3 +74,8 @@ spec: timeoutSeconds: 5 resources: {{ toYaml .Values.resources | indent 12 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} + {{- end }} + diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index e07ad32f7002..47626491c729 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -16,6 +16,10 @@ rbac: # Ignored if rbac.create is true serviceAccountName: default +## Node labels for pod assignment +## Ref: https://kubernetes.io/docs/user-guide/node-selection/ +nodeSelector: {} + # Annotations to be added to the pod podAnnotations: {} From 9c1d12639584020c4cc30cebfa6b05a0aa1c74c5 Mon Sep 17 00:00:00 2001 From: Christopher Randles Date: Fri, 9 Feb 2018 16:59:52 -0500 Subject: [PATCH 016/111] [stable/kube-state-metrics] allow for namespace flag to be configured (#3595) * [stable/kube-state-metrics] allow for namespace flag to be configured * add newline to file --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/deployment.yaml | 3 +++ charts/kube-state-metrics/values.yaml | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index ab0f850fd244..564486177065 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.5.2 +version: 0.5.3 appVersion: 1.1.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 7a48497eb628..ebf1d92c7163 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -62,6 +62,9 @@ spec: {{ if .Values.collectors.persistentvolumeclaims }} - --collectors=persistentvolumeclaims {{ end }} +{{ if .Values.namespace }} + - --namespace={{ .Values.namespace }} +{{ end }} imagePullPolicy: {{ .Values.image.pullPolicy }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" ports: diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 47626491c729..45b96f6e8f1d 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -39,3 +39,6 @@ collectors: cronjobs: true statefulsets: true persistentvolumeclaims: true + +# Namespace to be enabled for collecting resources. By default all namespaces are collected. +# namespace: "" From 9710b77180768f9411330b3017def10dacf2ac15 Mon Sep 17 00:00:00 2001 From: Peter Rifel Date: Fri, 23 Mar 2018 08:57:02 -0700 Subject: [PATCH 017/111] Upgrade kube-state-metrics to 1.2.0, add new collectors (#4146) --- charts/kube-state-metrics/Chart.yaml | 4 +- charts/kube-state-metrics/README.md | 54 ++++++++++--------- .../templates/deployment.yaml | 34 ++++++++---- charts/kube-state-metrics/values.yaml | 12 +++-- 4 files changed, 62 insertions(+), 42 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 564486177065..4bfbd06781f9 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,8 +5,8 @@ keywords: - metric - monitoring - prometheus -version: 0.5.3 -appVersion: 1.1.0 +version: 0.6.0 +appVersion: 1.2.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 4f4de401ca14..22028981ad0c 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -12,28 +12,32 @@ $ helm install stable/kube-state-metrics ## Configuration -| Parameter | Description | Default | -|-------------------------------------|---------------------------------------------------------|---------------------------------------------| -| `image.repository` | The image repository to pull from | k8s.gcr.io/kube-state-metrics | -| `image.tag` | The image tag to pull from | | -| `image.pullPolicy` | Image pull policy | IfNotPresent | -| `service.port` | The port of the container | 8080 | -| `prometheusScrape` | Whether or not enable prom scrape | True | -| `rbac.create` | If true, create & use RBAC resources | False | -| `rbac.serviceAccountName` | ServiceAccount to be used (ignored if rbac.create=true) | default | -| `nodeSelector` | Node labels for pod assignment | {} | -| `podAnnotations` | Annotations to be added to the pod | {} | -| `resources` | kube-state-metrics resource requests and limits | {} | -| `collectors.daemonsets` | Enable the daemonsets collector. | true | -| `collectors.deployments` | Enable the deployments collector. | true | -| `collectors.limitranges` | Enable the limitranges collector. | true | -| `collectors.nodes` | Enable the nodes collector. | true | -| `collectors.pods` | Enable the pods collector. | true | -| `collectors.replicasets` | Enable the replicasets collector. | true | -| `collectors.replicationcontrollers` | Enable the replicationcontrollers collector. | true | -| `collectors.resourcequotas` | Enable the resourcequotas collector. | true | -| `collectors.services` | Enable the services collector. | true | -| `collectors.jobs` | Enable the jobs collector. | true | -| `collectors.cronjobs` | Enable the cronjobs collector. | true | -| `collectors.statefulsets` | Enable the statefulsets collector. | true | -| `collectors.persistentvolumeclaims` | Enable the persistentvolumeclaims collector. | true | +| Parameter | Description | Default | +|---------------------------------------|---------------------------------------------------------|---------------------------------------------| +| `image.repository` | The image repository to pull from | k8s.gcr.io/kube-state-metrics | +| `image.tag` | The image tag to pull from | | +| `image.pullPolicy` | Image pull policy | IfNotPresent | +| `service.port` | The port of the container | 8080 | +| `prometheusScrape` | Whether or not enable prom scrape | True | +| `rbac.create` | If true, create & use RBAC resources | False | +| `rbac.serviceAccountName` | ServiceAccount to be used (ignored if rbac.create=true) | default | +| `nodeSelector` | Node labels for pod assignment | {} | +| `podAnnotations` | Annotations to be added to the pod | {} | +| `resources` | kube-state-metrics resource requests and limits | {} | +| `collectors.cronjobs` | Enable the cronjobs collector. | true | +| `collectors.daemonsets` | Enable the daemonsets collector. | true | +| `collectors.deployments` | Enable the deployments collector. | true | +| `collectors.endpoints` | Enable the endpoints collector. | true | +| `collectors.horizontalpodautoscalers` | Enable the horizontalpodautoscalers collector. | true | +| `collectors.jobs` | Enable the jobs collector. | true | +| `collectors.limitranges` | Enable the limitranges collector. | true | +| `collectors.namespaces` | Enable the namespaces collector. | true | +| `collectors.nodes` | Enable the nodes collector. | true | +| `collectors.persistentvolumeclaims` | Enable the persistentvolumeclaims collector. | true | +| `collectors.persistentvolumes` | Enable the persistentvolumes collector. | true | +| `collectors.pods` | Enable the pods collector. | true | +| `collectors.replicasets` | Enable the replicasets collector. | true | +| `collectors.replicationcontrollers` | Enable the replicationcontrollers collector. | true | +| `collectors.resourcequotas` | Enable the resourcequotas collector. | true | +| `collectors.services` | Enable the services collector. | true | +| `collectors.statefulsets` | Enable the statefulsets collector. | true | diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index ebf1d92c7163..2ac67a196bc8 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -23,18 +23,39 @@ spec: containers: - name: {{ .Chart.Name }} args: -{{ if .Values.collectors.daemonsets }} +{{ if .Values.collectors.cronjobs }} + - --collectors=cronjobs +{{ end }} +{{ if .Values.collectors.daemonsets }} - --collectors=daemonsets {{ end }} -{{ if .Values.collectors.deployments }} +{{ if .Values.collectors.deployments }} - --collectors=deployments {{ end }} +{{ if .Values.collectors.endpoints }} + - --collectors=endpoints +{{ end }} +{{ if .Values.collectors.horizontalpodautoscalers }} + - --collectors=horizontalpodautoscalers +{{ end }} +{{ if .Values.collectors.jobs }} + - --collectors=jobs +{{ end }} {{ if .Values.collectors.limitranges }} - --collectors=limitranges {{ end }} +{{ if .Values.collectors.namespaces }} + - --collectors=namespaces +{{ end }} {{ if .Values.collectors.nodes }} - --collectors=nodes {{ end }} +{{ if .Values.collectors.persistentvolumeclaims }} + - --collectors=persistentvolumeclaims +{{ end }} +{{ if .Values.collectors.persistentvolumes }} + - --collectors=persistentvolumes +{{ end }} {{ if .Values.collectors.pods }} - --collectors=pods {{ end }} @@ -50,18 +71,9 @@ spec: {{ if .Values.collectors.services }} - --collectors=services {{ end }} -{{ if .Values.collectors.jobs }} - - --collectors=jobs -{{ end }} -{{ if .Values.collectors.cronjobs }} - - --collectors=cronjobs -{{ end }} {{ if .Values.collectors.statefulsets }} - --collectors=statefulsets {{ end }} -{{ if .Values.collectors.persistentvolumeclaims }} - - --collectors=persistentvolumeclaims -{{ end }} {{ if .Values.namespace }} - --namespace={{ .Values.namespace }} {{ end }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 45b96f6e8f1d..eea7a4ad678f 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -2,7 +2,7 @@ prometheusScrape: true image: repository: k8s.gcr.io/kube-state-metrics - tag: v1.1.0 + tag: v1.2.0 pullPolicy: IfNotPresent service: port: 8080 @@ -26,19 +26,23 @@ podAnnotations: {} # Available collectors for kube-state-metrics. By default all available # collectors are enabled. collectors: + cronjobs: true daemonsets: true deployments: true + endpoints: true + horizontalpodautoscalers: true + jobs: true limitranges: true + namespaces: true nodes: true + persistentvolumeclaims: true + persistentvolumes: true pods: true replicasets: true replicationcontrollers: true resourcequotas: true services: true - jobs: true - cronjobs: true statefulsets: true - persistentvolumeclaims: true # Namespace to be enabled for collecting resources. By default all namespaces are collected. # namespace: "" From 26925db791e76b3f3db9f66846a39b5c90d3c2b8 Mon Sep 17 00:00:00 2001 From: Christopher Randles Date: Tue, 27 Mar 2018 16:56:04 -0400 Subject: [PATCH 018/111] [stable/kube-state-metrics]: support toleration configuration (#4412) --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 3 ++- charts/kube-state-metrics/templates/deployment.yaml | 8 ++++++-- charts/kube-state-metrics/values.yaml | 4 ++++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 4bfbd06781f9..ccf85a77bad3 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.6.0 +version: 0.7.0 appVersion: 1.2.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 22028981ad0c..6078643af100 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -15,13 +15,14 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |---------------------------------------|---------------------------------------------------------|---------------------------------------------| | `image.repository` | The image repository to pull from | k8s.gcr.io/kube-state-metrics | -| `image.tag` | The image tag to pull from | | +| `image.tag` | The image tag to pull from | `` | | `image.pullPolicy` | Image pull policy | IfNotPresent | | `service.port` | The port of the container | 8080 | | `prometheusScrape` | Whether or not enable prom scrape | True | | `rbac.create` | If true, create & use RBAC resources | False | | `rbac.serviceAccountName` | ServiceAccount to be used (ignored if rbac.create=true) | default | | `nodeSelector` | Node labels for pod assignment | {} | +| `tolerations` | Tolerations for pod assignment | [] | | `podAnnotations` | Annotations to be added to the pod | {} | | `resources` | kube-state-metrics resource requests and limits | {} | | `collectors.cronjobs` | Enable the cronjobs collector. | true | diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 2ac67a196bc8..5859c995e092 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -89,8 +89,12 @@ spec: timeoutSeconds: 5 resources: {{ toYaml .Values.resources | indent 12 }} - {{- if .Values.nodeSelector }} +{{- if .Values.nodeSelector }} nodeSelector: {{ toYaml .Values.nodeSelector | indent 8 }} - {{- end }} +{{- end }} +{{- if .Values.tolerations }} + tolerations: +{{ toYaml .Values.tolerations | indent 8 }} +{{- end }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index eea7a4ad678f..09fc263c7a81 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -20,6 +20,10 @@ rbac: ## Ref: https://kubernetes.io/docs/user-guide/node-selection/ nodeSelector: {} +## Tolerations for pod assignment +## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +tolerations: [] + # Annotations to be added to the pod podAnnotations: {} From d33d59913937b3af08db6dc568dce303210319ca Mon Sep 17 00:00:00 2001 From: Peter Rifel Date: Thu, 29 Mar 2018 13:24:04 -0700 Subject: [PATCH 019/111] [stable/kube-state-metrics] Update ClusterRole to match new collectors (#4467) --- charts/kube-state-metrics/Chart.yaml | 2 +- .../templates/clusterrole.yaml | 60 +++++++++++++------ 2 files changed, 43 insertions(+), 19 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index ccf85a77bad3..4b6d7e625696 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.7.0 +version: 0.7.1 appVersion: 1.2.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/clusterrole.yaml b/charts/kube-state-metrics/templates/clusterrole.yaml index e752045addf3..b12e8712ccab 100644 --- a/charts/kube-state-metrics/templates/clusterrole.yaml +++ b/charts/kube-state-metrics/templates/clusterrole.yaml @@ -9,6 +9,12 @@ metadata: release: {{ .Release.Name }} name: {{ template "kube-state-metrics.fullname" . }} rules: +{{ if .Values.collectors.cronjobs }} +- apiGroups: ["batch"] + resources: + - cronjobs + verbs: ["list", "watch"] +{{ end -}} {{ if .Values.collectors.daemonsets }} - apiGroups: ["extensions"] resources: @@ -21,18 +27,54 @@ rules: - deployments verbs: ["list", "watch"] {{ end -}} +{{ if .Values.collectors.endpoints }} +- apiGroups: [""] + resources: + - endpoints + verbs: ["list", "watch"] +{{ end -}} +{{ if .Values.collectors.horizontalpodautoscalers }} +- apiGroups: ["autoscaling"] + resources: + - horizontalpodautoscalers + verbs: ["list", "watch"] +{{ end -}} +{{ if .Values.collectors.jobs }} +- apiGroups: ["batch"] + resources: + - jobs + verbs: ["list", "watch"] +{{ end -}} {{ if .Values.collectors.limitranges }} - apiGroups: [""] resources: - limitranges verbs: ["list", "watch"] {{ end -}} +{{ if .Values.collectors.namespaces }} +- apiGroups: [""] + resources: + - namespaces + verbs: ["list", "watch"] +{{ end -}} {{ if .Values.collectors.nodes }} - apiGroups: [""] resources: - nodes verbs: ["list", "watch"] {{ end -}} +{{ if .Values.collectors.persistentvolumeclaims }} +- apiGroups: [""] + resources: + - persistentvolumeclaims + verbs: ["list", "watch"] +{{ end }} +{{ if .Values.collectors.persistentvolumes }} +- apiGroups: [""] + resources: + - persistentvolumes + verbs: ["list", "watch"] +{{ end }} {{ if .Values.collectors.pods }} - apiGroups: [""] resources: @@ -63,28 +105,10 @@ rules: - services verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.jobs }} -- apiGroups: ["batch"] - resources: - - jobs - verbs: ["list", "watch"] -{{ end -}} -{{ if .Values.collectors.cronjobs }} -- apiGroups: ["batch"] - resources: - - cronjobs - verbs: ["list", "watch"] -{{ end -}} {{ if .Values.collectors.statefulsets }} - apiGroups: ["apps"] resources: - statefulsets verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.persistentvolumeclaims }} -- apiGroups: [""] - resources: - - persistentvolumeclaims - verbs: ["list", "watch"] -{{ end }} {{- end -}} From 882740f85f75f46c7923ae4d724e7916d0ff6f05 Mon Sep 17 00:00:00 2001 From: Greg Taylor Date: Sun, 17 Jun 2018 09:16:30 -0700 Subject: [PATCH 020/111] kube-state-metrics: Update tag to 1.3.1 (#5973) * kube-state-metrics: Update tag to 1.3.1 * kube-state-metrics: Fix invalid Chart.yaml authors Had the author's full name rather than GitHub name. This broke the CI checks. --- charts/kube-state-metrics/Chart.yaml | 6 +++--- charts/kube-state-metrics/values.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 4b6d7e625696..14a0ee36d1c3 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,11 +5,11 @@ keywords: - metric - monitoring - prometheus -version: 0.7.1 -appVersion: 1.2.0 +version: 0.7.2 +appVersion: 1.3.1 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ maintainers: -- name: Jose Armesto +- name: fiunchinho email: jose@armesto.net diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 09fc263c7a81..969bf94c4de4 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -2,7 +2,7 @@ prometheusScrape: true image: repository: k8s.gcr.io/kube-state-metrics - tag: v1.2.0 + tag: v1.3.1 pullPolicy: IfNotPresent service: port: 8080 From 386ee8ee16020fcc37d17315cd3ad1ba5fe7ac04 Mon Sep 17 00:00:00 2001 From: Atsushi Kawamura Date: Mon, 18 Jun 2018 05:47:29 +0900 Subject: [PATCH 021/111] modify helpers to apply popular rule to decide fullname (#6126) * modify helpers to apply popular rule to decide fullname * bump up chart version up to 0.7.2 * replace author name to github-account --- charts/kube-state-metrics/Chart.yaml | 2 +- .../kube-state-metrics/templates/_helpers.tpl | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 14a0ee36d1c3..849c65d91ea7 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.7.2 +version: 0.8.0 appVersion: 1.3.1 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/_helpers.tpl b/charts/kube-state-metrics/templates/_helpers.tpl index 2e47c589f9f3..787d0c283ba0 100644 --- a/charts/kube-state-metrics/templates/_helpers.tpl +++ b/charts/kube-state-metrics/templates/_helpers.tpl @@ -8,10 +8,18 @@ Expand the name of the chart. {{/* Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this -(by the DNS naming spec). +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. */}} -{{define "kube-state-metrics.fullname"}} +{{- define "kube-state-metrics.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} {{- $name := default .Chart.Name .Values.nameOverride -}} -{{printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{end}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} From cf8208282cffc56cfcd2de811ddfc57c435ae468 Mon Sep 17 00:00:00 2001 From: "David J. M. Karlsen" Date: Sun, 15 Jul 2018 19:25:56 +0200 Subject: [PATCH 022/111] [stable/kube-state-metrics] Use recommended repo (#6531) * Use recommended repo as defined on: https://github.com/kubernetes/kube-state-metrics#container-image * Update README.md * Update README.md --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 2 +- charts/kube-state-metrics/values.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 849c65d91ea7..aff4f6aeb33a 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.8.0 +version: 0.8.1 appVersion: 1.3.1 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 6078643af100..214211387b38 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -14,7 +14,7 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |---------------------------------------|---------------------------------------------------------|---------------------------------------------| -| `image.repository` | The image repository to pull from | k8s.gcr.io/kube-state-metrics | +| `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | | `image.tag` | The image tag to pull from | `` | | `image.pullPolicy` | Image pull policy | IfNotPresent | | `service.port` | The port of the container | 8080 | diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 969bf94c4de4..9cfc6ef4d2af 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -1,7 +1,7 @@ # Default values for kube-state-metrics. prometheusScrape: true image: - repository: k8s.gcr.io/kube-state-metrics + repository: quay.io/coreos/kube-state-metrics tag: v1.3.1 pullPolicy: IfNotPresent service: From 96b3a62762721dc21fd2647e09a39b91335eb101 Mon Sep 17 00:00:00 2001 From: Giancarlo Rubio Date: Tue, 4 Sep 2018 20:18:14 +0200 Subject: [PATCH 023/111] [kube-state-metrics] review readme (#6810) * review readme * Update Chart.yaml --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index aff4f6aeb33a..3387488bc2f9 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.8.1 +version: 0.8.2 appVersion: 1.3.1 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 214211387b38..aee4104ab35c 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -15,7 +15,7 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |---------------------------------------|---------------------------------------------------------|---------------------------------------------| | `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | -| `image.tag` | The image tag to pull from | `` | +| `image.tag` | The image tag to pull from | `v1.3.1` | | `image.pullPolicy` | Image pull policy | IfNotPresent | | `service.port` | The port of the container | 8080 | | `prometheusScrape` | Whether or not enable prom scrape | True | From 785fe9adc64d8d4f018f0ceb8e2e5819334b8ea2 Mon Sep 17 00:00:00 2001 From: "David J. M. Karlsen" Date: Tue, 4 Sep 2018 23:47:07 +0200 Subject: [PATCH 024/111] upgrade kube-state-metrics to v1.4.0 (#7515) Signed-off-by: David J. M. Karlsen --- charts/kube-state-metrics/Chart.yaml | 4 ++-- charts/kube-state-metrics/README.md | 2 +- charts/kube-state-metrics/values.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 3387488bc2f9..ddfb3613055d 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,8 +5,8 @@ keywords: - metric - monitoring - prometheus -version: 0.8.2 -appVersion: 1.3.1 +version: 0.9.0 +appVersion: 1.4.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index aee4104ab35c..bed5d1ff2808 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -15,7 +15,7 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |---------------------------------------|---------------------------------------------------------|---------------------------------------------| | `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | -| `image.tag` | The image tag to pull from | `v1.3.1` | +| `image.tag` | The image tag to pull from | `v1.4.0` | | `image.pullPolicy` | Image pull policy | IfNotPresent | | `service.port` | The port of the container | 8080 | | `prometheusScrape` | Whether or not enable prom scrape | True | diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 9cfc6ef4d2af..a9b607761781 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -2,7 +2,7 @@ prometheusScrape: true image: repository: quay.io/coreos/kube-state-metrics - tag: v1.3.1 + tag: v1.4.0 pullPolicy: IfNotPresent service: port: 8080 From 0d193f7d746169c58ba8f71b1078f811056b8945 Mon Sep 17 00:00:00 2001 From: Bort Verwilst Date: Mon, 5 Nov 2018 14:46:16 +0100 Subject: [PATCH 025/111] Add securityContext (#9001) Signed-off-by: Bart Verwilst --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 5 ++++- charts/kube-state-metrics/templates/deployment.yaml | 5 +++++ charts/kube-state-metrics/values.yaml | 5 +++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index ddfb3613055d..cf25191588c2 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.9.0 +version: 0.10.0 appVersion: 1.4.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index bed5d1ff2808..eef38bc1c318 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -21,8 +21,11 @@ $ helm install stable/kube-state-metrics | `prometheusScrape` | Whether or not enable prom scrape | True | | `rbac.create` | If true, create & use RBAC resources | False | | `rbac.serviceAccountName` | ServiceAccount to be used (ignored if rbac.create=true) | default | +| `securityContext.enabled` | Enable security context | `true` | +| `securityContext.fsGroup` | Group ID for the container | `65534` | +| `securityContext.runAsUser` | User ID for the container | `65534` | | `nodeSelector` | Node labels for pod assignment | {} | -| `tolerations` | Tolerations for pod assignment | [] | +| `tolerations` | Tolerations for pod assignment | [] | | `podAnnotations` | Annotations to be added to the pod | {} | | `resources` | kube-state-metrics resource requests and limits | {} | | `collectors.cronjobs` | Enable the cronjobs collector. | true | diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 5859c995e092..0942f7870b07 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -20,6 +20,11 @@ spec: {{- end }} spec: serviceAccountName: {{ if .Values.rbac.create }}{{ template "kube-state-metrics.fullname" . }}{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }} + {{- if .Values.securityContext.enabled }} + securityContext: + fsGroup: {{ .Values.securityContext.fsGroup }} + runAsUser: {{ .Values.securityContext.runAsUser }} + {{- end }} containers: - name: {{ .Chart.Name }} args: diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index a9b607761781..b7d830de5b64 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -16,6 +16,11 @@ rbac: # Ignored if rbac.create is true serviceAccountName: default +securityContext: + enabled: true + runAsUser: 65534 + fsGroup: 65534 + ## Node labels for pod assignment ## Ref: https://kubernetes.io/docs/user-guide/node-selection/ nodeSelector: {} From a711392a1b2c9af1150247bf6fa576c3a0f7b984 Mon Sep 17 00:00:00 2001 From: Bort Verwilst Date: Mon, 5 Nov 2018 19:34:38 +0100 Subject: [PATCH 026/111] [stable/kube-state-metrics] Enable RBAC by default (needed for securitycontexts) (#9010) * Enable RBAC by default (needed for securitycontexts) Signed-off-by: Bart Verwilst * s/True/true Signed-off-by: Bart Verwilst --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 4 ++-- charts/kube-state-metrics/values.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index cf25191588c2..97080d0d614b 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.10.0 +version: 0.11.0 appVersion: 1.4.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index eef38bc1c318..bf5028a3dfd0 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -18,8 +18,8 @@ $ helm install stable/kube-state-metrics | `image.tag` | The image tag to pull from | `v1.4.0` | | `image.pullPolicy` | Image pull policy | IfNotPresent | | `service.port` | The port of the container | 8080 | -| `prometheusScrape` | Whether or not enable prom scrape | True | -| `rbac.create` | If true, create & use RBAC resources | False | +| `prometheusScrape` | Whether or not enable prom scrape | true | +| `rbac.create` | If true, create & use RBAC resources | true | | `rbac.serviceAccountName` | ServiceAccount to be used (ignored if rbac.create=true) | default | | `securityContext.enabled` | Enable security context | `true` | | `securityContext.fsGroup` | Group ID for the container | `65534` | diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index b7d830de5b64..fbb376f7ff5a 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -12,7 +12,7 @@ service: loadBalancerIP: "" rbac: # If true, create & use RBAC resources - create: false + create: true # Ignored if rbac.create is true serviceAccountName: default From 68b569517b682ca7eb0a48958a487e4670264022 Mon Sep 17 00:00:00 2001 From: chrisob Date: Mon, 26 Nov 2018 19:17:05 +0100 Subject: [PATCH 027/111] Add priorityClassName option to values (#9478) Signed-off-by: Chris O'Brien --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 5 +++-- charts/kube-state-metrics/templates/deployment.yaml | 3 +++ charts/kube-state-metrics/values.yaml | 3 +++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 97080d0d614b..e96ca3c8c654 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.11.0 +version: 0.12.0 appVersion: 1.4.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index bf5028a3dfd0..50f070760b84 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -15,7 +15,7 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |---------------------------------------|---------------------------------------------------------|---------------------------------------------| | `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | -| `image.tag` | The image tag to pull from | `v1.4.0` | +| `image.tag` | The image tag to pull from | `v1.4.0` | | `image.pullPolicy` | Image pull policy | IfNotPresent | | `service.port` | The port of the container | 8080 | | `prometheusScrape` | Whether or not enable prom scrape | true | @@ -24,8 +24,9 @@ $ helm install stable/kube-state-metrics | `securityContext.enabled` | Enable security context | `true` | | `securityContext.fsGroup` | Group ID for the container | `65534` | | `securityContext.runAsUser` | User ID for the container | `65534` | +| `priorityClassName` | Name of Priority Class to assign pods | `nil` | | `nodeSelector` | Node labels for pod assignment | {} | -| `tolerations` | Tolerations for pod assignment | [] | +| `tolerations` | Tolerations for pod assignment | [] | | `podAnnotations` | Annotations to be added to the pod | {} | | `resources` | kube-state-metrics resource requests and limits | {} | | `collectors.cronjobs` | Enable the cronjobs collector. | true | diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 0942f7870b07..4ade3f228c47 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -25,6 +25,9 @@ spec: fsGroup: {{ .Values.securityContext.fsGroup }} runAsUser: {{ .Values.securityContext.runAsUser }} {{- end }} + {{- if .Values.priorityClassName }} + priorityClassName: {{ .Values.priorityClassName }} + {{- end }} containers: - name: {{ .Chart.Name }} args: diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index fbb376f7ff5a..bdc64fb6ea15 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -32,6 +32,9 @@ tolerations: [] # Annotations to be added to the pod podAnnotations: {} +## Assign a PriorityClassName to pods if set +# priorityClassName: "" + # Available collectors for kube-state-metrics. By default all available # collectors are enabled. collectors: From 155dee1d2812ca57bddf183cff21c19e54d4b5f9 Mon Sep 17 00:00:00 2001 From: chrisob Date: Wed, 28 Nov 2018 07:14:54 +0100 Subject: [PATCH 028/111] [stable/kube-state-metrics] Fix indentation of priorityClassName (#9553) * Fix indentation of priorityClassName Signed-off-by: Chris O'Brien * Bump chart version Signed-off-by: Chris O'Brien --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/deployment.yaml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index e96ca3c8c654..faaddbd5bd9b 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.12.0 +version: 0.12.1 appVersion: 1.4.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 4ade3f228c47..14f2352cfd29 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -25,9 +25,9 @@ spec: fsGroup: {{ .Values.securityContext.fsGroup }} runAsUser: {{ .Values.securityContext.runAsUser }} {{- end }} - {{- if .Values.priorityClassName }} - priorityClassName: {{ .Values.priorityClassName }} - {{- end }} + {{- if .Values.priorityClassName }} + priorityClassName: {{ .Values.priorityClassName }} + {{- end }} containers: - name: {{ .Chart.Name }} args: From b93fd512a27b6292bf747c96e8ac0bad31a6e91e Mon Sep 17 00:00:00 2001 From: Louise Champ Date: Tue, 15 Jan 2019 19:19:29 +0000 Subject: [PATCH 029/111] add configmap and secret collectors (#10665) Signed-off-by: Louise Champ --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 2 ++ charts/kube-state-metrics/templates/clusterrole.yaml | 12 ++++++++++++ charts/kube-state-metrics/templates/deployment.yaml | 6 ++++++ charts/kube-state-metrics/values.yaml | 2 ++ 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index faaddbd5bd9b..3b0bad43d13b 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/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/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 50f070760b84..3f4d6d044a63 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/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/charts/kube-state-metrics/templates/clusterrole.yaml b/charts/kube-state-metrics/templates/clusterrole.yaml index b12e8712ccab..756a06ad30cb 100644 --- a/charts/kube-state-metrics/templates/clusterrole.yaml +++ b/charts/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/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 14f2352cfd29..9fd2878e7b53 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/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/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index bdc64fb6ea15..626b17d9e259 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/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 From 953e455d35afd120033629bb3ffd406ab4121ffe Mon Sep 17 00:00:00 2001 From: DerekHeldtWerle Date: Tue, 15 Jan 2019 12:13:40 -0800 Subject: [PATCH 030/111] Add PodSecurityPolicy support (#10480) Signed-off-by: Derek Heldt-Werle --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 4 +- .../templates/podsecuritypolicy.yaml | 39 +++++++++++++++++++ .../templates/psp-clusterrole.yaml | 21 ++++++++++ .../templates/psp-clusterrolebinding.yaml | 23 +++++++++++ charts/kube-state-metrics/values.yaml | 16 ++++++++ 6 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 charts/kube-state-metrics/templates/podsecuritypolicy.yaml create mode 100644 charts/kube-state-metrics/templates/psp-clusterrole.yaml create mode 100644 charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 3b0bad43d13b..e64bcad98e41 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.12.2 +version: 0.13.0 appVersion: 1.4.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 3f4d6d044a63..d751dc46c1ea 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -20,11 +20,13 @@ $ helm install stable/kube-state-metrics | `service.port` | The port of the container | 8080 | | `prometheusScrape` | Whether or not enable prom scrape | true | | `rbac.create` | If true, create & use RBAC resources | true | +| `podSecurityPolicy.enabled` | If true, create & use PodSecurityPolicy resources | false | +| `podSecurityPolicy.annotations` | Specify pod annotations in the pod security policy | {} | | `rbac.serviceAccountName` | ServiceAccount to be used (ignored if rbac.create=true) | default | | `securityContext.enabled` | Enable security context | `true` | | `securityContext.fsGroup` | Group ID for the container | `65534` | | `securityContext.runAsUser` | User ID for the container | `65534` | -| `priorityClassName` | Name of Priority Class to assign pods | `nil` | +| `priorityClassName` | Name of Priority Class to assign pods | `nil` | | `nodeSelector` | Node labels for pod assignment | {} | | `tolerations` | Tolerations for pod assignment | [] | | `podAnnotations` | Annotations to be added to the pod | {} | diff --git a/charts/kube-state-metrics/templates/podsecuritypolicy.yaml b/charts/kube-state-metrics/templates/podsecuritypolicy.yaml new file mode 100644 index 000000000000..d195a5fdaf31 --- /dev/null +++ b/charts/kube-state-metrics/templates/podsecuritypolicy.yaml @@ -0,0 +1,39 @@ +{{- if .Values.podSecurityPolicy.enabled }} +apiVersion: extensions/v1beta1 +kind: PodSecurityPolicy +metadata: + name: {{ template "kube-state-metrics.fullname" . }} + labels: + app: {{ template "kube-state-metrics.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + annotations: +{{- if .Values.podSecurityPolicy.annotations }} +{{ toYaml .Values.podSecurityPolicy.annotations | indent 4 }} +{{- end }} +spec: + privileged: false + volumes: + - 'secret' + hostNetwork: false + hostIPC: false + hostPID: false + runAsUser: + rule: 'MustRunAsNonRoot' + seLinux: + rule: 'RunAsAny' + supplementalGroups: + rule: 'MustRunAs' + ranges: + # Forbid adding the root group. + - min: 1 + max: 65535 + fsGroup: + rule: 'MustRunAs' + ranges: + # Forbid adding the root group. + - min: 1 + max: 65535 + readOnlyRootFilesystem: false +{{- end }} diff --git a/charts/kube-state-metrics/templates/psp-clusterrole.yaml b/charts/kube-state-metrics/templates/psp-clusterrole.yaml new file mode 100644 index 000000000000..bdc774af7de6 --- /dev/null +++ b/charts/kube-state-metrics/templates/psp-clusterrole.yaml @@ -0,0 +1,21 @@ +{{- if and .Values.podSecurityPolicy.enabled -}} +kind: ClusterRole +{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} +apiVersion: rbac.authorization.k8s.io/v1beta1 +{{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} +apiVersion: rbac.authorization.k8s.io/v1alpha1 +{{- end }} +metadata: + labels: + app: {{ template "kube-state-metrics.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: psp-{{ template "kube-state-metrics.fullname" . }} +rules: +- apiGroups: ['extensions'] + resources: ['podsecuritypolicies'] + verbs: ['use'] + resourceNames: + - {{ template "kube-state-metrics.fullname" . }} +{{- end }} diff --git a/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml b/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml new file mode 100644 index 000000000000..611a9a246428 --- /dev/null +++ b/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml @@ -0,0 +1,23 @@ +{{- if and .Values.podSecurityPolicy.enabled -}} +{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} +apiVersion: rbac.authorization.k8s.io/v1beta1 +{{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} +apiVersion: rbac.authorization.k8s.io/v1alpha1 +{{- end }} +kind: ClusterRoleBinding +metadata: + labels: + app: {{ template "kube-state-metrics.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: psp-{{ template "kube-state-metrics.fullname" . }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: psp-{{ template "kube-state-metrics.fullname" . }} +subjects: + - kind: ServiceAccount + name: {{ template "kube-state-metrics.fullname" . }} + namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 626b17d9e259..7d6448501ca0 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -16,6 +16,22 @@ rbac: # Ignored if rbac.create is true serviceAccountName: default +## Specify if a Pod Security Policy for kube-state-metrics must be created +## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/ +## +podSecurityPolicy: + enabled: false + annotations: {} + ## Specify pod annotations + ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#apparmor + ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#seccomp + ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#sysctl + ## + # seccomp.security.alpha.kubernetes.io/allowedProfileNames: '*' + # seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default' + # apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default' + + securityContext: enabled: true runAsUser: 65534 From 94055ff5537fbe8e958ee18d7faaa85216dea153 Mon Sep 17 00:00:00 2001 From: Jesse Suen Date: Sun, 3 Feb 2019 06:57:27 -0800 Subject: [PATCH 031/111] Use rbac.authorization.k8s.io/v1 apiVersion in RBAC resources (#11094) Signed-off-by: Jesse Suen --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/psp-clusterrole.yaml | 6 +----- .../templates/psp-clusterrolebinding.yaml | 6 +----- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index e64bcad98e41..0588e2912888 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.13.0 +version: 0.13.1 appVersion: 1.4.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/psp-clusterrole.yaml b/charts/kube-state-metrics/templates/psp-clusterrole.yaml index bdc774af7de6..c43f90da2c63 100644 --- a/charts/kube-state-metrics/templates/psp-clusterrole.yaml +++ b/charts/kube-state-metrics/templates/psp-clusterrole.yaml @@ -1,10 +1,6 @@ {{- if and .Values.podSecurityPolicy.enabled -}} +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole -{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} -apiVersion: rbac.authorization.k8s.io/v1beta1 -{{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} -apiVersion: rbac.authorization.k8s.io/v1alpha1 -{{- end }} metadata: labels: app: {{ template "kube-state-metrics.name" . }} diff --git a/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml b/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml index 611a9a246428..bfca12cab4c3 100644 --- a/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml +++ b/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml @@ -1,9 +1,5 @@ {{- if and .Values.podSecurityPolicy.enabled -}} -{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} -apiVersion: rbac.authorization.k8s.io/v1beta1 -{{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} -apiVersion: rbac.authorization.k8s.io/v1alpha1 -{{- end }} +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: labels: From ad0f3ffeab9552b4dbec1e0201e889f1ac5fca3c Mon Sep 17 00:00:00 2001 From: Tariq Ibrahim Date: Wed, 13 Feb 2019 19:18:29 -0800 Subject: [PATCH 032/111] update kube-state-metrics chart to support kube-state-metrics 1.5.0 (#11316) Signed-off-by: tariqibrahim --- charts/kube-state-metrics/Chart.yaml | 4 ++-- charts/kube-state-metrics/README.md | 1 + charts/kube-state-metrics/templates/clusterrole.yaml | 10 ++++++++-- charts/kube-state-metrics/templates/deployment.yaml | 3 +++ charts/kube-state-metrics/values.yaml | 5 +++-- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 0588e2912888..2f02d4aa0a42 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,8 +5,8 @@ keywords: - metric - monitoring - prometheus -version: 0.13.1 -appVersion: 1.4.0 +version: 0.14.0 +appVersion: 1.5.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index d751dc46c1ea..826e113a5778 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -43,6 +43,7 @@ $ helm install stable/kube-state-metrics | `collectors.nodes` | Enable the nodes collector. | true | | `collectors.persistentvolumeclaims` | Enable the persistentvolumeclaims collector. | true | | `collectors.persistentvolumes` | Enable the persistentvolumes collector. | true | +| `collectors.poddisruptionbudgets` | Enable the poddisruptionbudgets collector. | true | `collectors.pods` | Enable the pods collector. | true | | `collectors.replicasets` | Enable the replicasets collector. | true | | `collectors.replicationcontrollers` | Enable the replicationcontrollers collector. | true | diff --git a/charts/kube-state-metrics/templates/clusterrole.yaml b/charts/kube-state-metrics/templates/clusterrole.yaml index 756a06ad30cb..803b73b00d59 100644 --- a/charts/kube-state-metrics/templates/clusterrole.yaml +++ b/charts/kube-state-metrics/templates/clusterrole.yaml @@ -74,13 +74,19 @@ rules: resources: - persistentvolumeclaims verbs: ["list", "watch"] -{{ end }} +{{ end -}} {{ if .Values.collectors.persistentvolumes }} - apiGroups: [""] resources: - persistentvolumes verbs: ["list", "watch"] -{{ end }} +{{ end -}} +{{ if .Values.collectors.poddisruptionbudgets }} +- apiGroups: ["policy"] + resources: + - poddisruptionbudgets + verbs: ["list", "watch"] +{{ end -}} {{ if .Values.collectors.pods }} - apiGroups: [""] resources: diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 9fd2878e7b53..e760aeb3bf81 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -67,6 +67,9 @@ spec: {{ if .Values.collectors.persistentvolumes }} - --collectors=persistentvolumes {{ end }} +{{ if .Values.collectors.poddisruptionbudgets }} + - --collectors=poddisruptionbudgets +{{ end }} {{ if .Values.collectors.pods }} - --collectors=pods {{ end }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 7d6448501ca0..48ae8ac4f438 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -1,8 +1,8 @@ # Default values for kube-state-metrics. prometheusScrape: true image: - repository: quay.io/coreos/kube-state-metrics - tag: v1.4.0 + repository: k8s.gcr.io/kube-state-metrics + tag: v1.5.0 pullPolicy: IfNotPresent service: port: 8080 @@ -66,6 +66,7 @@ collectors: nodes: true persistentvolumeclaims: true persistentvolumes: true + poddisruptionbudgets: true pods: true replicasets: true replicationcontrollers: true From c05d2861c23ff3dd8d344838a07f18a5801b103f Mon Sep 17 00:00:00 2001 From: Tariq Ibrahim Date: Fri, 15 Feb 2019 05:39:11 -0800 Subject: [PATCH 033/111] [stable/kube-state-metrics] update kube-state-metrics README.md (#11440) Signed-off-by: tariqibrahim --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 2f02d4aa0a42..4ba33e90baf6 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.14.0 +version: 0.14.1 appVersion: 1.5.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 826e113a5778..bcab1b233196 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -14,8 +14,8 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |---------------------------------------|---------------------------------------------------------|---------------------------------------------| -| `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | -| `image.tag` | The image tag to pull from | `v1.4.0` | +| `image.repository` | The image repository to pull from | k8s.gcr.io/kube-state-metrics | +| `image.tag` | The image tag to pull from | `v1.5.0` | | `image.pullPolicy` | Image pull policy | IfNotPresent | | `service.port` | The port of the container | 8080 | | `prometheusScrape` | Whether or not enable prom scrape | true | @@ -43,7 +43,7 @@ $ helm install stable/kube-state-metrics | `collectors.nodes` | Enable the nodes collector. | true | | `collectors.persistentvolumeclaims` | Enable the persistentvolumeclaims collector. | true | | `collectors.persistentvolumes` | Enable the persistentvolumes collector. | true | -| `collectors.poddisruptionbudgets` | Enable the poddisruptionbudgets collector. | true +| `collectors.poddisruptionbudgets` | Enable the poddisruptionbudgets collector. | true | | `collectors.pods` | Enable the pods collector. | true | | `collectors.replicasets` | Enable the replicasets collector. | true | | `collectors.replicationcontrollers` | Enable the replicationcontrollers collector. | true | From 567c114cf606bae1e978231a68ca5728e06afda6 Mon Sep 17 00:00:00 2001 From: Tanguy Buchier Date: Thu, 14 Mar 2019 08:36:47 +0800 Subject: [PATCH 034/111] [stable/kube-state-metrics] Add imagePullSecrets in serviceAccount (#11405) * [stable/kube-state-metrics] Add imagePullSecrets in serviceAccount Signed-off-by: Tanguy Buchier * [stable/kube-state-metrics] Add imagePullSecrets in serviceAccount Signed-off-by: Tanguy Buchier * [stable/kube-state-metrics] Add imagePullSecrets in serviceAccount Signed-off-by: Tanguy Buchier --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 4 +++- charts/kube-state-metrics/templates/_helpers.tpl | 11 +++++++++++ .../kube-state-metrics/templates/deployment.yaml | 4 +++- .../templates/serviceaccount.yaml | 4 ++++ charts/kube-state-metrics/values.yaml | 14 ++++++++++++-- 6 files changed, 34 insertions(+), 5 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 4ba33e90baf6..a90440c18b86 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.14.1 +version: 0.15.0 appVersion: 1.5.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index bcab1b233196..f418c136bda1 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -20,9 +20,11 @@ $ helm install stable/kube-state-metrics | `service.port` | The port of the container | 8080 | | `prometheusScrape` | Whether or not enable prom scrape | true | | `rbac.create` | If true, create & use RBAC resources | true | +| `serviceAccount.create` | If true, and rbac true, create & use serviceAccount | true | +| `serviceAccount.name` | If not set & create is true, use template fullname | | +| `serviceAccount.imagePullSecrets` | Specify image pull secrets field | `[]` | | `podSecurityPolicy.enabled` | If true, create & use PodSecurityPolicy resources | false | | `podSecurityPolicy.annotations` | Specify pod annotations in the pod security policy | {} | -| `rbac.serviceAccountName` | ServiceAccount to be used (ignored if rbac.create=true) | default | | `securityContext.enabled` | Enable security context | `true` | | `securityContext.fsGroup` | Group ID for the container | `65534` | | `securityContext.runAsUser` | User ID for the container | `65534` | diff --git a/charts/kube-state-metrics/templates/_helpers.tpl b/charts/kube-state-metrics/templates/_helpers.tpl index 787d0c283ba0..e59ada57caef 100644 --- a/charts/kube-state-metrics/templates/_helpers.tpl +++ b/charts/kube-state-metrics/templates/_helpers.tpl @@ -23,3 +23,14 @@ If release name contains chart name it will be used as a full name. {{- end -}} {{- end -}} {{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "kube-state-metrics.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "kube-state-metrics.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index e760aeb3bf81..56a7598ef70d 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -19,7 +19,9 @@ spec: {{ toYaml .Values.podAnnotations | indent 8 }} {{- end }} spec: - serviceAccountName: {{ if .Values.rbac.create }}{{ template "kube-state-metrics.fullname" . }}{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }} +{{ if .Values.rbac.create }} + serviceAccountName: {{ template "kube-state-metrics.serviceAccountName" . }} +{{ end }} {{- if .Values.securityContext.enabled }} securityContext: fsGroup: {{ .Values.securityContext.fsGroup }} diff --git a/charts/kube-state-metrics/templates/serviceaccount.yaml b/charts/kube-state-metrics/templates/serviceaccount.yaml index f1e125971e8b..edac3b99ff98 100644 --- a/charts/kube-state-metrics/templates/serviceaccount.yaml +++ b/charts/kube-state-metrics/templates/serviceaccount.yaml @@ -1,4 +1,5 @@ {{- if .Values.rbac.create -}} +{{- if .Values.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: @@ -8,4 +9,7 @@ metadata: heritage: {{ .Release.Service }} release: {{ .Release.Name }} name: {{ template "kube-state-metrics.fullname" . }} +imagePullSecrets: +{{ toYaml .Values.serviceAccount.imagePullSecrets | indent 2 }} +{{- end -}} {{- end -}} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 48ae8ac4f438..611b007849c9 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -4,17 +4,27 @@ image: repository: k8s.gcr.io/kube-state-metrics tag: v1.5.0 pullPolicy: IfNotPresent + service: port: 8080 # Default to clusterIP for backward compatibility type: ClusterIP nodePort: 0 loadBalancerIP: "" + rbac: # If true, create & use RBAC resources create: true - # Ignored if rbac.create is true - serviceAccountName: default + +serviceAccount: + # Specifies whether a ServiceAccount should be created, require rbac true + create: true + # The name of the ServiceAccount to use. + # If not set and create is true, a name is generated using the fullname template + name: + # Reference to one or more secrets to be used when pulling images + # ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + imagePullSecrets: [] ## Specify if a Pod Security Policy for kube-state-metrics must be created ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/ From 4feb12b1fa466269558276d58d0cff7b157716d3 Mon Sep 17 00:00:00 2001 From: tehho Date: Mon, 25 Mar 2019 18:36:17 +0100 Subject: [PATCH 035/111] Adds replicas to kube-state-metrics deployment (#12267) * Added replicas to kube-state-metrics Signed-off-by: Andreas Antonsson * Bumped chart version and added replicas to readme.md Signed of by Andreas Antonsson tehho1337@gmail.com Signed-off-by: Andreas Antonsson --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 1 + charts/kube-state-metrics/templates/deployment.yaml | 2 +- charts/kube-state-metrics/values.yaml | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index a90440c18b86..2f0f39d96b02 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.15.0 +version: 0.16.0 appVersion: 1.5.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index f418c136bda1..94ad04990f79 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -17,6 +17,7 @@ $ helm install stable/kube-state-metrics | `image.repository` | The image repository to pull from | k8s.gcr.io/kube-state-metrics | | `image.tag` | The image tag to pull from | `v1.5.0` | | `image.pullPolicy` | Image pull policy | IfNotPresent | +| `replicas` | Number of replicas | 1 | | `service.port` | The port of the container | 8080 | | `prometheusScrape` | Whether or not enable prom scrape | true | | `rbac.create` | If true, create & use RBAC resources | true | diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 56a7598ef70d..b251758f1b56 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -8,7 +8,7 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - replicas: 1 + replicas: {{ .Values.replicas }} template: metadata: labels: diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 611b007849c9..86aab9bf0a1e 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -5,6 +5,8 @@ image: tag: v1.5.0 pullPolicy: IfNotPresent +replicas: 1 + service: port: 8080 # Default to clusterIP for backward compatibility From bbe3d933f9091de5c73c931d189a6721daad1ddf Mon Sep 17 00:00:00 2001 From: Ryan Belgrave Date: Mon, 15 Apr 2019 06:48:06 -0500 Subject: [PATCH 036/111] [stable/kube-state-metrics] add optional prometheus service monitor (#12145) * [stable/kube-state-metrics] add optional prometheus service monitor Signed-off-by: Ryan Belgrave * bump chart version to 1.0.0 Signed-off-by: Ryan Belgrave --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 3 +++ .../kube-state-metrics/templates/monitor.yaml | 23 +++++++++++++++++++ charts/kube-state-metrics/values.yaml | 6 +++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 charts/kube-state-metrics/templates/monitor.yaml diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 2f0f39d96b02..32d2f07e07e3 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 0.16.0 +version: 1.0.0 appVersion: 1.5.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 94ad04990f79..266b6f02ab4c 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -54,3 +54,6 @@ $ helm install stable/kube-state-metrics | `collectors.secrets` | Enable the secrets collector. | true | | `collectors.services` | Enable the services collector. | true | | `collectors.statefulsets` | Enable the statefulsets collector. | true | +| `prometheus.monitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false` | +| `prometheus.monitor.additionalLabels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | `{}` | +| `prometheus.monitor.namespace` | namespace where servicemonitor resource should be created | `the same namespace as kube-state-metrics` | diff --git a/charts/kube-state-metrics/templates/monitor.yaml b/charts/kube-state-metrics/templates/monitor.yaml new file mode 100644 index 000000000000..2aaf35b80409 --- /dev/null +++ b/charts/kube-state-metrics/templates/monitor.yaml @@ -0,0 +1,23 @@ +{{- if .Values.prometheus.monitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "kube-state-metrics.fullname" . }} + labels: + name: {{ template "kube-state-metrics.fullname" . }} + labels: + app: {{ template "kube-state-metrics.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + {{- if .Values.prometheus.monitor.additionalLabels }} +{{ toYaml .Values.prometheus.monitor.additionalLabels | indent 4 }} + {{- end }} +spec: + selector: + matchLabels: + app: {{ template "kube-state-metrics.name" . }} + release: {{ .Release.Name }} + endpoints: + - port: http +{{- end }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 86aab9bf0a1e..bc2861935c30 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -28,6 +28,12 @@ serviceAccount: # ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ imagePullSecrets: [] +prometheus: + monitor: + enabled: false + additionalLabels: {} + namespace: "" + ## Specify if a Pod Security Policy for kube-state-metrics must be created ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/ ## From 69e5709193ca1d5352c9b7714b0ff18612a57dfc Mon Sep 17 00:00:00 2001 From: Guillermo Date: Mon, 22 Apr 2019 01:27:43 +0200 Subject: [PATCH 037/111] Fixed invalid empty annotations in kube-state-metrics chart template (#12207) Signed-off-by: Guillermo Guirao Aguilar --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/podsecuritypolicy.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 32d2f07e07e3..6f550899f829 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 1.0.0 +version: 1.0.1 appVersion: 1.5.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/podsecuritypolicy.yaml b/charts/kube-state-metrics/templates/podsecuritypolicy.yaml index d195a5fdaf31..36480d0e1bff 100644 --- a/charts/kube-state-metrics/templates/podsecuritypolicy.yaml +++ b/charts/kube-state-metrics/templates/podsecuritypolicy.yaml @@ -8,8 +8,8 @@ metadata: chart: {{ .Chart.Name }}-{{ .Chart.Version }} heritage: {{ .Release.Service }} release: {{ .Release.Name }} - annotations: {{- if .Values.podSecurityPolicy.annotations }} + annotations: {{ toYaml .Values.podSecurityPolicy.annotations | indent 4 }} {{- end }} spec: From 885534edcf9e6fd8ce69febe63d4e41a7bf9b36f Mon Sep 17 00:00:00 2001 From: hamza3202 Date: Tue, 23 Apr 2019 13:12:13 +0500 Subject: [PATCH 038/111] [stable/kube-state-metrics ] Fix option to specify service account name (#13160) * Fix configmap of keycloak Signed-off-by: kahootali * Fix option to specify service account name. Signed-off-by: Muhammad Hamza Zaib * [stable/kube-state-metrics] Update chart version to 1.0.1 Signed-off-by: Muhammad Hamza Zaib * Update _helpers.tpl to follow guidelines Signed-off-by: Muhammad Hamza Zaib * Update chart kube-state-metrics version to 1.1.0 Signed-off-by: Muhammad Hamza Zaib --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/deployment.yaml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 6f550899f829..4711dbaa4288 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 1.0.1 +version: 1.1.0 appVersion: 1.5.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index b251758f1b56..2afd8523ffc9 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -19,9 +19,7 @@ spec: {{ toYaml .Values.podAnnotations | indent 8 }} {{- end }} spec: -{{ if .Values.rbac.create }} serviceAccountName: {{ template "kube-state-metrics.serviceAccountName" . }} -{{ end }} {{- if .Values.securityContext.enabled }} securityContext: fsGroup: {{ .Values.securityContext.fsGroup }} From 41b50d613e14b374f7a005af90288075f3f2845f Mon Sep 17 00:00:00 2001 From: Nicholas Capo Date: Tue, 30 Apr 2019 14:07:21 -0500 Subject: [PATCH 039/111] [stable/kube-state-metrics]: Add support for host networking (#13414) * [stable/kube-state-metrics]: Add support for host networking Signed-off-by: Nicholas Capo * [stable/kube-state-metrics] Remove unknown filter Signed-off-by: Nicholas Capo --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 1 + charts/kube-state-metrics/templates/deployment.yaml | 2 +- charts/kube-state-metrics/values.yaml | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 4711dbaa4288..cc27d42de08d 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 1.1.0 +version: 1.2.0 appVersion: 1.5.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 266b6f02ab4c..3abd656065e4 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -19,6 +19,7 @@ $ helm install stable/kube-state-metrics | `image.pullPolicy` | Image pull policy | IfNotPresent | | `replicas` | Number of replicas | 1 | | `service.port` | The port of the container | 8080 | +| `hostNetwork` | Whether or not to use the host network | false | | `prometheusScrape` | Whether or not enable prom scrape | true | | `rbac.create` | If true, create & use RBAC resources | true | | `serviceAccount.create` | If true, and rbac true, create & use serviceAccount | true | diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 2afd8523ffc9..f2f25c1530cc 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -19,6 +19,7 @@ spec: {{ toYaml .Values.podAnnotations | indent 8 }} {{- end }} spec: + hostNetwork: {{ .Values.hostNetwork }} serviceAccountName: {{ template "kube-state-metrics.serviceAccountName" . }} {{- if .Values.securityContext.enabled }} securityContext: @@ -114,4 +115,3 @@ spec: tolerations: {{ toYaml .Values.tolerations | indent 8 }} {{- end }} - diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index bc2861935c30..bf1e0ee69a6b 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -14,6 +14,8 @@ service: nodePort: 0 loadBalancerIP: "" +hostNetwork: false + rbac: # If true, create & use RBAC resources create: true From 7e9f84e5364cd0e1d95acee929ede02f27980a9b Mon Sep 17 00:00:00 2001 From: Maxim Filatov Date: Tue, 7 May 2019 11:51:45 +0300 Subject: [PATCH 040/111] [stable/kube-state-metrics] upgrade to 1.6.0 (#13553) * [stable/kube-state-metrics] Clusterrole: Allow to list resource "daemonsets", "deployments" and "replicasets" in API group "apps" As of kube-state-metrics version 1.6 it needs to access "daemonsets", "deployments" and "replicasets" in API group "apps" as well as "extensions" Signed-off-by: Maxim Filatov * [stable/kube-state-metrics] Collectors: enable ingresses collector Signed-off-by: Maxim Filatov * [stable/kube-state-metrics] Collectors: enable certificatesigningrequests collector Signed-off-by: Maxim Filatov * [stable/kube-state-metrics] upgrade to 1.6.0 Signed-off-by: Maxim Filatov --- charts/kube-state-metrics/Chart.yaml | 4 ++-- charts/kube-state-metrics/README.md | 6 ++++-- .../templates/clusterrole.yaml | 18 +++++++++++++++--- .../templates/deployment.yaml | 6 ++++++ charts/kube-state-metrics/values.yaml | 6 ++++-- 5 files changed, 31 insertions(+), 9 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index cc27d42de08d..dbd522c3712d 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,8 +5,8 @@ keywords: - metric - monitoring - prometheus -version: 1.2.0 -appVersion: 1.5.0 +version: 1.3.0 +appVersion: 1.6.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 3abd656065e4..bcf1b4dacdc6 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -14,8 +14,8 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |---------------------------------------|---------------------------------------------------------|---------------------------------------------| -| `image.repository` | The image repository to pull from | k8s.gcr.io/kube-state-metrics | -| `image.tag` | The image tag to pull from | `v1.5.0` | +| `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | +| `image.tag` | The image tag to pull from | `v1.6.0` | | `image.pullPolicy` | Image pull policy | IfNotPresent | | `replicas` | Number of replicas | 1 | | `service.port` | The port of the container | 8080 | @@ -35,12 +35,14 @@ $ 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.certificatesigningrequests` | Enable the certificatesigningrequests collector. | true | | `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 | | `collectors.endpoints` | Enable the endpoints collector. | true | | `collectors.horizontalpodautoscalers` | Enable the horizontalpodautoscalers collector. | true | +| `collectors.ingresses` | Enable the ingresses collector. | true | | `collectors.jobs` | Enable the jobs collector. | true | | `collectors.limitranges` | Enable the limitranges collector. | true | | `collectors.namespaces` | Enable the namespaces collector. | true | diff --git a/charts/kube-state-metrics/templates/clusterrole.yaml b/charts/kube-state-metrics/templates/clusterrole.yaml index 803b73b00d59..2c59adf5f625 100644 --- a/charts/kube-state-metrics/templates/clusterrole.yaml +++ b/charts/kube-state-metrics/templates/clusterrole.yaml @@ -9,6 +9,12 @@ metadata: release: {{ .Release.Name }} name: {{ template "kube-state-metrics.fullname" . }} rules: +{{ if .Values.collectors.certificatesigningrequests }} +- apiGroups: ["certificates.k8s.io"] + resources: + - certificatesigningrequests + verbs: ["list", "watch"] +{{ end -}} {{ if .Values.collectors.configmaps }} - apiGroups: [""] resources: @@ -22,13 +28,13 @@ rules: verbs: ["list", "watch"] {{ end -}} {{ if .Values.collectors.daemonsets }} -- apiGroups: ["extensions"] +- apiGroups: ["extensions", "apps"] resources: - daemonsets verbs: ["list", "watch"] {{ end -}} {{ if .Values.collectors.deployments }} -- apiGroups: ["extensions"] +- apiGroups: ["extensions", "apps"] resources: - deployments verbs: ["list", "watch"] @@ -45,6 +51,12 @@ rules: - horizontalpodautoscalers verbs: ["list", "watch"] {{ end -}} +{{ if .Values.collectors.ingresses }} +- apiGroups: ["extensions"] + resources: + - ingresses + verbs: ["list", "watch"] +{{ end -}} {{ if .Values.collectors.jobs }} - apiGroups: ["batch"] resources: @@ -94,7 +106,7 @@ rules: verbs: ["list", "watch"] {{ end -}} {{ if .Values.collectors.replicasets }} -- apiGroups: ["extensions"] +- apiGroups: ["extensions", "apps"] resources: - replicasets verbs: ["list", "watch"] diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index f2f25c1530cc..125d4fafac29 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -32,6 +32,9 @@ spec: containers: - name: {{ .Chart.Name }} args: +{{ if .Values.collectors.certificatesigningrequests }} + - --collectors=certificatesigningrequests +{{ end }} {{ if .Values.collectors.configmaps }} - --collectors=configmaps {{ end }} @@ -50,6 +53,9 @@ spec: {{ if .Values.collectors.horizontalpodautoscalers }} - --collectors=horizontalpodautoscalers {{ end }} +{{ if .Values.collectors.ingresses }} + - --collectors=ingresses +{{ end }} {{ if .Values.collectors.jobs }} - --collectors=jobs {{ end }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index bf1e0ee69a6b..05626e8a69ca 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -1,8 +1,8 @@ # Default values for kube-state-metrics. prometheusScrape: true image: - repository: k8s.gcr.io/kube-state-metrics - tag: v1.5.0 + repository: quay.io/coreos/kube-state-metrics + tag: v1.6.0 pullPolicy: IfNotPresent replicas: 1 @@ -74,12 +74,14 @@ podAnnotations: {} # Available collectors for kube-state-metrics. By default all available # collectors are enabled. collectors: + certificatesigningrequests: true configmaps: true cronjobs: true daemonsets: true deployments: true endpoints: true horizontalpodautoscalers: true + ingresses: true jobs: true limitranges: true namespaces: true From 839cc283ea3522056698981c808ecd1a3af5bcea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Est=C3=A9vez=20Mart=C3=ADnez?= Date: Thu, 9 May 2019 22:36:48 +0200 Subject: [PATCH 041/111] [stable/kube-state-metrics] Allows deploying ServiceAccount without RBAC (#13495) Useful for imagePullSecrets Signed-off-by: Marcos Estevez --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 4 ++-- charts/kube-state-metrics/templates/serviceaccount.yaml | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index dbd522c3712d..d281f23072ef 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 1.3.0 +version: 1.4.0 appVersion: 1.6.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index bcf1b4dacdc6..e48780adc352 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -22,7 +22,7 @@ $ helm install stable/kube-state-metrics | `hostNetwork` | Whether or not to use the host network | false | | `prometheusScrape` | Whether or not enable prom scrape | true | | `rbac.create` | If true, create & use RBAC resources | true | -| `serviceAccount.create` | If true, and rbac true, create & use serviceAccount | true | +| `serviceAccount.create` | If true, create & use serviceAccount | true | | `serviceAccount.name` | If not set & create is true, use template fullname | | | `serviceAccount.imagePullSecrets` | Specify image pull secrets field | `[]` | | `podSecurityPolicy.enabled` | If true, create & use PodSecurityPolicy resources | false | @@ -32,7 +32,7 @@ $ helm install stable/kube-state-metrics | `securityContext.runAsUser` | User ID for the container | `65534` | | `priorityClassName` | Name of Priority Class to assign pods | `nil` | | `nodeSelector` | Node labels for pod assignment | {} | -| `tolerations` | Tolerations for pod assignment | [] | +| `tolerations` | Tolerations for pod assignment | [] | | `podAnnotations` | Annotations to be added to the pod | {} | | `resources` | kube-state-metrics resource requests and limits | {} | | `collectors.certificatesigningrequests` | Enable the certificatesigningrequests collector. | true | diff --git a/charts/kube-state-metrics/templates/serviceaccount.yaml b/charts/kube-state-metrics/templates/serviceaccount.yaml index edac3b99ff98..5459abb10a0e 100644 --- a/charts/kube-state-metrics/templates/serviceaccount.yaml +++ b/charts/kube-state-metrics/templates/serviceaccount.yaml @@ -1,4 +1,3 @@ -{{- if .Values.rbac.create -}} {{- if .Values.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount @@ -12,4 +11,3 @@ metadata: imagePullSecrets: {{ toYaml .Values.serviceAccount.imagePullSecrets | indent 2 }} {{- end -}} -{{- end -}} From fa4bff2884c26c49e8b1ff1bdc885735162f0b73 Mon Sep 17 00:00:00 2001 From: Lukas Grossar Date: Wed, 15 May 2019 00:48:19 +0200 Subject: [PATCH 042/111] [stable/kube-state-metrics] add pod affinity (#12819) * [stable/kube-state-metrics] fix whitespace in README.md Signed-off-by: Lukas Grossar * [stable/kube-state-metrics] add affinity configuration Extend values.yaml to allow definition of affinity for kube-state-metrics pods. fixes #12818 Signed-off-by: Lukas Grossar --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 3 ++- charts/kube-state-metrics/templates/deployment.yaml | 4 ++++ charts/kube-state-metrics/values.yaml | 4 ++++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index d281f23072ef..09e020f23378 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 1.4.0 +version: 1.5.0 appVersion: 1.6.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index e48780adc352..539ea6f5e467 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -32,7 +32,8 @@ $ helm install stable/kube-state-metrics | `securityContext.runAsUser` | User ID for the container | `65534` | | `priorityClassName` | Name of Priority Class to assign pods | `nil` | | `nodeSelector` | Node labels for pod assignment | {} | -| `tolerations` | Tolerations for pod assignment | [] | +| `affinity` | Affinity settings for pod assignment | {} | +| `tolerations` | Tolerations for pod assignment | [] | | `podAnnotations` | Annotations to be added to the pod | {} | | `resources` | kube-state-metrics resource requests and limits | {} | | `collectors.certificatesigningrequests` | Enable the certificatesigningrequests collector. | true | diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 125d4fafac29..598782b600f9 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -113,6 +113,10 @@ spec: timeoutSeconds: 5 resources: {{ toYaml .Values.resources | indent 12 }} +{{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 8 }} +{{- end }} {{- if .Values.nodeSelector }} nodeSelector: {{ toYaml .Values.nodeSelector | indent 8 }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 05626e8a69ca..396866539267 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -61,6 +61,10 @@ securityContext: ## Ref: https://kubernetes.io/docs/user-guide/node-selection/ nodeSelector: {} +## Affinity settings for pod assignment +## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ +affinity: {} + ## Tolerations for pod assignment ## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ tolerations: [] From b004021961c3bb776655fb334e19687c80a82c59 Mon Sep 17 00:00:00 2001 From: Tariq Ibrahim Date: Wed, 15 May 2019 12:38:24 -0700 Subject: [PATCH 043/111] [stable/kube-state-metrics]: Use the recommended apiGroup versions in kube-state-metrics (#13844) Signed-off-by: Tariq Ibrahim rebase and resolve merge conflicts --- charts/kube-state-metrics/Chart.yaml | 4 +++- charts/kube-state-metrics/OWNERS | 6 ++++++ charts/kube-state-metrics/templates/deployment.yaml | 5 ++++- charts/kube-state-metrics/templates/podsecuritypolicy.yaml | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 charts/kube-state-metrics/OWNERS diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 09e020f23378..af8ca4ae464d 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 1.5.0 +version: 1.6.0 appVersion: 1.6.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: @@ -13,3 +13,5 @@ sources: maintainers: - name: fiunchinho email: jose@armesto.net +- name: tariq1890 + email: tariq.ibrahim@mulesoft.com diff --git a/charts/kube-state-metrics/OWNERS b/charts/kube-state-metrics/OWNERS new file mode 100644 index 000000000000..2a78bcc6c316 --- /dev/null +++ b/charts/kube-state-metrics/OWNERS @@ -0,0 +1,6 @@ +approvers: +- fiunchinho +- tariq1890 +reviewers: +- fiunchinho +- tariq1890 diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 598782b600f9..62f0b73059a4 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "kube-state-metrics.fullname" . }} @@ -8,6 +8,9 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: + selector: + matchLabels: + app: {{ template "kube-state-metrics.name" . }} replicas: {{ .Values.replicas }} template: metadata: diff --git a/charts/kube-state-metrics/templates/podsecuritypolicy.yaml b/charts/kube-state-metrics/templates/podsecuritypolicy.yaml index 36480d0e1bff..b44ca36f6f15 100644 --- a/charts/kube-state-metrics/templates/podsecuritypolicy.yaml +++ b/charts/kube-state-metrics/templates/podsecuritypolicy.yaml @@ -1,5 +1,5 @@ {{- if .Values.podSecurityPolicy.enabled }} -apiVersion: extensions/v1beta1 +apiVersion: policy/v1beta1 kind: PodSecurityPolicy metadata: name: {{ template "kube-state-metrics.fullname" . }} From 9b1b558445c4b68ce9e81cb0d857bbfb8c84155b Mon Sep 17 00:00:00 2001 From: Florian Rusch Date: Wed, 15 May 2019 23:13:19 +0200 Subject: [PATCH 044/111] [stable/kube-state-metrics]: Fix link to metric docu (#13647) Signed-off-by: Florian Rusch [stable/kube-state-metrics] Bump Chart version Co-Authored-By: Tariq Ibrahim Bump Version Signed-off-by: Florian Rusch --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/NOTES.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index af8ca4ae464d..db93278da344 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 1.6.0 +version: 1.6.1 appVersion: 1.6.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/NOTES.txt b/charts/kube-state-metrics/templates/NOTES.txt index 8e8d9fe7e443..d804011e7933 100644 --- a/charts/kube-state-metrics/templates/NOTES.txt +++ b/charts/kube-state-metrics/templates/NOTES.txt @@ -1,6 +1,6 @@ kube-state-metrics is a simple service that listens to the Kubernetes API server and generates metrics about the state of the objects. The exposed metrics can be found here: -https://github.com/kubernetes/kube-state-metrics/tree/master/Documentation#documentation. +https://github.com/kubernetes/kube-state-metrics/blob/master/docs/README.md#exposed-metrics The metrics are exported on the HTTP endpoint /metrics on the listening port. In your case, {{ template "kube-state-metrics.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}/metrics From f8cf27cca46311f4f2d915ff1c36170a3d950d3f Mon Sep 17 00:00:00 2001 From: Victor Login Date: Wed, 22 May 2019 11:02:11 +0300 Subject: [PATCH 045/111] [stable/kube-state-metrics] Solve #13961 (#13995) Signed-off-by: Login Victor --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 98 ++++++++++++++-------------- 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index db93278da344..711ca0fec615 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 1.6.1 +version: 1.6.2 appVersion: 1.6.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 539ea6f5e467..6816ef4a70cc 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -12,52 +12,52 @@ $ helm install stable/kube-state-metrics ## Configuration -| Parameter | Description | Default | -|---------------------------------------|---------------------------------------------------------|---------------------------------------------| -| `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | -| `image.tag` | The image tag to pull from | `v1.6.0` | -| `image.pullPolicy` | Image pull policy | IfNotPresent | -| `replicas` | Number of replicas | 1 | -| `service.port` | The port of the container | 8080 | -| `hostNetwork` | Whether or not to use the host network | false | -| `prometheusScrape` | Whether or not enable prom scrape | true | -| `rbac.create` | If true, create & use RBAC resources | true | -| `serviceAccount.create` | If true, create & use serviceAccount | true | -| `serviceAccount.name` | If not set & create is true, use template fullname | | -| `serviceAccount.imagePullSecrets` | Specify image pull secrets field | `[]` | -| `podSecurityPolicy.enabled` | If true, create & use PodSecurityPolicy resources | false | -| `podSecurityPolicy.annotations` | Specify pod annotations in the pod security policy | {} | -| `securityContext.enabled` | Enable security context | `true` | -| `securityContext.fsGroup` | Group ID for the container | `65534` | -| `securityContext.runAsUser` | User ID for the container | `65534` | -| `priorityClassName` | Name of Priority Class to assign pods | `nil` | -| `nodeSelector` | Node labels for pod assignment | {} | -| `affinity` | Affinity settings for pod assignment | {} | -| `tolerations` | Tolerations for pod assignment | [] | -| `podAnnotations` | Annotations to be added to the pod | {} | -| `resources` | kube-state-metrics resource requests and limits | {} | -| `collectors.certificatesigningrequests` | Enable the certificatesigningrequests collector. | true | -| `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 | -| `collectors.endpoints` | Enable the endpoints collector. | true | -| `collectors.horizontalpodautoscalers` | Enable the horizontalpodautoscalers collector. | true | -| `collectors.ingresses` | Enable the ingresses collector. | true | -| `collectors.jobs` | Enable the jobs collector. | true | -| `collectors.limitranges` | Enable the limitranges collector. | true | -| `collectors.namespaces` | Enable the namespaces collector. | true | -| `collectors.nodes` | Enable the nodes collector. | true | -| `collectors.persistentvolumeclaims` | Enable the persistentvolumeclaims collector. | true | -| `collectors.persistentvolumes` | Enable the persistentvolumes collector. | true | -| `collectors.poddisruptionbudgets` | Enable the poddisruptionbudgets collector. | true | -| `collectors.pods` | Enable the pods collector. | true | -| `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 | -| `prometheus.monitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false` | -| `prometheus.monitor.additionalLabels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | `{}` | -| `prometheus.monitor.namespace` | namespace where servicemonitor resource should be created | `the same namespace as kube-state-metrics` | +| Parameter | Description | Default | +|:----------------------------------------|:--------------------------------------------------------------------------------------|:-------------------------------------------| +| `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | +| `image.tag` | The image tag to pull from | `v1.6.0` | +| `image.pullPolicy` | Image pull policy | IfNotPresent | +| `replicas` | Number of replicas | 1 | +| `service.port` | The port of the container | 8080 | +| `hostNetwork` | Whether or not to use the host network | false | +| `prometheusScrape` | Whether or not enable prom scrape | true | +| `rbac.create` | If true, create & use RBAC resources | true | +| `serviceAccount.create` | If true, create & use serviceAccount | true | +| `serviceAccount.name` | If not set & create is true, use template fullname | | +| `serviceAccount.imagePullSecrets` | Specify image pull secrets field | `[]` | +| `podSecurityPolicy.enabled` | If true, create & use PodSecurityPolicy resources | false | +| `podSecurityPolicy.annotations` | Specify pod annotations in the pod security policy | {} | +| `securityContext.enabled` | Enable security context | `true` | +| `securityContext.fsGroup` | Group ID for the container | `65534` | +| `securityContext.runAsUser` | User ID for the container | `65534` | +| `priorityClassName` | Name of Priority Class to assign pods | `nil` | +| `nodeSelector` | Node labels for pod assignment | {} | +| `affinity` | Affinity settings for pod assignment | {} | +| `tolerations` | Tolerations for pod assignment | [] | +| `podAnnotations` | Annotations to be added to the pod | {} | +| `resources` | kube-state-metrics resource requests and limits | {} | +| `collectors.certificatesigningrequests` | Enable the certificatesigningrequests collector. | true | +| `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 | +| `collectors.endpoints` | Enable the endpoints collector. | true | +| `collectors.horizontalpodautoscalers` | Enable the horizontalpodautoscalers collector. | true | +| `collectors.ingresses` | Enable the ingresses collector. | true | +| `collectors.jobs` | Enable the jobs collector. | true | +| `collectors.limitranges` | Enable the limitranges collector. | true | +| `collectors.namespaces` | Enable the namespaces collector. | true | +| `collectors.nodes` | Enable the nodes collector. | true | +| `collectors.persistentvolumeclaims` | Enable the persistentvolumeclaims collector. | true | +| `collectors.persistentvolumes` | Enable the persistentvolumes collector. | true | +| `collectors.poddisruptionbudgets` | Enable the poddisruptionbudgets collector. | true | +| `collectors.pods` | Enable the pods collector. | true | +| `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 | +| `prometheus.monitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false` | +| `prometheus.monitor.additionalLabels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | `{}` | +| `prometheus.monitor.namespace` | Namespace where servicemonitor resource should be created | `the same namespace as kube-state-metrics` | From a7e9443f11ac6a283e85db784b0b0580a76ff180 Mon Sep 17 00:00:00 2001 From: Ryan Belgrave Date: Fri, 24 May 2019 13:11:32 -0500 Subject: [PATCH 046/111] [stable/kube-state-metrics] fix service monitor label nesting (#14128) Signed-off-by: Ryan Belgrave --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/monitor.yaml | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 711ca0fec615..79e8c315f0e1 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,7 @@ keywords: - metric - monitoring - prometheus -version: 1.6.2 +version: 1.6.3 appVersion: 1.6.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/monitor.yaml b/charts/kube-state-metrics/templates/monitor.yaml index 2aaf35b80409..af151f10249a 100644 --- a/charts/kube-state-metrics/templates/monitor.yaml +++ b/charts/kube-state-metrics/templates/monitor.yaml @@ -4,15 +4,13 @@ kind: ServiceMonitor metadata: name: {{ template "kube-state-metrics.fullname" . }} labels: - name: {{ template "kube-state-metrics.fullname" . }} - labels: - app: {{ template "kube-state-metrics.name" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" - {{- if .Values.prometheus.monitor.additionalLabels }} + app: {{ template "kube-state-metrics.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + {{- if .Values.prometheus.monitor.additionalLabels }} {{ toYaml .Values.prometheus.monitor.additionalLabels | indent 4 }} - {{- end }} + {{- end }} spec: selector: matchLabels: From 8797b50d59a428432ec80af2bfa97d81526f35a8 Mon Sep 17 00:00:00 2001 From: Oussema CHERNI Date: Wed, 5 Jun 2019 19:31:56 +0200 Subject: [PATCH 047/111] Add Kubernetes to keywords list (#14523) Signed-off-by: Oussema CHERNI --- charts/kube-state-metrics/Chart.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 79e8c315f0e1..3a878224ac9d 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -5,7 +5,8 @@ keywords: - metric - monitoring - prometheus -version: 1.6.3 +- kubernetes +version: 1.6.4 appVersion: 1.6.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: From 19a0192bd0a7d1f0776c732d8bf75bb2d5353c26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Tue, 2 Jul 2019 20:11:12 +0200 Subject: [PATCH 048/111] [stable/kube-state-metrics] Rename ServiceMonitor template (#15214) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Manuel Rüger --- charts/kube-state-metrics/Chart.yaml | 2 +- .../templates/{monitor.yaml => servicemonitor.yaml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename charts/kube-state-metrics/templates/{monitor.yaml => servicemonitor.yaml} (100%) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 3a878224ac9d..67574ea3942d 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 1.6.4 +version: 1.6.5 appVersion: 1.6.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/monitor.yaml b/charts/kube-state-metrics/templates/servicemonitor.yaml similarity index 100% rename from charts/kube-state-metrics/templates/monitor.yaml rename to charts/kube-state-metrics/templates/servicemonitor.yaml From 5d857a4565dca4f9c113a023733ebfe207c0f05f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Fri, 5 Jul 2019 18:22:36 +0200 Subject: [PATCH 049/111] [stable/kube-state-metrics] Apply best practices for label naming (#15261) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Manuel Rüger --- charts/kube-state-metrics/Chart.yaml | 2 +- .../kube-state-metrics/templates/clusterrole.yaml | 8 ++++---- .../templates/clusterrolebinding.yaml | 8 ++++---- .../kube-state-metrics/templates/deployment.yaml | 14 +++++++------- .../templates/podsecuritypolicy.yaml | 8 ++++---- .../templates/psp-clusterrole.yaml | 8 ++++---- .../templates/psp-clusterrolebinding.yaml | 8 ++++---- charts/kube-state-metrics/templates/service.yaml | 12 ++++++------ .../templates/serviceaccount.yaml | 8 ++++---- .../templates/servicemonitor.yaml | 12 ++++++------ 10 files changed, 44 insertions(+), 44 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 67574ea3942d..b2f7573bfa51 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 1.6.5 +version: 2.0.0 appVersion: 1.6.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/clusterrole.yaml b/charts/kube-state-metrics/templates/clusterrole.yaml index 2c59adf5f625..9ded59935c39 100644 --- a/charts/kube-state-metrics/templates/clusterrole.yaml +++ b/charts/kube-state-metrics/templates/clusterrole.yaml @@ -3,10 +3,10 @@ apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRole metadata: labels: - app: {{ template "kube-state-metrics.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} name: {{ template "kube-state-metrics.fullname" . }} rules: {{ if .Values.collectors.certificatesigningrequests }} diff --git a/charts/kube-state-metrics/templates/clusterrolebinding.yaml b/charts/kube-state-metrics/templates/clusterrolebinding.yaml index e57b051f1f18..b4586fb7e875 100644 --- a/charts/kube-state-metrics/templates/clusterrolebinding.yaml +++ b/charts/kube-state-metrics/templates/clusterrolebinding.yaml @@ -3,10 +3,10 @@ apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: labels: - app: {{ template "kube-state-metrics.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} name: {{ template "kube-state-metrics.fullname" . }} roleRef: apiGroup: rbac.authorization.k8s.io diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 62f0b73059a4..4ea1af043595 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -3,20 +3,20 @@ kind: Deployment metadata: name: {{ template "kube-state-metrics.fullname" . }} labels: - app: {{ template "kube-state-metrics.name" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} + helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + app.kubernetes.io/instance: "{{ .Release.Name }}" + app.kubernetes.io/managed-by: "{{ .Release.Service }}" spec: selector: matchLabels: - app: {{ template "kube-state-metrics.name" . }} + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} replicas: {{ .Values.replicas }} template: metadata: labels: - app: {{ template "kube-state-metrics.name" . }} - release: "{{ .Release.Name }}" + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} + app.kubernetes.io/instance: "{{ .Release.Name }}" {{- if .Values.podAnnotations }} annotations: {{ toYaml .Values.podAnnotations | indent 8 }} diff --git a/charts/kube-state-metrics/templates/podsecuritypolicy.yaml b/charts/kube-state-metrics/templates/podsecuritypolicy.yaml index b44ca36f6f15..aeff11791ce3 100644 --- a/charts/kube-state-metrics/templates/podsecuritypolicy.yaml +++ b/charts/kube-state-metrics/templates/podsecuritypolicy.yaml @@ -4,10 +4,10 @@ kind: PodSecurityPolicy metadata: name: {{ template "kube-state-metrics.fullname" . }} labels: - app: {{ template "kube-state-metrics.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} {{- if .Values.podSecurityPolicy.annotations }} annotations: {{ toYaml .Values.podSecurityPolicy.annotations | indent 4 }} diff --git a/charts/kube-state-metrics/templates/psp-clusterrole.yaml b/charts/kube-state-metrics/templates/psp-clusterrole.yaml index c43f90da2c63..dcd65e13e468 100644 --- a/charts/kube-state-metrics/templates/psp-clusterrole.yaml +++ b/charts/kube-state-metrics/templates/psp-clusterrole.yaml @@ -3,10 +3,10 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: labels: - app: {{ template "kube-state-metrics.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} name: psp-{{ template "kube-state-metrics.fullname" . }} rules: - apiGroups: ['extensions'] diff --git a/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml b/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml index bfca12cab4c3..741861826ad7 100644 --- a/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml +++ b/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml @@ -3,10 +3,10 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: labels: - app: {{ template "kube-state-metrics.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} name: psp-{{ template "kube-state-metrics.fullname" . }} roleRef: apiGroup: rbac.authorization.k8s.io diff --git a/charts/kube-state-metrics/templates/service.yaml b/charts/kube-state-metrics/templates/service.yaml index b6daacdf4629..01f41e99f4a1 100644 --- a/charts/kube-state-metrics/templates/service.yaml +++ b/charts/kube-state-metrics/templates/service.yaml @@ -3,10 +3,10 @@ kind: Service metadata: name: {{ template "kube-state-metrics.fullname" . }} labels: - app: {{ template "kube-state-metrics.name" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} + helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + app.kubernetes.io/instance: "{{ .Release.Name }}" + app.kubernetes.io/managed-by: "{{ .Release.Service }}" {{- if .Values.prometheusScrape }} annotations: prometheus.io/scrape: '{{ .Values.prometheusScrape }}' @@ -25,5 +25,5 @@ spec: loadBalancerIP: "{{ .Values.service.loadBalancerIP }}" {{- end }} selector: - app: {{ template "kube-state-metrics.name" . }} - release: {{ .Release.Name }} + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/charts/kube-state-metrics/templates/serviceaccount.yaml b/charts/kube-state-metrics/templates/serviceaccount.yaml index 5459abb10a0e..e2bf7c0126a9 100644 --- a/charts/kube-state-metrics/templates/serviceaccount.yaml +++ b/charts/kube-state-metrics/templates/serviceaccount.yaml @@ -3,10 +3,10 @@ apiVersion: v1 kind: ServiceAccount metadata: labels: - app: {{ template "kube-state-metrics.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} name: {{ template "kube-state-metrics.fullname" . }} imagePullSecrets: {{ toYaml .Values.serviceAccount.imagePullSecrets | indent 2 }} diff --git a/charts/kube-state-metrics/templates/servicemonitor.yaml b/charts/kube-state-metrics/templates/servicemonitor.yaml index af151f10249a..7532ef89cdd0 100644 --- a/charts/kube-state-metrics/templates/servicemonitor.yaml +++ b/charts/kube-state-metrics/templates/servicemonitor.yaml @@ -4,18 +4,18 @@ kind: ServiceMonitor metadata: name: {{ template "kube-state-metrics.fullname" . }} labels: - app: {{ template "kube-state-metrics.name" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} + helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + app.kubernetes.io/instance: "{{ .Release.Name }}" + app.kubernetes.io/managed-by: "{{ .Release.Service }}" {{- if .Values.prometheus.monitor.additionalLabels }} {{ toYaml .Values.prometheus.monitor.additionalLabels | indent 4 }} {{- end }} spec: selector: matchLabels: - app: {{ template "kube-state-metrics.name" . }} - release: {{ .Release.Name }} + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} endpoints: - port: http {{- end }} From 6f1ddb91481ea0e41d9e078fa913b112acec1af4 Mon Sep 17 00:00:00 2001 From: Tariq Ibrahim Date: Wed, 24 Jul 2019 00:24:16 -0700 Subject: [PATCH 050/111] [stable/kube-state-metrics] update kube-state-metrics chart to use v1.7.1 (#15818) Signed-off-by: Tariq Ibrahim --- charts/kube-state-metrics/Chart.yaml | 4 +- charts/kube-state-metrics/README.md | 64 ++++++++++--------- .../templates/clusterrole.yaml | 12 ++++ .../templates/deployment.yaml | 6 ++ charts/kube-state-metrics/values.yaml | 4 +- 5 files changed, 56 insertions(+), 34 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index b2f7573bfa51..0d453385b541 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,8 +6,8 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.0.0 -appVersion: 1.6.0 +version: 2.1.0 +appVersion: 1.7.1 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 6816ef4a70cc..25551848c42f 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -15,17 +15,17 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |:----------------------------------------|:--------------------------------------------------------------------------------------|:-------------------------------------------| | `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | -| `image.tag` | The image tag to pull from | `v1.6.0` | -| `image.pullPolicy` | Image pull policy | IfNotPresent | -| `replicas` | Number of replicas | 1 | -| `service.port` | The port of the container | 8080 | -| `hostNetwork` | Whether or not to use the host network | false | -| `prometheusScrape` | Whether or not enable prom scrape | true | -| `rbac.create` | If true, create & use RBAC resources | true | -| `serviceAccount.create` | If true, create & use serviceAccount | true | +| `image.tag` | The image tag to pull from | `v1.7.1` | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `replicas` | Number of replicas | `1` | +| `service.port` | The port of the container | `8080` | +| `hostNetwork` | Whether or not to use the host network | `false` | +| `prometheusScrape` | Whether or not enable prom scrape | `true` | +| `rbac.create` | If true, create & use RBAC resources | `true` | +| `serviceAccount.create` | If true, create & use serviceAccount | `true` | | `serviceAccount.name` | If not set & create is true, use template fullname | | | `serviceAccount.imagePullSecrets` | Specify image pull secrets field | `[]` | -| `podSecurityPolicy.enabled` | If true, create & use PodSecurityPolicy resources | false | +| `podSecurityPolicy.enabled` | If true, create & use PodSecurityPolicy resources | `false` | | `podSecurityPolicy.annotations` | Specify pod annotations in the pod security policy | {} | | `securityContext.enabled` | Enable security context | `true` | | `securityContext.fsGroup` | Group ID for the container | `65534` | @@ -36,28 +36,30 @@ $ 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.certificatesigningrequests` | Enable the certificatesigningrequests collector. | true | -| `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 | -| `collectors.endpoints` | Enable the endpoints collector. | true | -| `collectors.horizontalpodautoscalers` | Enable the horizontalpodautoscalers collector. | true | -| `collectors.ingresses` | Enable the ingresses collector. | true | -| `collectors.jobs` | Enable the jobs collector. | true | -| `collectors.limitranges` | Enable the limitranges collector. | true | -| `collectors.namespaces` | Enable the namespaces collector. | true | -| `collectors.nodes` | Enable the nodes collector. | true | -| `collectors.persistentvolumeclaims` | Enable the persistentvolumeclaims collector. | true | -| `collectors.persistentvolumes` | Enable the persistentvolumes collector. | true | -| `collectors.poddisruptionbudgets` | Enable the poddisruptionbudgets collector. | true | -| `collectors.pods` | Enable the pods collector. | true | -| `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 | +| `collectors.certificatesigningrequests` | Enable the certificatesigningrequests collector. | `true` | +| `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` | +| `collectors.endpoints` | Enable the endpoints collector. | `true` | +| `collectors.horizontalpodautoscalers` | Enable the horizontalpodautoscalers collector. | `true` | +| `collectors.ingresses` | Enable the ingresses collector. | `true` | +| `collectors.jobs` | Enable the jobs collector. | `true` | +| `collectors.limitranges` | Enable the limitranges collector. | `true` | +| `collectors.namespaces` | Enable the namespaces collector. | `true` | +| `collectors.nodes` | Enable the nodes collector. | `true` | +| `collectors.persistentvolumeclaims` | Enable the persistentvolumeclaims collector. | `true` | +| `collectors.persistentvolumes` | Enable the persistentvolumes collector. | `true` | +| `collectors.poddisruptionbudgets` | Enable the poddisruptionbudgets collector. | `true` | +| `collectors.pods` | Enable the pods collector. | `true` | +| `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` | +| `collectors.storageclasses` | Enable the storageclasses collector. | `true` | +| `collectors.verticalpodautoscalers` | Enable the verticalpodautoscalers collector. | `false` | | `prometheus.monitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false` | | `prometheus.monitor.additionalLabels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | `{}` | | `prometheus.monitor.namespace` | Namespace where servicemonitor resource should be created | `the same namespace as kube-state-metrics` | diff --git a/charts/kube-state-metrics/templates/clusterrole.yaml b/charts/kube-state-metrics/templates/clusterrole.yaml index 9ded59935c39..1a7cc000e488 100644 --- a/charts/kube-state-metrics/templates/clusterrole.yaml +++ b/charts/kube-state-metrics/templates/clusterrole.yaml @@ -141,4 +141,16 @@ rules: - statefulsets verbs: ["list", "watch"] {{ end -}} +{{ if .Values.collectors.storageclasses }} +- apiGroups: ["storage.k8s.io"] + resources: + - storageclasses + verbs: ["list", "watch"] +{{ end -}} +{{ if .Values.collectors.verticalpodautoscalers }} +- apiGroups: ["autoscaling.k8s.io"] + resources: + - verticalpodautoscalers + verbs: ["list", "watch"] +{{ end -}} {{- end -}} diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 4ea1af043595..2fd32512545b 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -101,6 +101,12 @@ spec: {{ if .Values.collectors.statefulsets }} - --collectors=statefulsets {{ end }} +{{ if .Values.collectors.storageclasses }} + - --collectors=storageclasses +{{ end }} +{{ if .Values.collectors.verticalpodautoscalers }} + - --collectors=verticalpodautoscalers +{{ end }} {{ if .Values.namespace }} - --namespace={{ .Values.namespace }} {{ end }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 396866539267..50da9b42053f 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -2,7 +2,7 @@ prometheusScrape: true image: repository: quay.io/coreos/kube-state-metrics - tag: v1.6.0 + tag: v1.7.1 pullPolicy: IfNotPresent replicas: 1 @@ -100,6 +100,8 @@ collectors: secrets: true services: true statefulsets: true + storageclasses: true + verticalpodautoscalers: false # Namespace to be enabled for collecting resources. By default all namespaces are collected. # namespace: "" From 2ec85b5a17f706a24a393304ba839b8b6b21b96e Mon Sep 17 00:00:00 2001 From: isindir Date: Thu, 25 Jul 2019 01:31:51 +0100 Subject: [PATCH 051/111] [stable/kube-state-metrics] add customLabels to service, deployment and pods (#15808) Signed-off-by: Eriks Zelenka --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 1 + charts/kube-state-metrics/templates/deployment.yaml | 6 ++++++ charts/kube-state-metrics/templates/service.yaml | 3 +++ charts/kube-state-metrics/values.yaml | 2 ++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 0d453385b541..3fcecd6a2fc1 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.1.0 +version: 2.1.1 appVersion: 1.7.1 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 25551848c42f..975be8f19a40 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -19,6 +19,7 @@ $ helm install stable/kube-state-metrics | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `replicas` | Number of replicas | `1` | | `service.port` | The port of the container | `8080` | +| `customLabels` | Custom labels to apply to service, deployment and pods | `{}` | | `hostNetwork` | Whether or not to use the host network | `false` | | `prometheusScrape` | Whether or not enable prom scrape | `true` | | `rbac.create` | If true, create & use RBAC resources | `true` | diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 2fd32512545b..278d43ec9dc9 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -7,6 +7,9 @@ metadata: helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" +{{- if .Values.customLabels }} +{{ toYaml .Values.customLabels | indent 4 }} +{{- end }} spec: selector: matchLabels: @@ -17,6 +20,9 @@ spec: labels: app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" +{{- if .Values.customLabels }} +{{ toYaml .Values.customLabels | indent 8 }} +{{- end }} {{- if .Values.podAnnotations }} annotations: {{ toYaml .Values.podAnnotations | indent 8 }} diff --git a/charts/kube-state-metrics/templates/service.yaml b/charts/kube-state-metrics/templates/service.yaml index 01f41e99f4a1..dc05380889b1 100644 --- a/charts/kube-state-metrics/templates/service.yaml +++ b/charts/kube-state-metrics/templates/service.yaml @@ -7,6 +7,9 @@ metadata: helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" +{{- if .Values.customLabels }} +{{ toYaml .Values.customLabels | indent 4 }} +{{- end }} {{- if .Values.prometheusScrape }} annotations: prometheus.io/scrape: '{{ .Values.prometheusScrape }}' diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 50da9b42053f..6c099f6f4290 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -14,6 +14,8 @@ service: nodePort: 0 loadBalancerIP: "" +customLabels: {} + hostNetwork: false rbac: From 9add699255f65d46f9f3d6aff45e1eb6578efef8 Mon Sep 17 00:00:00 2001 From: Corey O'Brien Date: Thu, 25 Jul 2019 20:13:57 -0400 Subject: [PATCH 052/111] [stable/kube-state-metrics] Add option for service annotations (#15864) Signed-off-by: Corey O'Brien --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 1 + charts/kube-state-metrics/templates/service.yaml | 7 +++++-- charts/kube-state-metrics/values.yaml | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 3fcecd6a2fc1..e918432f3f95 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.1.1 +version: 2.2.1 appVersion: 1.7.1 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 975be8f19a40..78ddeaac9001 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -19,6 +19,7 @@ $ helm install stable/kube-state-metrics | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `replicas` | Number of replicas | `1` | | `service.port` | The port of the container | `8080` | +| `service.annotations` | Annotations to be added to the service | `{}` | `customLabels` | Custom labels to apply to service, deployment and pods | `{}` | | `hostNetwork` | Whether or not to use the host network | `false` | | `prometheusScrape` | Whether or not enable prom scrape | `true` | diff --git a/charts/kube-state-metrics/templates/service.yaml b/charts/kube-state-metrics/templates/service.yaml index dc05380889b1..a880bf912e31 100644 --- a/charts/kube-state-metrics/templates/service.yaml +++ b/charts/kube-state-metrics/templates/service.yaml @@ -10,10 +10,13 @@ metadata: {{- if .Values.customLabels }} {{ toYaml .Values.customLabels | indent 4 }} {{- end }} - {{- if .Values.prometheusScrape }} annotations: + {{- if .Values.prometheusScrape }} prometheus.io/scrape: '{{ .Values.prometheusScrape }}' - {{- end }} + {{- end }} + {{- if .Values.service.annotations }} + {{- toYaml .Values.service.annotations | nindent 4 }} + {{- end }} spec: type: "{{ .Values.service.type }}" ports: diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 6c099f6f4290..a08b8f1fae74 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -13,6 +13,7 @@ service: type: ClusterIP nodePort: 0 loadBalancerIP: "" + annotations: {} customLabels: {} From 544db6adaf86329bfaa24d7a0d7e42be7dfc2350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Mon, 5 Aug 2019 18:17:49 +0200 Subject: [PATCH 053/111] [stable/kube-state-metrics] Version bump to 1.7.2 (#16093) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Manuel Rüger --- charts/kube-state-metrics/Chart.yaml | 4 ++-- charts/kube-state-metrics/README.md | 2 +- charts/kube-state-metrics/values.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index e918432f3f95..4dced63118b8 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,8 +6,8 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.2.1 -appVersion: 1.7.1 +version: 2.2.2 +appVersion: 1.7.2 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 78ddeaac9001..e4236ab687f2 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -15,7 +15,7 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |:----------------------------------------|:--------------------------------------------------------------------------------------|:-------------------------------------------| | `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | -| `image.tag` | The image tag to pull from | `v1.7.1` | +| `image.tag` | The image tag to pull from | `v1.7.2` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `replicas` | Number of replicas | `1` | | `service.port` | The port of the container | `8080` | diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index a08b8f1fae74..2c32ccf8d61d 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -2,7 +2,7 @@ prometheusScrape: true image: repository: quay.io/coreos/kube-state-metrics - tag: v1.7.1 + tag: v1.7.2 pullPolicy: IfNotPresent replicas: 1 From 3aafcf0c015882ad677b0250cf348adb34bd6c3b Mon Sep 17 00:00:00 2001 From: Michael Merrill Date: Thu, 8 Aug 2019 13:31:20 -0400 Subject: [PATCH 054/111] [stable/kube-state-metrics] update rbac to use new ingress api group (#16188) (#16189) Signed-off-by: mmerrill3 --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/clusterrole.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 4dced63118b8..0327a2a2eb8f 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.2.2 +version: 2.2.3 appVersion: 1.7.2 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/clusterrole.yaml b/charts/kube-state-metrics/templates/clusterrole.yaml index 1a7cc000e488..4f68a1f058c4 100644 --- a/charts/kube-state-metrics/templates/clusterrole.yaml +++ b/charts/kube-state-metrics/templates/clusterrole.yaml @@ -52,7 +52,7 @@ rules: verbs: ["list", "watch"] {{ end -}} {{ if .Values.collectors.ingresses }} -- apiGroups: ["extensions"] +- apiGroups: ["extensions", "networking.k8s.io"] resources: - ingresses verbs: ["list", "watch"] From 55248f5f1106bcae304f6f7c8922d55ec77f03e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Tue, 13 Aug 2019 18:53:45 +0200 Subject: [PATCH 055/111] [stable/kube-state-metrics] Update liveness- and readinessProbes (#16284) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As changed downstream in https://github.com/kubernetes/kube-state-metrics/commit/be1a657608c3ff2d224c371e5265e77a6ddfa6bb Signed-off-by: Manuel Rüger --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/deployment.yaml | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 0327a2a2eb8f..3064d8eec6a6 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.2.3 +version: 2.3.0 appVersion: 1.7.2 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 278d43ec9dc9..7e7755021474 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -120,12 +120,19 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" ports: - containerPort: 8080 - readinessProbe: + livenessProbe: httpGet: path: /healthz port: 8080 initialDelaySeconds: 5 timeoutSeconds: 5 + readinessProbe: + httpGet: + path: / + port: 8080 + initialDelaySeconds: 5 + timeoutSeconds: 5 + resources: {{ toYaml .Values.resources | indent 12 }} {{- if .Values.affinity }} From d54133de0ed0e720a19a0efadbc0afa95f86f6e1 Mon Sep 17 00:00:00 2001 From: Adam Graves Date: Tue, 20 Aug 2019 18:02:56 +0100 Subject: [PATCH 056/111] [kube-state-metrics] Add honorlabel parameter (#16401) Signed-off-by: Adam Graves --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 1 + charts/kube-state-metrics/templates/servicemonitor.yaml | 3 +++ charts/kube-state-metrics/values.yaml | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 3064d8eec6a6..465c9ee3172a 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.3.0 +version: 2.3.1 appVersion: 1.7.2 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index e4236ab687f2..29c3f180ad65 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -65,3 +65,4 @@ $ helm install stable/kube-state-metrics | `prometheus.monitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false` | | `prometheus.monitor.additionalLabels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | `{}` | | `prometheus.monitor.namespace` | Namespace where servicemonitor resource should be created | `the same namespace as kube-state-metrics` | +| `prometheus.monitor.honorLabels` | Honor metric labels | `false` | diff --git a/charts/kube-state-metrics/templates/servicemonitor.yaml b/charts/kube-state-metrics/templates/servicemonitor.yaml index 7532ef89cdd0..6405bd47b592 100644 --- a/charts/kube-state-metrics/templates/servicemonitor.yaml +++ b/charts/kube-state-metrics/templates/servicemonitor.yaml @@ -18,4 +18,7 @@ spec: app.kubernetes.io/instance: {{ .Release.Name }} endpoints: - port: http + {{- if .Values.prometheus.monitor.honorLabels }} + honorLabels: true + {{- end }} {{- end }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 2c32ccf8d61d..d5631b00006e 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -38,6 +38,7 @@ prometheus: enabled: false additionalLabels: {} namespace: "" + honorLabels: false ## Specify if a Pod Security Policy for kube-state-metrics must be created ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/ From 6ebcbc2eb8c4dc8370f1a2920423023e88322782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Tue, 1 Oct 2019 21:13:34 +0200 Subject: [PATCH 057/111] [stable/kube-state-metrics] Version bump to 1.8.0 / Add myself as maintainer (#17593) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [stable/kube-state-metrics] Add myself as maintainer Signed-off-by: Manuel Rüger * [stable/kube-state-metrics] Version bump to 1.8.0 https://github.com/kubernetes/kube-state-metrics/releases/tag/v1.8.0 Signed-off-by: Manuel Rüger --- charts/kube-state-metrics/Chart.yaml | 4 ++-- charts/kube-state-metrics/OWNERS | 2 ++ charts/kube-state-metrics/README.md | 2 +- charts/kube-state-metrics/values.yaml | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 465c9ee3172a..f1f4693692f6 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,8 +6,8 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.3.1 -appVersion: 1.7.2 +version: 2.4.0 +appVersion: 1.8.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/charts/kube-state-metrics/OWNERS b/charts/kube-state-metrics/OWNERS index 2a78bcc6c316..6ffd97d743f3 100644 --- a/charts/kube-state-metrics/OWNERS +++ b/charts/kube-state-metrics/OWNERS @@ -1,6 +1,8 @@ approvers: - fiunchinho - tariq1890 +- mrueg reviewers: - fiunchinho - tariq1890 +- mrueg diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 29c3f180ad65..6c7f36422714 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -15,7 +15,7 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |:----------------------------------------|:--------------------------------------------------------------------------------------|:-------------------------------------------| | `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | -| `image.tag` | The image tag to pull from | `v1.7.2` | +| `image.tag` | The image tag to pull from | `v1.8.0` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `replicas` | Number of replicas | `1` | | `service.port` | The port of the container | `8080` | diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index d5631b00006e..2bf5b3085b61 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -2,7 +2,7 @@ prometheusScrape: true image: repository: quay.io/coreos/kube-state-metrics - tag: v1.7.2 + tag: v1.8.0 pullPolicy: IfNotPresent replicas: 1 From 6f2c394b272fea64b6b5b4857320185bc5a53f30 Mon Sep 17 00:00:00 2001 From: machine424 Date: Wed, 9 Oct 2019 18:53:51 +0200 Subject: [PATCH 058/111] [stable/kube-state-metrics] Avoid spec.template.spec.containers.0.resources with null value (#17817) Signed-off-by: ayoub mrini --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/deployment.yaml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index f1f4693692f6..283e1ac6db1c 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.4.0 +version: 2.4.1 appVersion: 1.8.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 7e7755021474..492df2441364 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -132,9 +132,10 @@ spec: port: 8080 initialDelaySeconds: 5 timeoutSeconds: 5 - +{{- if .Values.resources }} resources: -{{ toYaml .Values.resources | indent 12 }} +{{ toYaml .Values.resources | indent 10 }} +{{- end }} {{- if .Values.affinity }} affinity: {{ toYaml .Values.affinity | indent 8 }} From 7ce7729e6034621df9d5f2fe72a4e1f7c145f22c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Fri, 20 Dec 2019 22:55:40 +0100 Subject: [PATCH 059/111] [stable/kube-state-metrics] Version bump to 1.9.0 (#19726) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Manuel Rüger --- charts/kube-state-metrics/Chart.yaml | 6 +- charts/kube-state-metrics/README.md | 111 +++++++++--------- .../templates/clusterrole.yaml | 24 ++++ .../templates/deployment.yaml | 12 ++ charts/kube-state-metrics/values.yaml | 6 +- 5 files changed, 102 insertions(+), 57 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 283e1ac6db1c..3143924c7cc0 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,8 +6,8 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.4.1 -appVersion: 1.8.0 +version: 2.5.0 +appVersion: 1.9.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ @@ -16,3 +16,5 @@ maintainers: email: jose@armesto.net - name: tariq1890 email: tariq.ibrahim@mulesoft.com +- name: mrueg + email: manuel@rueg.eu diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 6c7f36422714..52f3d5fdbbb9 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -12,57 +12,60 @@ $ helm install stable/kube-state-metrics ## Configuration -| Parameter | Description | Default | -|:----------------------------------------|:--------------------------------------------------------------------------------------|:-------------------------------------------| -| `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | -| `image.tag` | The image tag to pull from | `v1.8.0` | -| `image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `replicas` | Number of replicas | `1` | -| `service.port` | The port of the container | `8080` | -| `service.annotations` | Annotations to be added to the service | `{}` -| `customLabels` | Custom labels to apply to service, deployment and pods | `{}` | -| `hostNetwork` | Whether or not to use the host network | `false` | -| `prometheusScrape` | Whether or not enable prom scrape | `true` | -| `rbac.create` | If true, create & use RBAC resources | `true` | -| `serviceAccount.create` | If true, create & use serviceAccount | `true` | -| `serviceAccount.name` | If not set & create is true, use template fullname | | -| `serviceAccount.imagePullSecrets` | Specify image pull secrets field | `[]` | -| `podSecurityPolicy.enabled` | If true, create & use PodSecurityPolicy resources | `false` | -| `podSecurityPolicy.annotations` | Specify pod annotations in the pod security policy | {} | -| `securityContext.enabled` | Enable security context | `true` | -| `securityContext.fsGroup` | Group ID for the container | `65534` | -| `securityContext.runAsUser` | User ID for the container | `65534` | -| `priorityClassName` | Name of Priority Class to assign pods | `nil` | -| `nodeSelector` | Node labels for pod assignment | {} | -| `affinity` | Affinity settings for pod assignment | {} | -| `tolerations` | Tolerations for pod assignment | [] | -| `podAnnotations` | Annotations to be added to the pod | {} | -| `resources` | kube-state-metrics resource requests and limits | {} | -| `collectors.certificatesigningrequests` | Enable the certificatesigningrequests collector. | `true` | -| `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` | -| `collectors.endpoints` | Enable the endpoints collector. | `true` | -| `collectors.horizontalpodautoscalers` | Enable the horizontalpodautoscalers collector. | `true` | -| `collectors.ingresses` | Enable the ingresses collector. | `true` | -| `collectors.jobs` | Enable the jobs collector. | `true` | -| `collectors.limitranges` | Enable the limitranges collector. | `true` | -| `collectors.namespaces` | Enable the namespaces collector. | `true` | -| `collectors.nodes` | Enable the nodes collector. | `true` | -| `collectors.persistentvolumeclaims` | Enable the persistentvolumeclaims collector. | `true` | -| `collectors.persistentvolumes` | Enable the persistentvolumes collector. | `true` | -| `collectors.poddisruptionbudgets` | Enable the poddisruptionbudgets collector. | `true` | -| `collectors.pods` | Enable the pods collector. | `true` | -| `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` | -| `collectors.storageclasses` | Enable the storageclasses collector. | `true` | -| `collectors.verticalpodautoscalers` | Enable the verticalpodautoscalers collector. | `false` | -| `prometheus.monitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false` | -| `prometheus.monitor.additionalLabels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | `{}` | -| `prometheus.monitor.namespace` | Namespace where servicemonitor resource should be created | `the same namespace as kube-state-metrics` | -| `prometheus.monitor.honorLabels` | Honor metric labels | `false` | +| Parameter | Description | Default | +|:---------------------------------------------|:--------------------------------------------------------------------------------------|:-------------------------------------------| +| `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | +| `image.tag` | The image tag to pull from | `v1.9.0` | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `replicas` | Number of replicas | `1` | +| `service.port` | The port of the container | `8080` | +| `service.annotations` | Annotations to be added to the service | `{}` | +| `customLabels` | Custom labels to apply to service, deployment and pods | `{}` | +| `hostNetwork` | Whether or not to use the host network | `false` | +| `prometheusScrape` | Whether or not enable prom scrape | `true` | +| `rbac.create` | If true, create & use RBAC resources | `true` | +| `serviceAccount.create` | If true, create & use serviceAccount | `true` | +| `serviceAccount.name` | If not set & create is true, use template fullname | | +| `serviceAccount.imagePullSecrets` | Specify image pull secrets field | `[]` | +| `podSecurityPolicy.enabled` | If true, create & use PodSecurityPolicy resources | `false` | +| `podSecurityPolicy.annotations` | Specify pod annotations in the pod security policy | {} | +| `securityContext.enabled` | Enable security context | `true` | +| `securityContext.fsGroup` | Group ID for the container | `65534` | +| `securityContext.runAsUser` | User ID for the container | `65534` | +| `priorityClassName` | Name of Priority Class to assign pods | `nil` | +| `nodeSelector` | Node labels for pod assignment | {} | +| `affinity` | Affinity settings for pod assignment | {} | +| `tolerations` | Tolerations for pod assignment | [] | +| `podAnnotations` | Annotations to be added to the pod | {} | +| `resources` | kube-state-metrics resource requests and limits | {} | +| `collectors.certificatesigningrequests` | Enable the certificatesigningrequests collector. | `true` | +| `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` | +| `collectors.endpoints` | Enable the endpoints collector. | `true` | +| `collectors.horizontalpodautoscalers` | Enable the horizontalpodautoscalers collector. | `true` | +| `collectors.ingresses` | Enable the ingresses collector. | `true` | +| `collectors.jobs` | Enable the jobs collector. | `true` | +| `collectors.limitranges` | Enable the limitranges collector. | `true` | +| `collectors.mutatingwebhookconfigurations` | Enable the mutatingwebhookconfigurations collector. | `false` | +| `collectors.namespaces` | Enable the namespaces collector. | `true` | +| `collectors.nodes` | Enable the nodes collector. | `true` | +| `collectors.persistentvolumeclaims` | Enable the persistentvolumeclaims collector. | `true` | +| `collectors.persistentvolumes` | Enable the persistentvolumes collector. | `true` | +| `collectors.poddisruptionbudgets` | Enable the poddisruptionbudgets collector. | `true` | +| `collectors.pods` | Enable the pods collector. | `true` | +| `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` | +| `collectors.storageclasses` | Enable the storageclasses collector. | `true` | +| `collectors.validatingwebhookconfigurations` | Enable the validatingwebhookconfigurations collector. | `false` | +| `collectors.verticalpodautoscalers` | Enable the verticalpodautoscalers collector. | `false` | +| `collectors.volumeattachements` | Enable the volumeattachments collector. | `false` | +| `prometheus.monitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false` | +| `prometheus.monitor.additionalLabels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | `{}` | +| `prometheus.monitor.namespace` | Namespace where servicemonitor resource should be created | `the same namespace as kube-state-metrics` | +| `prometheus.monitor.honorLabels` | Honor metric labels | `false` | diff --git a/charts/kube-state-metrics/templates/clusterrole.yaml b/charts/kube-state-metrics/templates/clusterrole.yaml index 4f68a1f058c4..49e9cf48af31 100644 --- a/charts/kube-state-metrics/templates/clusterrole.yaml +++ b/charts/kube-state-metrics/templates/clusterrole.yaml @@ -69,12 +69,24 @@ rules: - limitranges verbs: ["list", "watch"] {{ end -}} +{{ if .Values.collectors.mutatingwebhookconfigurations }} +- apiGroups: ["admissionregistration.k8s.io"] + resources: + - mutatingwebhookconfigurations + verbs: ["list", "watch"] +{{ end -}} {{ if .Values.collectors.namespaces }} - apiGroups: [""] resources: - namespaces verbs: ["list", "watch"] {{ end -}} +{{ if .Values.collectors.networkpolicies }} +- apiGroups: ["networking.k8s.io"] + resources: + - networkpolicies + verbs: ["list", "watch"] +{{ end -}} {{ if .Values.collectors.nodes }} - apiGroups: [""] resources: @@ -147,6 +159,18 @@ rules: - storageclasses verbs: ["list", "watch"] {{ end -}} +{{ if .Values.collectors.validatingwebhookconfigurations }} +- apiGroups: ["admissionregistration.k8s.io"] + resources: + - validatingwebhookconfigurations + verbs: ["list", "watch"] +{{ end -}} +{{ if .Values.collectors.volumeattachements }} +- apiGroups: ["storageclasses.k8s.io"] + resources: + - storageclasses + verbs: ["list", "watch"] +{{ end -}} {{ if .Values.collectors.verticalpodautoscalers }} - apiGroups: ["autoscaling.k8s.io"] resources: diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 492df2441364..db07f405a82f 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -71,9 +71,15 @@ spec: {{ if .Values.collectors.limitranges }} - --collectors=limitranges {{ end }} +{{ if .Values.collectors.mutatingwebhookconfigurations }} + - --collectors=mutatingwebhookconfigurations +{{ end }} {{ if .Values.collectors.namespaces }} - --collectors=namespaces {{ end }} +{{ if .Values.collectors.networkpolicies }} + - --collectors=networkpolicies +{{ end }} {{ if .Values.collectors.nodes }} - --collectors=nodes {{ end }} @@ -110,9 +116,15 @@ spec: {{ if .Values.collectors.storageclasses }} - --collectors=storageclasses {{ end }} +{{ if .Values.collectors.validatingwebhookconfigurations }} + - --collectors=validatingwebhookconfigurations +{{ end }} {{ if .Values.collectors.verticalpodautoscalers }} - --collectors=verticalpodautoscalers {{ end }} +{{ if .Values.collectors.volumeattachements }} + - --collectors=volumeattachements +{{ end }} {{ if .Values.namespace }} - --namespace={{ .Values.namespace }} {{ end }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 2bf5b3085b61..a57a86da47cf 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -2,7 +2,7 @@ prometheusScrape: true image: repository: quay.io/coreos/kube-state-metrics - tag: v1.8.0 + tag: v1.9.0 pullPolicy: IfNotPresent replicas: 1 @@ -92,7 +92,9 @@ collectors: ingresses: true jobs: true limitranges: true + mutatingwebhookconfigurations: false namespaces: true + networkpolicies: false nodes: true persistentvolumeclaims: true persistentvolumes: true @@ -105,7 +107,9 @@ collectors: services: true statefulsets: true storageclasses: true + validatingwebhookconfigurations: false verticalpodautoscalers: false + volumeattachements: false # Namespace to be enabled for collecting resources. By default all namespaces are collected. # namespace: "" From a978e53cb810aba055a6d9e3cfe03ce7196cb95a Mon Sep 17 00:00:00 2001 From: Alexander Katsyuba Date: Thu, 2 Jan 2020 18:37:41 +0300 Subject: [PATCH 060/111] [stable/kube-state-metrics] Namespace override (#18990) Signed-off-by: Alexander Katsyuba --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 1 + charts/kube-state-metrics/templates/NOTES.txt | 2 +- charts/kube-state-metrics/templates/_helpers.tpl | 11 +++++++++++ .../templates/clusterrolebinding.yaml | 2 +- charts/kube-state-metrics/templates/deployment.yaml | 1 + .../templates/psp-clusterrolebinding.yaml | 2 +- charts/kube-state-metrics/templates/service.yaml | 1 + .../kube-state-metrics/templates/serviceaccount.yaml | 1 + .../kube-state-metrics/templates/servicemonitor.yaml | 1 + charts/kube-state-metrics/values.yaml | 4 ++++ 11 files changed, 24 insertions(+), 4 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 3143924c7cc0..7ec3c0f06d3d 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.5.0 +version: 2.6.0 appVersion: 1.9.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 52f3d5fdbbb9..45d3dbd92013 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -69,3 +69,4 @@ $ helm install stable/kube-state-metrics | `prometheus.monitor.additionalLabels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | `{}` | | `prometheus.monitor.namespace` | Namespace where servicemonitor resource should be created | `the same namespace as kube-state-metrics` | | `prometheus.monitor.honorLabels` | Honor metric labels | `false` | +| `namespaceOverride` | Override the deployment namespace | `""` (`Release.Namespace`) | diff --git a/charts/kube-state-metrics/templates/NOTES.txt b/charts/kube-state-metrics/templates/NOTES.txt index d804011e7933..5a646e0cca6d 100644 --- a/charts/kube-state-metrics/templates/NOTES.txt +++ b/charts/kube-state-metrics/templates/NOTES.txt @@ -3,7 +3,7 @@ The exposed metrics can be found here: https://github.com/kubernetes/kube-state-metrics/blob/master/docs/README.md#exposed-metrics The metrics are exported on the HTTP endpoint /metrics on the listening port. -In your case, {{ template "kube-state-metrics.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}/metrics +In your case, {{ template "kube-state-metrics.fullname" . }}.{{ template "kube-state-metrics.namespace" . }}.svc.cluster.local:{{ .Values.service.port }}/metrics They are served either as plaintext or protobuf depending on the Accept header. They are designed to be consumed either by Prometheus itself or by a scraper that is compatible with scraping a Prometheus client endpoint. diff --git a/charts/kube-state-metrics/templates/_helpers.tpl b/charts/kube-state-metrics/templates/_helpers.tpl index e59ada57caef..6ae0e647fe83 100644 --- a/charts/kube-state-metrics/templates/_helpers.tpl +++ b/charts/kube-state-metrics/templates/_helpers.tpl @@ -34,3 +34,14 @@ Create the name of the service account to use {{ default "default" .Values.serviceAccount.name }} {{- end -}} {{- end -}} + +{{/* +Allow the release namespace to be overridden for multi-namespace deployments in combined charts +*/}} +{{- define "kube-state-metrics.namespace" -}} + {{- if .Values.namespaceOverride -}} + {{- .Values.namespaceOverride -}} + {{- else -}} + {{- .Release.Namespace -}} + {{- end -}} +{{- end -}} diff --git a/charts/kube-state-metrics/templates/clusterrolebinding.yaml b/charts/kube-state-metrics/templates/clusterrolebinding.yaml index b4586fb7e875..4635985aa0c7 100644 --- a/charts/kube-state-metrics/templates/clusterrolebinding.yaml +++ b/charts/kube-state-metrics/templates/clusterrolebinding.yaml @@ -15,5 +15,5 @@ roleRef: subjects: - kind: ServiceAccount name: {{ template "kube-state-metrics.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ template "kube-state-metrics.namespace" . }} {{- end -}} diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index db07f405a82f..71dedce5d15b 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "kube-state-metrics.fullname" . }} + namespace: {{ template "kube-state-metrics.namespace" . }} labels: app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" diff --git a/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml b/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml index 741861826ad7..a206e640d90a 100644 --- a/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml +++ b/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml @@ -15,5 +15,5 @@ roleRef: subjects: - kind: ServiceAccount name: {{ template "kube-state-metrics.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ template "kube-state-metrics.namespace" . }} {{- end }} diff --git a/charts/kube-state-metrics/templates/service.yaml b/charts/kube-state-metrics/templates/service.yaml index a880bf912e31..5dacf5217aae 100644 --- a/charts/kube-state-metrics/templates/service.yaml +++ b/charts/kube-state-metrics/templates/service.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ template "kube-state-metrics.fullname" . }} + namespace: {{ template "kube-state-metrics.namespace" . }} labels: app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" diff --git a/charts/kube-state-metrics/templates/serviceaccount.yaml b/charts/kube-state-metrics/templates/serviceaccount.yaml index e2bf7c0126a9..32bb1640f2eb 100644 --- a/charts/kube-state-metrics/templates/serviceaccount.yaml +++ b/charts/kube-state-metrics/templates/serviceaccount.yaml @@ -8,6 +8,7 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} name: {{ template "kube-state-metrics.fullname" . }} + namespace: {{ template "kube-state-metrics.namespace" . }} imagePullSecrets: {{ toYaml .Values.serviceAccount.imagePullSecrets | indent 2 }} {{- end -}} diff --git a/charts/kube-state-metrics/templates/servicemonitor.yaml b/charts/kube-state-metrics/templates/servicemonitor.yaml index 6405bd47b592..54cde362d221 100644 --- a/charts/kube-state-metrics/templates/servicemonitor.yaml +++ b/charts/kube-state-metrics/templates/servicemonitor.yaml @@ -3,6 +3,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ template "kube-state-metrics.fullname" . }} + namespace: {{ template "kube-state-metrics.namespace" . }} labels: app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index a57a86da47cf..747e5d8b7809 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -113,3 +113,7 @@ collectors: # Namespace to be enabled for collecting resources. By default all namespaces are collected. # namespace: "" + +## Override the deployment namespace +## +namespaceOverride: "" From 22eea8f5db0fb3d069b2af271b2578479b296991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Fri, 10 Jan 2020 21:10:35 +0100 Subject: [PATCH 061/111] [stable/kube-state-metrics] Version bump to 1.9.1 (#20028) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/kubernetes/kube-state-metrics/releases/tag/v1.9.1 Signed-off-by: Manuel Rüger --- charts/kube-state-metrics/Chart.yaml | 4 ++-- charts/kube-state-metrics/README.md | 2 +- charts/kube-state-metrics/values.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 7ec3c0f06d3d..bd1528789680 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,8 +6,8 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.6.0 -appVersion: 1.9.0 +version: 2.6.1 +appVersion: 1.9.1 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 45d3dbd92013..d5057dbe8016 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -15,7 +15,7 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |:---------------------------------------------|:--------------------------------------------------------------------------------------|:-------------------------------------------| | `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | -| `image.tag` | The image tag to pull from | `v1.9.0` | +| `image.tag` | The image tag to pull from | `v1.9.1` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `replicas` | Number of replicas | `1` | | `service.port` | The port of the container | `8080` | diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 747e5d8b7809..6ad6c28bd2ab 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -2,7 +2,7 @@ prometheusScrape: true image: repository: quay.io/coreos/kube-state-metrics - tag: v1.9.0 + tag: v1.9.1 pullPolicy: IfNotPresent replicas: 1 From 46bf33203dec5ff27aeada33aa142607596376fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Tue, 14 Jan 2020 19:21:17 +0100 Subject: [PATCH 062/111] [stable/kube-state-metrics] Version bump to 1.9.2 (#20103) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Manuel Rüger --- charts/kube-state-metrics/Chart.yaml | 4 ++-- charts/kube-state-metrics/README.md | 2 +- charts/kube-state-metrics/values.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index bd1528789680..d548ce269518 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,8 +6,8 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.6.1 -appVersion: 1.9.1 +version: 2.6.2 +appVersion: 1.9.2 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index d5057dbe8016..66a1c1b8bf4d 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -15,7 +15,7 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |:---------------------------------------------|:--------------------------------------------------------------------------------------|:-------------------------------------------| | `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | -| `image.tag` | The image tag to pull from | `v1.9.1` | +| `image.tag` | The image tag to pull from | `v1.9.2` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `replicas` | Number of replicas | `1` | | `service.port` | The port of the container | `8080` | diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 6ad6c28bd2ab..956c718c803e 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -2,7 +2,7 @@ prometheusScrape: true image: repository: quay.io/coreos/kube-state-metrics - tag: v1.9.1 + tag: v1.9.2 pullPolicy: IfNotPresent replicas: 1 From a529b8e8d2c87e1fc880171f161f251a3a30da56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Wed, 22 Jan 2020 18:22:35 +0100 Subject: [PATCH 063/111] [stable/kube-state-metrics] Version bump to 1.9.3 (#20289) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Manuel Rüger --- charts/kube-state-metrics/Chart.yaml | 4 ++-- charts/kube-state-metrics/README.md | 2 +- charts/kube-state-metrics/values.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index d548ce269518..643961678636 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,8 +6,8 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.6.2 -appVersion: 1.9.2 +version: 2.6.3 +appVersion: 1.9.3 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 66a1c1b8bf4d..558f07c2cd14 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -15,7 +15,7 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |:---------------------------------------------|:--------------------------------------------------------------------------------------|:-------------------------------------------| | `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | -| `image.tag` | The image tag to pull from | `v1.9.2` | +| `image.tag` | The image tag to pull from | `v1.9.3` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `replicas` | Number of replicas | `1` | | `service.port` | The port of the container | `8080` | diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 956c718c803e..bf9453b82879 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -2,7 +2,7 @@ prometheusScrape: true image: repository: quay.io/coreos/kube-state-metrics - tag: v1.9.2 + tag: v1.9.3 pullPolicy: IfNotPresent replicas: 1 From a2e2c2a18a5e3a7c9c763527c498df71bc4ceb96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Tue, 4 Feb 2020 20:25:27 +0100 Subject: [PATCH 064/111] [stable/kube-state-metrics] Version bump to 1.9.4 (#20543) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Manuel Rüger --- charts/kube-state-metrics/Chart.yaml | 4 ++-- charts/kube-state-metrics/README.md | 2 +- charts/kube-state-metrics/values.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 643961678636..2c3e2a24302b 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,8 +6,8 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.6.3 -appVersion: 1.9.3 +version: 2.6.4 +appVersion: 1.9.4 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 558f07c2cd14..e7fe09728429 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -15,7 +15,7 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |:---------------------------------------------|:--------------------------------------------------------------------------------------|:-------------------------------------------| | `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | -| `image.tag` | The image tag to pull from | `v1.9.3` | +| `image.tag` | The image tag to pull from | `v1.9.4` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `replicas` | Number of replicas | `1` | | `service.port` | The port of the container | `8080` | diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index bf9453b82879..5af53834add6 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -2,7 +2,7 @@ prometheusScrape: true image: repository: quay.io/coreos/kube-state-metrics - tag: v1.9.3 + tag: v1.9.4 pullPolicy: IfNotPresent replicas: 1 From 578e660ce272069df360118213d675336a88b7ef Mon Sep 17 00:00:00 2001 From: Alex Gaganov <31386536+alexgaganov-fiverr@users.noreply.github.com> Date: Thu, 20 Feb 2020 17:09:04 +0200 Subject: [PATCH 065/111] [stable/kube-state-metrics] Support automatic sharding (#20791) Signed-off-by: Alex Gaganov --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 1 + .../templates/deployment.yaml | 23 ++++++++++++++++ .../templates/stsdiscovery-role.yaml | 27 +++++++++++++++++++ .../templates/stsdiscovery-rolebinding.yaml | 20 ++++++++++++++ charts/kube-state-metrics/values.yaml | 7 +++++ 6 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 charts/kube-state-metrics/templates/stsdiscovery-role.yaml create mode 100644 charts/kube-state-metrics/templates/stsdiscovery-rolebinding.yaml diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 2c3e2a24302b..f68ddfaee4b0 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.6.4 +version: 2.7.0 appVersion: 1.9.4 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index e7fe09728429..44754a3547bf 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -18,6 +18,7 @@ $ helm install stable/kube-state-metrics | `image.tag` | The image tag to pull from | `v1.9.4` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `replicas` | Number of replicas | `1` | +| `autosharding.enabled` | Set to `true` to automatically shard data across `replicas` pods. EXPERIMENTAL | `false` | | `service.port` | The port of the container | `8080` | | `service.annotations` | Annotations to be added to the service | `{}` | | `customLabels` | Custom labels to apply to service, deployment and pods | `{}` | diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 71dedce5d15b..4797c09b8e6b 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -1,5 +1,9 @@ apiVersion: apps/v1 +{{- if .Values.autosharding.enabled }} +kind: StatefulSet +{{- else }} kind: Deployment +{{- end }} metadata: name: {{ template "kube-state-metrics.fullname" . }} namespace: {{ template "kube-state-metrics.namespace" . }} @@ -16,6 +20,10 @@ spec: matchLabels: app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} replicas: {{ .Values.replicas }} +{{- if .Values.autosharding.enabled }} + serviceName: {{ template "kube-state-metrics.fullname" . }} + volumeClaimTemplates: [] +{{- end }} template: metadata: labels: @@ -41,6 +49,17 @@ spec: {{- end }} containers: - name: {{ .Chart.Name }} +{{- if .Values.autosharding.enabled }} + env: + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace +{{- end }} args: {{ if .Values.collectors.certificatesigningrequests }} - --collectors=certificatesigningrequests @@ -128,6 +147,10 @@ spec: {{ end }} {{ if .Values.namespace }} - --namespace={{ .Values.namespace }} +{{ end }} +{{ if .Values.autosharding.enabled }} + - --pod=$(POD_NAME) + - --pod-namespace=$(POD_NAMESPACE) {{ end }} imagePullPolicy: {{ .Values.image.pullPolicy }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/charts/kube-state-metrics/templates/stsdiscovery-role.yaml b/charts/kube-state-metrics/templates/stsdiscovery-role.yaml new file mode 100644 index 000000000000..bf5396072710 --- /dev/null +++ b/charts/kube-state-metrics/templates/stsdiscovery-role.yaml @@ -0,0 +1,27 @@ +{{- if and .Values.autosharding.enabled .Values.rbac.create -}} +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: stsdiscovery-{{ template "kube-state-metrics.fullname" . }} + namespace: {{ template "kube-state-metrics.namespace" . }} + labels: + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} +rules: +- apiGroups: + - "" + resources: + - pods + verbs: + - get +- apiGroups: + - apps + resourceNames: + - kube-state-metrics + resources: + - statefulsets + verbs: + - get +{{- end }} diff --git a/charts/kube-state-metrics/templates/stsdiscovery-rolebinding.yaml b/charts/kube-state-metrics/templates/stsdiscovery-rolebinding.yaml new file mode 100644 index 000000000000..6a2e5bfe7b0b --- /dev/null +++ b/charts/kube-state-metrics/templates/stsdiscovery-rolebinding.yaml @@ -0,0 +1,20 @@ +{{- if and .Values.autosharding.enabled .Values.rbac.create -}} +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: stsdiscovery-{{ template "kube-state-metrics.fullname" . }} + namespace: {{ template "kube-state-metrics.namespace" . }} + labels: + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: stsdiscovery-{{ template "kube-state-metrics.fullname" . }} +subjects: + - kind: ServiceAccount + name: {{ template "kube-state-metrics.fullname" . }} + namespace: {{ template "kube-state-metrics.namespace" . }} +{{- end }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 5af53834add6..d8ceef52e6b6 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -5,6 +5,13 @@ image: tag: v1.9.4 pullPolicy: IfNotPresent +# If set to true, this will deploy kube-state-metrics as a StatefulSet and the data +# will be automatically sharded across <.Values.replicas> pods using the built-in +# autodiscovery feature: https://github.com/kubernetes/kube-state-metrics#automated-sharding +# This is an experimental feature and there are no stability guarantees. +autosharding: + enabled: false + replicas: 1 service: From 1dc3f8af71f6609e1bdd6d4600c17c17b0840a9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Thu, 20 Feb 2020 20:51:58 +0100 Subject: [PATCH 066/111] [stable/kube-state-metrics] Version bump to 1.9.5 (#20915) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes also volumeattachments typo found by @mbarrien Signed-off-by: Manuel Rüger --- charts/kube-state-metrics/Chart.yaml | 4 ++-- charts/kube-state-metrics/README.md | 4 ++-- charts/kube-state-metrics/templates/clusterrole.yaml | 2 +- charts/kube-state-metrics/templates/deployment.yaml | 4 ++-- charts/kube-state-metrics/values.yaml | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index f68ddfaee4b0..494548d5ffae 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,8 +6,8 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.7.0 -appVersion: 1.9.4 +version: 2.7.1 +appVersion: 1.9.5 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 44754a3547bf..5c6456983b9b 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -15,7 +15,7 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |:---------------------------------------------|:--------------------------------------------------------------------------------------|:-------------------------------------------| | `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | -| `image.tag` | The image tag to pull from | `v1.9.4` | +| `image.tag` | The image tag to pull from | `v1.9.5` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `replicas` | Number of replicas | `1` | | `autosharding.enabled` | Set to `true` to automatically shard data across `replicas` pods. EXPERIMENTAL | `false` | @@ -65,7 +65,7 @@ $ helm install stable/kube-state-metrics | `collectors.storageclasses` | Enable the storageclasses collector. | `true` | | `collectors.validatingwebhookconfigurations` | Enable the validatingwebhookconfigurations collector. | `false` | | `collectors.verticalpodautoscalers` | Enable the verticalpodautoscalers collector. | `false` | -| `collectors.volumeattachements` | Enable the volumeattachments collector. | `false` | +| `collectors.volumeattachments` | Enable the volumeattachments collector. | `false` | | `prometheus.monitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false` | | `prometheus.monitor.additionalLabels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | `{}` | | `prometheus.monitor.namespace` | Namespace where servicemonitor resource should be created | `the same namespace as kube-state-metrics` | diff --git a/charts/kube-state-metrics/templates/clusterrole.yaml b/charts/kube-state-metrics/templates/clusterrole.yaml index 49e9cf48af31..8728aab61e6b 100644 --- a/charts/kube-state-metrics/templates/clusterrole.yaml +++ b/charts/kube-state-metrics/templates/clusterrole.yaml @@ -165,7 +165,7 @@ rules: - validatingwebhookconfigurations verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.volumeattachements }} +{{ if .Values.collectors.volumeattachments }} - apiGroups: ["storageclasses.k8s.io"] resources: - storageclasses diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 4797c09b8e6b..b6affcc202e6 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -142,8 +142,8 @@ spec: {{ if .Values.collectors.verticalpodautoscalers }} - --collectors=verticalpodautoscalers {{ end }} -{{ if .Values.collectors.volumeattachements }} - - --collectors=volumeattachements +{{ if .Values.collectors.volumeattachments }} + - --collectors=volumeattachments {{ end }} {{ if .Values.namespace }} - --namespace={{ .Values.namespace }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index d8ceef52e6b6..57c92553f2b1 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -2,7 +2,7 @@ prometheusScrape: true image: repository: quay.io/coreos/kube-state-metrics - tag: v1.9.4 + tag: v1.9.5 pullPolicy: IfNotPresent # If set to true, this will deploy kube-state-metrics as a StatefulSet and the data @@ -116,7 +116,7 @@ collectors: storageclasses: true validatingwebhookconfigurations: false verticalpodautoscalers: false - volumeattachements: false + volumeattachments: false # Namespace to be enabled for collecting resources. By default all namespaces are collected. # namespace: "" From 8842b45d039f1be8d0f6a7da3ff0de8a042ecdcf Mon Sep 17 00:00:00 2001 From: Fabrice Date: Wed, 4 Mar 2020 01:57:47 -0800 Subject: [PATCH 067/111] [stable/kube-state-metrics] Add missing permission for volumeattachments collector (#21079) When enabling the volumeattachments collector, the following error is logged without this permission: Failed to list *v1.VolumeAttachment: volumeattachments.storage.k8s.io is forbidden: User "XXXXX:kube-state-metrics" cannot list resource "volumeattachments" in API group "storage.k8s.io" at the cluster scope Signed-off-by: Fabrice Rabaute --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/clusterrole.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 494548d5ffae..4468a0785d5d 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.7.1 +version: 2.7.2 appVersion: 1.9.5 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/clusterrole.yaml b/charts/kube-state-metrics/templates/clusterrole.yaml index 8728aab61e6b..319aec16c203 100644 --- a/charts/kube-state-metrics/templates/clusterrole.yaml +++ b/charts/kube-state-metrics/templates/clusterrole.yaml @@ -166,9 +166,9 @@ rules: verbs: ["list", "watch"] {{ end -}} {{ if .Values.collectors.volumeattachments }} -- apiGroups: ["storageclasses.k8s.io"] +- apiGroups: ["storage.k8s.io"] resources: - - storageclasses + - volumeattachments verbs: ["list", "watch"] {{ end -}} {{ if .Values.collectors.verticalpodautoscalers }} From 02528be7bace2d2e29c4ac3bcd680a46b5ca2f25 Mon Sep 17 00:00:00 2001 From: Kubernetes Prow Robot Date: Wed, 4 Mar 2020 16:40:37 -0800 Subject: [PATCH 068/111] [stable/kube-state-metrics] Enable all collectors by default (#21245) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Manuel Rüger --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 9 +++++---- charts/kube-state-metrics/values.yaml | 10 +++++----- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 4468a0785d5d..08172fcc53b7 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.7.2 +version: 2.8.0 appVersion: 1.9.5 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 5c6456983b9b..8811d4b0e4a6 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -49,8 +49,9 @@ $ helm install stable/kube-state-metrics | `collectors.ingresses` | Enable the ingresses collector. | `true` | | `collectors.jobs` | Enable the jobs collector. | `true` | | `collectors.limitranges` | Enable the limitranges collector. | `true` | -| `collectors.mutatingwebhookconfigurations` | Enable the mutatingwebhookconfigurations collector. | `false` | +| `collectors.mutatingwebhookconfigurations` | Enable the mutatingwebhookconfigurations collector. | `true` | | `collectors.namespaces` | Enable the namespaces collector. | `true` | +| `collectors.networkpolicies` | Enable the networkpolicies collector. | `true` | | `collectors.nodes` | Enable the nodes collector. | `true` | | `collectors.persistentvolumeclaims` | Enable the persistentvolumeclaims collector. | `true` | | `collectors.persistentvolumes` | Enable the persistentvolumes collector. | `true` | @@ -63,9 +64,9 @@ $ helm install stable/kube-state-metrics | `collectors.services` | Enable the services collector. | `true` | | `collectors.statefulsets` | Enable the statefulsets collector. | `true` | | `collectors.storageclasses` | Enable the storageclasses collector. | `true` | -| `collectors.validatingwebhookconfigurations` | Enable the validatingwebhookconfigurations collector. | `false` | -| `collectors.verticalpodautoscalers` | Enable the verticalpodautoscalers collector. | `false` | -| `collectors.volumeattachments` | Enable the volumeattachments collector. | `false` | +| `collectors.validatingwebhookconfigurations` | Enable the validatingwebhookconfigurations collector. | `true` | +| `collectors.verticalpodautoscalers` | Enable the verticalpodautoscalers collector. | `true` | +| `collectors.volumeattachments` | Enable the volumeattachments collector. | `true` | | `prometheus.monitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false` | | `prometheus.monitor.additionalLabels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | `{}` | | `prometheus.monitor.namespace` | Namespace where servicemonitor resource should be created | `the same namespace as kube-state-metrics` | diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 57c92553f2b1..ebcebed57e15 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -99,9 +99,9 @@ collectors: ingresses: true jobs: true limitranges: true - mutatingwebhookconfigurations: false + mutatingwebhookconfigurations: true namespaces: true - networkpolicies: false + networkpolicies: true nodes: true persistentvolumeclaims: true persistentvolumes: true @@ -114,9 +114,9 @@ collectors: services: true statefulsets: true storageclasses: true - validatingwebhookconfigurations: false - verticalpodautoscalers: false - volumeattachments: false + validatingwebhookconfigurations: true + verticalpodautoscalers: true + volumeattachments: true # Namespace to be enabled for collecting resources. By default all namespaces are collected. # namespace: "" From 8009d2caf419f59743a81046eab7998cb0ffbcdd Mon Sep 17 00:00:00 2001 From: Kubernetes Prow Robot Date: Thu, 5 Mar 2020 01:46:38 -0800 Subject: [PATCH 069/111] [stable/kube-state-metrics] Only create PSP RBAC if rbac.create is true. (#19986) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Cédric de Saint Martin --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 2 +- charts/kube-state-metrics/templates/psp-clusterrole.yaml | 2 +- charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 08172fcc53b7..69c07eae7ce2 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.8.0 +version: 2.8.1 appVersion: 1.9.5 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 8811d4b0e4a6..9038c5f25e9a 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -28,7 +28,7 @@ $ helm install stable/kube-state-metrics | `serviceAccount.create` | If true, create & use serviceAccount | `true` | | `serviceAccount.name` | If not set & create is true, use template fullname | | | `serviceAccount.imagePullSecrets` | Specify image pull secrets field | `[]` | -| `podSecurityPolicy.enabled` | If true, create & use PodSecurityPolicy resources | `false` | +| `podSecurityPolicy.enabled` | If true, create & use PodSecurityPolicy resources. Note that related RBACs are created only if `rbac.enabled` is `true. | `false` | | `podSecurityPolicy.annotations` | Specify pod annotations in the pod security policy | {} | | `securityContext.enabled` | Enable security context | `true` | | `securityContext.fsGroup` | Group ID for the container | `65534` | diff --git a/charts/kube-state-metrics/templates/psp-clusterrole.yaml b/charts/kube-state-metrics/templates/psp-clusterrole.yaml index dcd65e13e468..a28fcef98f2b 100644 --- a/charts/kube-state-metrics/templates/psp-clusterrole.yaml +++ b/charts/kube-state-metrics/templates/psp-clusterrole.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.podSecurityPolicy.enabled -}} +{{- if and .Values.podSecurityPolicy.enabled .Values.rbac.enabled -}} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: diff --git a/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml b/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml index a206e640d90a..16141b420cc9 100644 --- a/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml +++ b/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.podSecurityPolicy.enabled -}} +{{- if and .Values.podSecurityPolicy.enabled .Values.rbac.enabled -}} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: From 4439a2bdbb0472ec6d773fced1755bd093dbdd3d Mon Sep 17 00:00:00 2001 From: Peter Rifel Date: Sat, 14 Mar 2020 08:16:34 -0500 Subject: [PATCH 070/111] [stable/kube-state-metrics] Add PodDisruptionBudget (#21340) Signed-off-by: Peter Rifel --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 1 + charts/kube-state-metrics/templates/pdb.yaml | 17 +++++++++++++++++ charts/kube-state-metrics/values.yaml | 3 +++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 charts/kube-state-metrics/templates/pdb.yaml diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 69c07eae7ce2..f22c26b42016 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.8.1 +version: 2.8.2 appVersion: 1.9.5 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 9038c5f25e9a..c7d21dd51a45 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -38,6 +38,7 @@ $ helm install stable/kube-state-metrics | `affinity` | Affinity settings for pod assignment | {} | | `tolerations` | Tolerations for pod assignment | [] | | `podAnnotations` | Annotations to be added to the pod | {} | +| `podDisruptionBudget` | Optional PodDisruptionBudget | {} | | `resources` | kube-state-metrics resource requests and limits | {} | | `collectors.certificatesigningrequests` | Enable the certificatesigningrequests collector. | `true` | | `collectors.configmaps` | Enable the configmaps collector. | `true` | diff --git a/charts/kube-state-metrics/templates/pdb.yaml b/charts/kube-state-metrics/templates/pdb.yaml new file mode 100644 index 000000000000..6adb50d79f04 --- /dev/null +++ b/charts/kube-state-metrics/templates/pdb.yaml @@ -0,0 +1,17 @@ +{{- if .Values.podDisruptionBudget -}} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ template "kube-state-metrics.fullname" . }} + namespace: {{ template "kube-state-metrics.namespace" . }} + labels: + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} + helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + app.kubernetes.io/instance: "{{ .Release.Name }}" + app.kubernetes.io/managed-by: "{{ .Release.Service }}" +spec: + selector: + matchLabels: + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} +{{ toYaml .Values.podDisruptionBudget | indent 2 }} +{{- end -}} \ No newline at end of file diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index ebcebed57e15..11f20fa3ead6 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -86,6 +86,9 @@ podAnnotations: {} ## Assign a PriorityClassName to pods if set # priorityClassName: "" +# Ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/ +podDisruptionBudget: {} + # Available collectors for kube-state-metrics. By default all available # collectors are enabled. collectors: From 11f550de0851b77892609c821a6df99280b0d55d Mon Sep 17 00:00:00 2001 From: Tariq Ibrahim Date: Fri, 24 Apr 2020 09:22:07 -0700 Subject: [PATCH 071/111] [stable/kube-state-metrics] use the correct rbac values parameter (#22089) Signed-off-by: Tariq Ibrahim --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/psp-clusterrole.yaml | 2 +- charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index f22c26b42016..5003d1b8020c 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.8.2 +version: 2.8.3 appVersion: 1.9.5 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/psp-clusterrole.yaml b/charts/kube-state-metrics/templates/psp-clusterrole.yaml index a28fcef98f2b..0ba606e660ba 100644 --- a/charts/kube-state-metrics/templates/psp-clusterrole.yaml +++ b/charts/kube-state-metrics/templates/psp-clusterrole.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.podSecurityPolicy.enabled .Values.rbac.enabled -}} +{{- if and .Values.podSecurityPolicy.enabled .Values.rbac.create -}} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: diff --git a/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml b/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml index 16141b420cc9..feb97f22883e 100644 --- a/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml +++ b/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.podSecurityPolicy.enabled .Values.rbac.enabled -}} +{{- if and .Values.podSecurityPolicy.enabled .Values.rbac.create -}} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: From 0b0a997534617ca1f6c4ed28042ad75338b3f953 Mon Sep 17 00:00:00 2001 From: Karl-Philipp Richter Date: Fri, 24 Apr 2020 20:39:20 +0200 Subject: [PATCH 072/111] [stable/kube-state-metrics] Use apiGroup policy rather than extension for k8s > 1.15 in ClusterRole psp-kube-state-metrics (#21563) Signed-off-by: Karl-Philipp Richter --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/psp-clusterrole.yaml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 5003d1b8020c..96ce2fd447dc 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.8.3 +version: 2.8.4 appVersion: 1.9.5 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/psp-clusterrole.yaml b/charts/kube-state-metrics/templates/psp-clusterrole.yaml index 0ba606e660ba..217abc9504dd 100644 --- a/charts/kube-state-metrics/templates/psp-clusterrole.yaml +++ b/charts/kube-state-metrics/templates/psp-clusterrole.yaml @@ -9,7 +9,12 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} name: psp-{{ template "kube-state-metrics.fullname" . }} rules: +{{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }} +{{- if semverCompare "> 1.15.0-0" $kubeTargetVersion }} +- apiGroups: ['policy'] +{{- else }} - apiGroups: ['extensions'] +{{- end }} resources: ['podsecuritypolicies'] verbs: ['use'] resourceNames: From eb26206393a808bbd5b67f777b77feffe583dc76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Sat, 16 May 2020 01:47:53 +0200 Subject: [PATCH 073/111] [stable/kube-state-metrics] Version bump to 1.9.6 (#22420) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/kubernetes/kube-state-metrics/releases/v1.9.6 Signed-off-by: Manuel Rüger --- charts/kube-state-metrics/Chart.yaml | 4 ++-- charts/kube-state-metrics/README.md | 2 +- charts/kube-state-metrics/values.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 96ce2fd447dc..51798e0973a0 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,8 +6,8 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.8.4 -appVersion: 1.9.5 +version: 2.8.5 +appVersion: 1.9.6 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index c7d21dd51a45..50af25c016f6 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -15,7 +15,7 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |:---------------------------------------------|:--------------------------------------------------------------------------------------|:-------------------------------------------| | `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | -| `image.tag` | The image tag to pull from | `v1.9.5` | +| `image.tag` | The image tag to pull from | `v1.9.6` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `replicas` | Number of replicas | `1` | | `autosharding.enabled` | Set to `true` to automatically shard data across `replicas` pods. EXPERIMENTAL | `false` | diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 11f20fa3ead6..934d7f79b006 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -2,7 +2,7 @@ prometheusScrape: true image: repository: quay.io/coreos/kube-state-metrics - tag: v1.9.5 + tag: v1.9.6 pullPolicy: IfNotPresent # If set to true, this will deploy kube-state-metrics as a StatefulSet and the data From 98468bacc0ecbc806a6d8fe9c645694f705e9a9b Mon Sep 17 00:00:00 2001 From: Tariq Ibrahim Date: Sun, 24 May 2020 00:49:10 -0700 Subject: [PATCH 074/111] [stable/kube-state-metrics]disable VPA collectors by default (#22495) Signed-off-by: tariqibrahim --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 51798e0973a0..996ac6102549 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.8.5 +version: 2.8.6 appVersion: 1.9.6 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 934d7f79b006..fa21038880ec 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -118,7 +118,7 @@ collectors: statefulsets: true storageclasses: true validatingwebhookconfigurations: true - verticalpodautoscalers: true + verticalpodautoscalers: false volumeattachments: true # Namespace to be enabled for collecting resources. By default all namespaces are collected. From 842b45032800927975b6b03d6605fbaf6b072913 Mon Sep 17 00:00:00 2001 From: Karl-Philipp Richter Date: Sun, 24 May 2020 19:19:10 +0200 Subject: [PATCH 075/111] [stable/kube-state-metrics] Allow specification of additional volume types in podSecurityPolicy of kube-state-metrics (#22122) Signed-off-by: Karl-Philipp Richter --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 1 + charts/kube-state-metrics/templates/podsecuritypolicy.yaml | 3 +++ charts/kube-state-metrics/values.yaml | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 996ac6102549..bbc50d1cd0f5 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.8.6 +version: 2.8.7 appVersion: 1.9.6 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 50af25c016f6..9fb4f0ed4e37 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -30,6 +30,7 @@ $ helm install stable/kube-state-metrics | `serviceAccount.imagePullSecrets` | Specify image pull secrets field | `[]` | | `podSecurityPolicy.enabled` | If true, create & use PodSecurityPolicy resources. Note that related RBACs are created only if `rbac.enabled` is `true. | `false` | | `podSecurityPolicy.annotations` | Specify pod annotations in the pod security policy | {} | +| `podSecurityPolicy.additionalVolumes` | Specify allowed volumes in the pod security policy (`secret` is always allowed) | [] | | `securityContext.enabled` | Enable security context | `true` | | `securityContext.fsGroup` | Group ID for the container | `65534` | | `securityContext.runAsUser` | User ID for the container | `65534` | diff --git a/charts/kube-state-metrics/templates/podsecuritypolicy.yaml b/charts/kube-state-metrics/templates/podsecuritypolicy.yaml index aeff11791ce3..e822ba0e713e 100644 --- a/charts/kube-state-metrics/templates/podsecuritypolicy.yaml +++ b/charts/kube-state-metrics/templates/podsecuritypolicy.yaml @@ -16,6 +16,9 @@ spec: privileged: false volumes: - 'secret' +{{- if .Values.podSecurityPolicy.additionalVolumes }} +{{ toYaml .Values.podSecurityPolicy.additionalVolumes | indent 4 }} +{{- end }} hostNetwork: false hostIPC: false hostPID: false diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index fa21038880ec..2ab34d7c8a63 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -62,6 +62,7 @@ podSecurityPolicy: # seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default' # apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default' + additionalVolumes: [] securityContext: enabled: true From b4b91cee91e100ac98b075edc2e106c388741555 Mon Sep 17 00:00:00 2001 From: Steven Sheehy <17552371+steven-sheehy@users.noreply.github.com> Date: Tue, 2 Jun 2020 03:06:28 -0500 Subject: [PATCH 076/111] [stable/kube-state-metrics] Set runAsGroup (#22602) Signed-off-by: Steven Sheehy --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 3 ++- charts/kube-state-metrics/templates/deployment.yaml | 1 + charts/kube-state-metrics/values.yaml | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index bbc50d1cd0f5..310b23038ce0 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.8.7 +version: 2.8.8 appVersion: 1.9.6 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 9fb4f0ed4e37..c8133fc56c74 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -32,7 +32,8 @@ $ helm install stable/kube-state-metrics | `podSecurityPolicy.annotations` | Specify pod annotations in the pod security policy | {} | | `podSecurityPolicy.additionalVolumes` | Specify allowed volumes in the pod security policy (`secret` is always allowed) | [] | | `securityContext.enabled` | Enable security context | `true` | -| `securityContext.fsGroup` | Group ID for the container | `65534` | +| `securityContext.fsGroup` | Group ID for the filesystem | `65534` | +| `securityContext.runAsGroup` | Group ID for the container | `65534` | | `securityContext.runAsUser` | User ID for the container | `65534` | | `priorityClassName` | Name of Priority Class to assign pods | `nil` | | `nodeSelector` | Node labels for pod assignment | {} | diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index b6affcc202e6..4d90349ced68 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -42,6 +42,7 @@ spec: {{- if .Values.securityContext.enabled }} securityContext: fsGroup: {{ .Values.securityContext.fsGroup }} + runAsGroup: {{ .Values.securityContext.runAsGroup }} runAsUser: {{ .Values.securityContext.runAsUser }} {{- end }} {{- if .Values.priorityClassName }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 2ab34d7c8a63..75ddb9e46cdf 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -66,6 +66,7 @@ podSecurityPolicy: securityContext: enabled: true + runAsGroup: 65534 runAsUser: 65534 fsGroup: 65534 From 51336b8bd63c0ea87c312eea243b619686c6ac82 Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Fri, 12 Jun 2020 13:37:55 -0400 Subject: [PATCH 077/111] [stable/kube-state-metrics] Support imagePullSecrets (#22295) Signed-off-by: Dave Henderson --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 21 ++++++++++--------- .../templates/deployment.yaml | 4 ++++ charts/kube-state-metrics/values.yaml | 3 +++ 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 310b23038ce0..84727db95890 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.8.8 +version: 2.8.9 appVersion: 1.9.6 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index c8133fc56c74..01d015246687 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -14,9 +14,10 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |:---------------------------------------------|:--------------------------------------------------------------------------------------|:-------------------------------------------| -| `image.repository` | The image repository to pull from | quay.io/coreos/kube-state-metrics | +| `image.repository` | The image repository to pull from | `quay.io/coreos/kube-state-metrics` | | `image.tag` | The image tag to pull from | `v1.9.6` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `imagePullSecrets` | List of container registry secrets | `[]` | | `replicas` | Number of replicas | `1` | | `autosharding.enabled` | Set to `true` to automatically shard data across `replicas` pods. EXPERIMENTAL | `false` | | `service.port` | The port of the container | `8080` | @@ -28,20 +29,20 @@ $ helm install stable/kube-state-metrics | `serviceAccount.create` | If true, create & use serviceAccount | `true` | | `serviceAccount.name` | If not set & create is true, use template fullname | | | `serviceAccount.imagePullSecrets` | Specify image pull secrets field | `[]` | -| `podSecurityPolicy.enabled` | If true, create & use PodSecurityPolicy resources. Note that related RBACs are created only if `rbac.enabled` is `true. | `false` | -| `podSecurityPolicy.annotations` | Specify pod annotations in the pod security policy | {} | -| `podSecurityPolicy.additionalVolumes` | Specify allowed volumes in the pod security policy (`secret` is always allowed) | [] | +| `podSecurityPolicy.enabled` | If true, create & use PodSecurityPolicy resources. Note that related RBACs are created only if `rbac.enabled` is `true`. | `false` | +| `podSecurityPolicy.annotations` | Specify pod annotations in the pod security policy | `{}` | +| `podSecurityPolicy.additionalVolumes` | Specify allowed volumes in the pod security policy (`secret` is always allowed) | `[]` | | `securityContext.enabled` | Enable security context | `true` | | `securityContext.fsGroup` | Group ID for the filesystem | `65534` | | `securityContext.runAsGroup` | Group ID for the container | `65534` | | `securityContext.runAsUser` | User ID for the container | `65534` | | `priorityClassName` | Name of Priority Class to assign pods | `nil` | -| `nodeSelector` | Node labels for pod assignment | {} | -| `affinity` | Affinity settings for pod assignment | {} | -| `tolerations` | Tolerations for pod assignment | [] | -| `podAnnotations` | Annotations to be added to the pod | {} | -| `podDisruptionBudget` | Optional PodDisruptionBudget | {} | -| `resources` | kube-state-metrics resource requests and limits | {} | +| `nodeSelector` | Node labels for pod assignment | `{}` | +| `affinity` | Affinity settings for pod assignment | `{}` | +| `tolerations` | Tolerations for pod assignment | `[]` | +| `podAnnotations` | Annotations to be added to the pod | `{}` | +| `podDisruptionBudget` | Optional PodDisruptionBudget | `{}` | +| `resources` | kube-state-metrics resource requests and limits | `{}` | | `collectors.certificatesigningrequests` | Enable the certificatesigningrequests collector. | `true` | | `collectors.configmaps` | Enable the configmaps collector. | `true` | | `collectors.cronjobs` | Enable the cronjobs collector. | `true` | diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 4d90349ced68..99656046ce6f 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -173,6 +173,10 @@ spec: resources: {{ toYaml .Values.resources | indent 10 }} {{- end }} +{{- if .Values.imagePullSecrets }} + imagePullSecrets: +{{ toYaml .Values.imagePullSecrets | indent 8 }} +{{- end }} {{- if .Values.affinity }} affinity: {{ toYaml .Values.affinity | indent 8 }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 75ddb9e46cdf..5f547daf02a7 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -5,6 +5,9 @@ image: tag: v1.9.6 pullPolicy: IfNotPresent +imagePullSecrets: [] +# - name: "image-pull-secret" + # If set to true, this will deploy kube-state-metrics as a StatefulSet and the data # will be automatically sharded across <.Values.replicas> pods using the built-in # autodiscovery feature: https://github.com/kubernetes/kube-state-metrics#automated-sharding From 01d84a9af90fd90d584d0a96728ed2844ba672b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Tue, 16 Jun 2020 18:20:04 +0200 Subject: [PATCH 078/111] [stable/kube-state-metrics] Version bump to 1.9.7 (#22649) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/kubernetes/kube-state-metrics/releases/v1.9.7 Signed-off-by: Manuel Rüger --- charts/kube-state-metrics/Chart.yaml | 4 ++-- charts/kube-state-metrics/README.md | 2 +- charts/kube-state-metrics/values.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 84727db95890..cc2aefb0e0c4 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,8 +6,8 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.8.9 -appVersion: 1.9.6 +version: 2.8.10 +appVersion: 1.9.7 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 01d015246687..c37b521d744a 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -15,7 +15,7 @@ $ helm install stable/kube-state-metrics | Parameter | Description | Default | |:---------------------------------------------|:--------------------------------------------------------------------------------------|:-------------------------------------------| | `image.repository` | The image repository to pull from | `quay.io/coreos/kube-state-metrics` | -| `image.tag` | The image tag to pull from | `v1.9.6` | +| `image.tag` | The image tag to pull from | `v1.9.7` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `imagePullSecrets` | List of container registry secrets | `[]` | | `replicas` | Number of replicas | `1` | diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 5f547daf02a7..acf5fdb68d0a 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -2,7 +2,7 @@ prometheusScrape: true image: repository: quay.io/coreos/kube-state-metrics - tag: v1.9.6 + tag: v1.9.7 pullPolicy: IfNotPresent imagePullSecrets: [] From e15c48722dfc0dc3ccc832dc959134be95aa09c3 Mon Sep 17 00:00:00 2001 From: Denys Havrysh Date: Mon, 22 Jun 2020 17:58:41 +0300 Subject: [PATCH 079/111] [stable/kube-state-metrics] Document `kubeTargetVersionOverride` (#22792) Signed-off-by: Denys Havrysh --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 1 + charts/kube-state-metrics/values.yaml | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index cc2aefb0e0c4..63fd666894ac 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.8.10 +version: 2.8.11 appVersion: 1.9.7 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index c37b521d744a..7d5cee52596c 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -76,3 +76,4 @@ $ helm install stable/kube-state-metrics | `prometheus.monitor.namespace` | Namespace where servicemonitor resource should be created | `the same namespace as kube-state-metrics` | | `prometheus.monitor.honorLabels` | Honor metric labels | `false` | | `namespaceOverride` | Override the deployment namespace | `""` (`Release.Namespace`) | +| `kubeTargetVersionOverride` | Override the k8s version of the target cluster | `""` | diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index acf5fdb68d0a..11f48fb77cf5 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -132,3 +132,8 @@ collectors: ## Override the deployment namespace ## namespaceOverride: "" + +## Provide a k8s version to define apiGroups for podSecurityPolicy Cluster Role. +## For example: kubeTargetVersionOverride: 1.14.9 +## +kubeTargetVersionOverride: "" From 6973d6426a9662f8e1ae89300291ce5f54e7ff76 Mon Sep 17 00:00:00 2001 From: Mathis Date: Sat, 18 Jul 2020 01:04:50 +0200 Subject: [PATCH 080/111] [stable/kube-state-metrics] Fix STS role for Autosharding (#23210) Currently, Get, List and Watch are required. List and Watch are provided by the ClusterRole related to collectors. The STS collector can be disabled breaking the current AutoSharding role permissions. Moreover, the resourceNames depends of the RELEASE_NAME as defined in deployment.yaml so we need to reflect this or we won't have the correct permission to read our STS. Signed-off-by: Mathis Raguin --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/stsdiscovery-role.yaml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 63fd666894ac..6f41880ab5b5 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.8.11 +version: 2.8.12 appVersion: 1.9.7 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/stsdiscovery-role.yaml b/charts/kube-state-metrics/templates/stsdiscovery-role.yaml index bf5396072710..9770b0498752 100644 --- a/charts/kube-state-metrics/templates/stsdiscovery-role.yaml +++ b/charts/kube-state-metrics/templates/stsdiscovery-role.yaml @@ -19,9 +19,11 @@ rules: - apiGroups: - apps resourceNames: - - kube-state-metrics + - {{ template "kube-state-metrics.fullname" . }} resources: - statefulsets verbs: - get + - list + - watch {{- end }} From 31e5453b58f29f09f61f014fa96337183f035373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Mon, 20 Jul 2020 09:20:50 +0200 Subject: [PATCH 081/111] [stable/kube-state-metrics] added resource config to values.yaml (#22850) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * added resource config example as its mentioned in the readme Signed-off-by: André Bauer * added newline Signed-off-by: André Bauer * updated chart version Signed-off-by: André Bauer * removed blank line Signed-off-by: André Bauer * updated version Signed-off-by: André Bauer --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/values.yaml | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 6f41880ab5b5..0e9ebb2665e0 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.8.12 +version: 2.8.13 appVersion: 1.9.7 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 11f48fb77cf5..08d043562895 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -133,6 +133,18 @@ collectors: ## namespaceOverride: "" +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 64Mi + # requests: + # cpu: 10m + # memory: 32Mi + ## Provide a k8s version to define apiGroups for podSecurityPolicy Cluster Role. ## For example: kubeTargetVersionOverride: 1.14.9 ## From f27b903125db1b84b7fe2669424a318ba64ed68e Mon Sep 17 00:00:00 2001 From: Juan Pablo Jaramillo Pineda Date: Sun, 2 Aug 2020 05:31:40 -0500 Subject: [PATCH 082/111] [stable/kube-state-metrics] Add annotations for serviceAccount (#23411) Signed-off-by: Juan Pablo Jaramillo Pineda --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 1 + charts/kube-state-metrics/templates/serviceaccount.yaml | 4 ++++ charts/kube-state-metrics/values.yaml | 4 ++++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 0e9ebb2665e0..5554d87c3921 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.8.13 +version: 2.8.14 appVersion: 1.9.7 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 7d5cee52596c..8a27b554d4c7 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -29,6 +29,7 @@ $ helm install stable/kube-state-metrics | `serviceAccount.create` | If true, create & use serviceAccount | `true` | | `serviceAccount.name` | If not set & create is true, use template fullname | | | `serviceAccount.imagePullSecrets` | Specify image pull secrets field | `[]` | +| `serviceAccount.annotations` | Annotations to be added to the serviceAccount | `{}` | | `podSecurityPolicy.enabled` | If true, create & use PodSecurityPolicy resources. Note that related RBACs are created only if `rbac.enabled` is `true`. | `false` | | `podSecurityPolicy.annotations` | Specify pod annotations in the pod security policy | `{}` | | `podSecurityPolicy.additionalVolumes` | Specify allowed volumes in the pod security policy (`secret` is always allowed) | `[]` | diff --git a/charts/kube-state-metrics/templates/serviceaccount.yaml b/charts/kube-state-metrics/templates/serviceaccount.yaml index 32bb1640f2eb..2e8a1ee38f4d 100644 --- a/charts/kube-state-metrics/templates/serviceaccount.yaml +++ b/charts/kube-state-metrics/templates/serviceaccount.yaml @@ -9,6 +9,10 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} name: {{ template "kube-state-metrics.fullname" . }} namespace: {{ template "kube-state-metrics.namespace" . }} +{{- if .Values.serviceAccount.annotations }} + annotations: +{{ toYaml .Values.serviceAccount.annotations | indent 4 }} +{{- end }} imagePullSecrets: {{ toYaml .Values.serviceAccount.imagePullSecrets | indent 2 }} {{- end -}} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 08d043562895..92de8e22daa0 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -42,6 +42,10 @@ serviceAccount: # Reference to one or more secrets to be used when pulling images # ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ imagePullSecrets: [] + # ServiceAccount annotations. + # Use case: AWS EKS IAM roles for service accounts + # ref: https://docs.aws.amazon.com/eks/latest/userguide/specify-service-account-role.html + annotations: {} prometheus: monitor: From 1dbcf68d7150f18b7f46c50292c539ee200f4c74 Mon Sep 17 00:00:00 2001 From: Mike Ritter Date: Fri, 21 Aug 2020 11:05:40 -0500 Subject: [PATCH 083/111] [stable/kube-state-metrics] Add kubeconfig arg for kube-state-metrics (#23380) * Added kubeconfig arg and secret Signed-off-by: Mike Ritter * Updated secret name Signed-off-by: Mike Ritter * Updated secret name Signed-off-by: Mike Ritter * Removed trailing spaces Signed-off-by: Mike Ritter * Removed XXX as default secret Signed-off-by: Mike Ritter --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 2 ++ .../kube-state-metrics/templates/deployment.yaml | 15 +++++++++++++++ .../templates/kubeconfig-secret.yaml | 15 +++++++++++++++ charts/kube-state-metrics/values.yaml | 6 ++++++ 5 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 charts/kube-state-metrics/templates/kubeconfig-secret.yaml diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 5554d87c3921..dd57c575e1f4 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.8.14 +version: 2.9.1 appVersion: 1.9.7 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 8a27b554d4c7..d14186a8b340 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -78,3 +78,5 @@ $ helm install stable/kube-state-metrics | `prometheus.monitor.honorLabels` | Honor metric labels | `false` | | `namespaceOverride` | Override the deployment namespace | `""` (`Release.Namespace`) | | `kubeTargetVersionOverride` | Override the k8s version of the target cluster | `""` | +| `kubeconfig.enabled` | Adds --kubeconfig arg to container at startup | `""` | +| `kubeconfig.secret` | Base64 encoded kubeconfig file | `""` | diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 99656046ce6f..8f491ec5d712 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -153,6 +153,15 @@ spec: - --pod=$(POD_NAME) - --pod-namespace=$(POD_NAMESPACE) {{ end }} +{{ if .Values.kubeconfig.enabled }} + - --kubeconfig=/opt/k8s/.kube/config +{{ end }} +{{- if .Values.kubeconfig.enabled }} + volumeMounts: + - name: kubeconfig + mountPath: /opt/k8s/.kube/ + readOnly: true +{{- end }} imagePullPolicy: {{ .Values.image.pullPolicy }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" ports: @@ -189,3 +198,9 @@ spec: tolerations: {{ toYaml .Values.tolerations | indent 8 }} {{- end }} +{{- if .Values.kubeconfig.enabled}} + volumes: + - name: kubeconfig + secret: + secretName: {{ template "kube-state-metrics.fullname" . }}-kubeconfig +{{- end }} diff --git a/charts/kube-state-metrics/templates/kubeconfig-secret.yaml b/charts/kube-state-metrics/templates/kubeconfig-secret.yaml new file mode 100644 index 000000000000..a7800d7adb74 --- /dev/null +++ b/charts/kube-state-metrics/templates/kubeconfig-secret.yaml @@ -0,0 +1,15 @@ +{{- if .Values.kubeconfig.enabled -}} +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "kube-state-metrics.fullname" . }}-kubeconfig + namespace: {{ template "kube-state-metrics.namespace" . }} + labels: + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} + helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + app.kubernetes.io/instance: "{{ .Release.Name }}" + app.kubernetes.io/managed-by: "{{ .Release.Service }}" +type: Opaque +data: + config: '{{ .Values.kubeconfig.secret }}' +{{- end -}} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 92de8e22daa0..3edd4c8169f1 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -130,6 +130,12 @@ collectors: verticalpodautoscalers: false volumeattachments: true +# Enabling kubeconfig will pass the --kubeconfig argument to the container +kubeconfig: + enabled: false + # base64 encoded kube-config file + secret: + # Namespace to be enabled for collecting resources. By default all namespaces are collected. # namespace: "" From 46b3953a17e5cca48635b23b81f0e098ce002b13 Mon Sep 17 00:00:00 2001 From: Scott Rigby Date: Fri, 18 Sep 2020 15:28:43 -0400 Subject: [PATCH 084/111] Clean up chart README. To-do: remove Helm 2 command documentation after Nov 13 2020 Signed-off-by: Scott Rigby --- charts/kube-state-metrics/README.md | 130 ++++++++++++---------------- 1 file changed, 57 insertions(+), 73 deletions(-) diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index d14186a8b340..dc7b07a0ee97 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -1,82 +1,66 @@ # kube-state-metrics Helm Chart -* Installs the [kube-state-metrics agent](https://github.com/kubernetes/kube-state-metrics). +Installs the [kube-state-metrics agent](https://github.com/kubernetes/kube-state-metrics). -## Installing the Chart +## Get Repo Info -To install the chart with the release name `my-release`: +```console +helm repo add kube-state-metrics https://kubernetes.github.io/kube-state-metrics +helm repo update +``` + +_See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation._ + +## Install Chart + +```console +# Helm 3 +$ helm install [RELEASE_NAME] kube-state-metrics/kube-state-metrics [flags] +# Helm 2 + +$ helm install --name [RELEASE_NAME] kube-state-metrics/kube-state-metrics [flags] +``` + +_See [configuration](#configuration) below._ + +_See [helm install](https://helm.sh/docs/helm/helm_install/) for command documentation._ + +## Uninstall Chart + +```console +# Helm 3 +$ helm uninstall [RELEASE_NAME] + +# Helm 2 +# helm delete --purge [RELEASE_NAME] +``` + +This removes all the Kubernetes components associated with the chart and deletes the release. + +_See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._ -```bash -$ helm install stable/kube-state-metrics +## Upgrading Chart + +```console +# Helm 3 or 2 +$ helm upgrade [RELEASE_NAME] kube-state-metrics/kube-state-metrics [flags] ``` +_See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._ + +### From stable/kube-state-metrics + +You can upgrade in-place: + +1. [get repo info](#get-repo-info) +1. [upgrade](#upgrading-chart) your existing release name using the new chart repo + ## Configuration -| Parameter | Description | Default | -|:---------------------------------------------|:--------------------------------------------------------------------------------------|:-------------------------------------------| -| `image.repository` | The image repository to pull from | `quay.io/coreos/kube-state-metrics` | -| `image.tag` | The image tag to pull from | `v1.9.7` | -| `image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `imagePullSecrets` | List of container registry secrets | `[]` | -| `replicas` | Number of replicas | `1` | -| `autosharding.enabled` | Set to `true` to automatically shard data across `replicas` pods. EXPERIMENTAL | `false` | -| `service.port` | The port of the container | `8080` | -| `service.annotations` | Annotations to be added to the service | `{}` | -| `customLabels` | Custom labels to apply to service, deployment and pods | `{}` | -| `hostNetwork` | Whether or not to use the host network | `false` | -| `prometheusScrape` | Whether or not enable prom scrape | `true` | -| `rbac.create` | If true, create & use RBAC resources | `true` | -| `serviceAccount.create` | If true, create & use serviceAccount | `true` | -| `serviceAccount.name` | If not set & create is true, use template fullname | | -| `serviceAccount.imagePullSecrets` | Specify image pull secrets field | `[]` | -| `serviceAccount.annotations` | Annotations to be added to the serviceAccount | `{}` | -| `podSecurityPolicy.enabled` | If true, create & use PodSecurityPolicy resources. Note that related RBACs are created only if `rbac.enabled` is `true`. | `false` | -| `podSecurityPolicy.annotations` | Specify pod annotations in the pod security policy | `{}` | -| `podSecurityPolicy.additionalVolumes` | Specify allowed volumes in the pod security policy (`secret` is always allowed) | `[]` | -| `securityContext.enabled` | Enable security context | `true` | -| `securityContext.fsGroup` | Group ID for the filesystem | `65534` | -| `securityContext.runAsGroup` | Group ID for the container | `65534` | -| `securityContext.runAsUser` | User ID for the container | `65534` | -| `priorityClassName` | Name of Priority Class to assign pods | `nil` | -| `nodeSelector` | Node labels for pod assignment | `{}` | -| `affinity` | Affinity settings for pod assignment | `{}` | -| `tolerations` | Tolerations for pod assignment | `[]` | -| `podAnnotations` | Annotations to be added to the pod | `{}` | -| `podDisruptionBudget` | Optional PodDisruptionBudget | `{}` | -| `resources` | kube-state-metrics resource requests and limits | `{}` | -| `collectors.certificatesigningrequests` | Enable the certificatesigningrequests collector. | `true` | -| `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` | -| `collectors.endpoints` | Enable the endpoints collector. | `true` | -| `collectors.horizontalpodautoscalers` | Enable the horizontalpodautoscalers collector. | `true` | -| `collectors.ingresses` | Enable the ingresses collector. | `true` | -| `collectors.jobs` | Enable the jobs collector. | `true` | -| `collectors.limitranges` | Enable the limitranges collector. | `true` | -| `collectors.mutatingwebhookconfigurations` | Enable the mutatingwebhookconfigurations collector. | `true` | -| `collectors.namespaces` | Enable the namespaces collector. | `true` | -| `collectors.networkpolicies` | Enable the networkpolicies collector. | `true` | -| `collectors.nodes` | Enable the nodes collector. | `true` | -| `collectors.persistentvolumeclaims` | Enable the persistentvolumeclaims collector. | `true` | -| `collectors.persistentvolumes` | Enable the persistentvolumes collector. | `true` | -| `collectors.poddisruptionbudgets` | Enable the poddisruptionbudgets collector. | `true` | -| `collectors.pods` | Enable the pods collector. | `true` | -| `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` | -| `collectors.storageclasses` | Enable the storageclasses collector. | `true` | -| `collectors.validatingwebhookconfigurations` | Enable the validatingwebhookconfigurations collector. | `true` | -| `collectors.verticalpodautoscalers` | Enable the verticalpodautoscalers collector. | `true` | -| `collectors.volumeattachments` | Enable the volumeattachments collector. | `true` | -| `prometheus.monitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false` | -| `prometheus.monitor.additionalLabels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | `{}` | -| `prometheus.monitor.namespace` | Namespace where servicemonitor resource should be created | `the same namespace as kube-state-metrics` | -| `prometheus.monitor.honorLabels` | Honor metric labels | `false` | -| `namespaceOverride` | Override the deployment namespace | `""` (`Release.Namespace`) | -| `kubeTargetVersionOverride` | Override the k8s version of the target cluster | `""` | -| `kubeconfig.enabled` | Adds --kubeconfig arg to container at startup | `""` | -| `kubeconfig.secret` | Base64 encoded kubeconfig file | `""` | +See [Customizing the Chart Before Installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with detailed comments: + +```console +helm show values kube-state-metrics/kube-state-metrics +``` + +You may also `helm show values` on this chart's [dependencies](#dependencies) for additional options. From 8bd155173dabff4fbc2721ef7295615ebe89301c Mon Sep 17 00:00:00 2001 From: Scott Rigby Date: Fri, 18 Sep 2020 15:50:32 -0400 Subject: [PATCH 085/111] Bump chart PATCH version Signed-off-by: Scott Rigby --- charts/kube-state-metrics/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index dd57c575e1f4..c073d91eb2a5 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.9.1 +version: 2.9.2 appVersion: 1.9.7 home: https://github.com/kubernetes/kube-state-metrics/ sources: From 0e9f68ed59deeacf75d0b4c93b5e8bea1500ccde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Mon, 2 Nov 2020 01:34:52 +0100 Subject: [PATCH 086/111] [stable/kube-state-metrics] Update apiVersion for clusterrole (#23968) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Manuel Rüger Co-authored-by: Scott Rigby --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/clusterrole.yaml | 2 +- charts/kube-state-metrics/templates/clusterrolebinding.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index c073d91eb2a5..442aa4ec163d 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.9.2 +version: 2.9.3 appVersion: 1.9.7 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/clusterrole.yaml b/charts/kube-state-metrics/templates/clusterrole.yaml index 319aec16c203..a9198b823d6b 100644 --- a/charts/kube-state-metrics/templates/clusterrole.yaml +++ b/charts/kube-state-metrics/templates/clusterrole.yaml @@ -1,5 +1,5 @@ {{- if .Values.rbac.create -}} -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: labels: diff --git a/charts/kube-state-metrics/templates/clusterrolebinding.yaml b/charts/kube-state-metrics/templates/clusterrolebinding.yaml index 4635985aa0c7..160db8bd182f 100644 --- a/charts/kube-state-metrics/templates/clusterrolebinding.yaml +++ b/charts/kube-state-metrics/templates/clusterrolebinding.yaml @@ -1,5 +1,5 @@ {{- if .Values.rbac.create -}} -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: labels: From 834728424b5c5dc8f2a1e36bd032863a9e51a599 Mon Sep 17 00:00:00 2001 From: Scott Rigby Date: Tue, 24 Nov 2020 21:41:22 -0500 Subject: [PATCH 087/111] Retain license from helm/charts, where the previous commits were moved from. Chart commit history original source: https://github.com/helm/charts/tree/master/stable/kube-state-metrics For context about chart reloation, see "[stable] relocate charts to new repos" https://github.com/helm/charts/issues/21103 Signed-off-by: Scott Rigby --- charts/kube-state-metrics/LICENSE | 202 ++++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 charts/kube-state-metrics/LICENSE diff --git a/charts/kube-state-metrics/LICENSE b/charts/kube-state-metrics/LICENSE new file mode 100644 index 000000000000..393b7a33b5cf --- /dev/null +++ b/charts/kube-state-metrics/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright The Helm Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From 3752115c4cca8b77e4292a2ba40957bbb39037f2 Mon Sep 17 00:00:00 2001 From: Scott Rigby Date: Mon, 14 Dec 2020 15:34:12 -0500 Subject: [PATCH 088/111] Remove fiunchinho per these comments: - https://github.com/kubernetes/kube-state-metrics/pull/1237#issuecomment-742916389 - https://github.com/kubernetes/kube-state-metrics/pull/1237#issuecomment-743111282 Signed-off-by: Scott Rigby --- charts/kube-state-metrics/Chart.yaml | 2 -- charts/kube-state-metrics/OWNERS | 2 -- 2 files changed, 4 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 442aa4ec163d..e117fd1640bb 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -12,8 +12,6 @@ home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ maintainers: -- name: fiunchinho - email: jose@armesto.net - name: tariq1890 email: tariq.ibrahim@mulesoft.com - name: mrueg diff --git a/charts/kube-state-metrics/OWNERS b/charts/kube-state-metrics/OWNERS index 6ffd97d743f3..206b4fee754a 100644 --- a/charts/kube-state-metrics/OWNERS +++ b/charts/kube-state-metrics/OWNERS @@ -1,8 +1,6 @@ approvers: -- fiunchinho - tariq1890 - mrueg reviewers: -- fiunchinho - tariq1890 - mrueg From c71db6e6b71789fb8256b483fe740f7658afe517 Mon Sep 17 00:00:00 2001 From: Scott Rigby Date: Thu, 17 Dec 2020 09:41:54 -0500 Subject: [PATCH 089/111] Bump chart PATCH version Signed-off-by: Scott Rigby --- charts/kube-state-metrics/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index e117fd1640bb..dd26cd7c955a 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.9.3 +version: 2.9.4 appVersion: 1.9.7 home: https://github.com/kubernetes/kube-state-metrics/ sources: From b069953a9a18c2beea0ef7d00fe7fb477a97db70 Mon Sep 17 00:00:00 2001 From: Scott Rigby Date: Fri, 18 Dec 2020 08:40:32 -0500 Subject: [PATCH 090/111] Bump version to re-release chart after branch protection was removed Signed-off-by: Scott Rigby --- charts/kube-state-metrics/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index dd26cd7c955a..428bc95ce329 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.9.4 +version: 2.9.5 appVersion: 1.9.7 home: https://github.com/kubernetes/kube-state-metrics/ sources: From b6100589576bc1f3562b25b468d14277d9cccd89 Mon Sep 17 00:00:00 2001 From: Carlos Date: Tue, 5 Jan 2021 15:51:16 +0100 Subject: [PATCH 091/111] Added Helm Chart support for self monitor --- charts/kube-state-metrics/templates/deployment.yaml | 6 ++++++ charts/kube-state-metrics/templates/service.yaml | 6 ++++++ charts/kube-state-metrics/templates/servicemonitor.yaml | 6 ++++++ charts/kube-state-metrics/values.yaml | 7 +++++++ 4 files changed, 25 insertions(+) diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 8f491ec5d712..299c2a541042 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -156,6 +156,12 @@ spec: {{ if .Values.kubeconfig.enabled }} - --kubeconfig=/opt/k8s/.kube/config {{ end }} +{{ if .Values.selfMonitor.telemetryHost }} + - --telemetry-host={{ .Values.selfMonitor.telemetryHost }} +{{ end }} +{{ if .Values.selfMonitor.telemetryPort }} + - --telemetry-port={{ .Values.selfMonitor.telemetryPort }} +{{ end }} {{- if .Values.kubeconfig.enabled }} volumeMounts: - name: kubeconfig diff --git a/charts/kube-state-metrics/templates/service.yaml b/charts/kube-state-metrics/templates/service.yaml index 5dacf5217aae..4234e296d26c 100644 --- a/charts/kube-state-metrics/templates/service.yaml +++ b/charts/kube-state-metrics/templates/service.yaml @@ -28,6 +28,12 @@ spec: nodePort: {{ .Values.service.nodePort }} {{- end }} targetPort: 8080 + {{ if .Values.selfMonitor }} + - name: "metrics" + protocol: TCP + port: {{ .Values.selfMonitor.telemetryPort | default 8081 }} + targetPort: {{ .Values.selfMonitor.telemetryPort | default 8081 }} + {{ end }} {{- if .Values.service.loadBalancerIP }} loadBalancerIP: "{{ .Values.service.loadBalancerIP }}" {{- end }} diff --git a/charts/kube-state-metrics/templates/servicemonitor.yaml b/charts/kube-state-metrics/templates/servicemonitor.yaml index 54cde362d221..8e8b8ac3f8a4 100644 --- a/charts/kube-state-metrics/templates/servicemonitor.yaml +++ b/charts/kube-state-metrics/templates/servicemonitor.yaml @@ -22,4 +22,10 @@ spec: {{- if .Values.prometheus.monitor.honorLabels }} honorLabels: true {{- end }} + {{ if .Values.selfMonitor.enabled }} + - port: metrics + {{- if .Values.prometheus.monitor.honorLabels }} + honorLabels: true + {{- end }} + {{ end }} {{- end }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 3edd4c8169f1..5bc2ebea8830 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -159,3 +159,10 @@ resources: {} ## For example: kubeTargetVersionOverride: 1.14.9 ## kubeTargetVersionOverride: "" + +# Enable self metrics configuration for service and Service Monitor +# Default values for telemetry configuration can be overriden +selfMonitor: + enabled: false + # telemetryHost: 0.0.0.0 + # telemetryPort: 8081 From 96272c2a823845d8cff00df431b3af289ae45a5c Mon Sep 17 00:00:00 2001 From: Carlos Date: Tue, 5 Jan 2021 16:06:43 +0100 Subject: [PATCH 092/111] bumped Helm version --- charts/kube-state-metrics/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 428bc95ce329..79769fae07e2 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.9.5 +version: 2.9.6 appVersion: 1.9.7 home: https://github.com/kubernetes/kube-state-metrics/ sources: From d72e3badc0b049656009dd796feefd3e083a1a36 Mon Sep 17 00:00:00 2001 From: Carlos Date: Tue, 5 Jan 2021 21:26:31 +0100 Subject: [PATCH 093/111] Corrected var check --- charts/kube-state-metrics/templates/service.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/templates/service.yaml b/charts/kube-state-metrics/templates/service.yaml index 4234e296d26c..d0c1778259ca 100644 --- a/charts/kube-state-metrics/templates/service.yaml +++ b/charts/kube-state-metrics/templates/service.yaml @@ -28,7 +28,7 @@ spec: nodePort: {{ .Values.service.nodePort }} {{- end }} targetPort: 8080 - {{ if .Values.selfMonitor }} + {{ if .Values.selfMonitor.enabled }} - name: "metrics" protocol: TCP port: {{ .Values.selfMonitor.telemetryPort | default 8081 }} From e0e34aa4b33aedf9f323cffb85875f0a5a96b1f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Wed, 6 Jan 2021 13:39:51 +0100 Subject: [PATCH 094/111] charts: point out that the repo isn't set up yet See also: https://github.com/kubernetes/kube-state-metrics/issues/1342 --- charts/kube-state-metrics/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index dc7b07a0ee97..1997bd9c3abb 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -2,6 +2,13 @@ Installs the [kube-state-metrics agent](https://github.com/kubernetes/kube-state-metrics). +## Warning + +**The integration is still work in progress. As of now, the mentioned repositories below are not fully set up yet. +You can still use the deprecated [helm/stable](https://charts.helm.sh/stable/) repository and migrate at a later point to the new location. +At this point in time, no significant changes to the chart were made in this repository. +For more information, please see: https://github.com/kubernetes/kube-state-metrics/pull/1325#issuecomment-749732052** + ## Get Repo Info ```console From b32f9b64f88983692d9637d3ce0a1e48075275df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Wed, 6 Jan 2021 14:04:24 +0100 Subject: [PATCH 095/111] Update charts/kube-state-metrics/README.md Co-authored-by: Scott Rigby --- charts/kube-state-metrics/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index 1997bd9c3abb..eb50832c05e3 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -2,12 +2,13 @@ Installs the [kube-state-metrics agent](https://github.com/kubernetes/kube-state-metrics). -## Warning +## ⚠️ Warning -**The integration is still work in progress. As of now, the mentioned repositories below are not fully set up yet. -You can still use the deprecated [helm/stable](https://charts.helm.sh/stable/) repository and migrate at a later point to the new location. +**Chart Releasing workflow is currently broken due to an upstream issue with this repo and `kubernetes/test-infra`, which is actively being worked on.** +Until then, the mentioned repositories below are not fully set up yet. +You can still use the deprecated [helm/stable](https://charts.helm.sh/stable/) repository and migrate to the new location in the near future. At this point in time, no significant changes to the chart were made in this repository. -For more information, please see: https://github.com/kubernetes/kube-state-metrics/pull/1325#issuecomment-749732052** +For more information or to follow progress, see: https://github.com/kubernetes/kube-state-metrics/pull/1325#issuecomment-749732052 ## Get Repo Info From 3a023e91258b4cd448beaec819791e949146bfea Mon Sep 17 00:00:00 2001 From: Scott Rigby Date: Sun, 10 Jan 2021 15:58:42 -0500 Subject: [PATCH 096/111] Release chart to gh-pages Unblocked by https://github.com/kubernetes/test-infra/pull/20426 Fixes: https://github.com/kubernetes/kube-state-metrics/issues/1342 Reverts https://github.com/kubernetes/kube-state-metrics/pull/1345 Unblocks https://github.com/kubernetes/kube-state-metrics/pull/1325 See https://github.com/kubernetes/kube-state-metrics/pull/1325#issuecomment-749732052 Signed-off-by: Scott Rigby --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/README.md | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 79769fae07e2..99ed93a9e3ed 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.9.6 +version: 2.9.7 appVersion: 1.9.7 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index eb50832c05e3..dc7b07a0ee97 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -2,14 +2,6 @@ Installs the [kube-state-metrics agent](https://github.com/kubernetes/kube-state-metrics). -## ⚠️ Warning - -**Chart Releasing workflow is currently broken due to an upstream issue with this repo and `kubernetes/test-infra`, which is actively being worked on.** -Until then, the mentioned repositories below are not fully set up yet. -You can still use the deprecated [helm/stable](https://charts.helm.sh/stable/) repository and migrate to the new location in the near future. -At this point in time, no significant changes to the chart were made in this repository. -For more information or to follow progress, see: https://github.com/kubernetes/kube-state-metrics/pull/1325#issuecomment-749732052 - ## Get Repo Info ```console From 2b23b0245cb5c6713a944d0cccb1cf3eccffdd3e Mon Sep 17 00:00:00 2001 From: Carlos Date: Mon, 11 Jan 2021 18:53:29 +0100 Subject: [PATCH 097/111] bumped chart version --- charts/kube-state-metrics/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 99ed93a9e3ed..c3c77edab207 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.9.7 +version: 2.9.8 appVersion: 1.9.7 home: https://github.com/kubernetes/kube-state-metrics/ sources: From fd5c7505825503f21f25a330b784095d49f52dd9 Mon Sep 17 00:00:00 2001 From: Shan Mahanama Date: Mon, 18 Jan 2021 15:38:23 +0800 Subject: [PATCH 098/111] Fix spacing issue --- charts/kube-state-metrics/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/README.md b/charts/kube-state-metrics/README.md index dc7b07a0ee97..e93a3d252459 100644 --- a/charts/kube-state-metrics/README.md +++ b/charts/kube-state-metrics/README.md @@ -16,8 +16,8 @@ _See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation ```console # Helm 3 $ helm install [RELEASE_NAME] kube-state-metrics/kube-state-metrics [flags] -# Helm 2 +# Helm 2 $ helm install --name [RELEASE_NAME] kube-state-metrics/kube-state-metrics [flags] ``` From cb62fbd320ab2516b25949ef71e26fa342637ec1 Mon Sep 17 00:00:00 2001 From: Shan Mahanama Date: Thu, 21 Jan 2021 11:40:33 +0800 Subject: [PATCH 099/111] Bump chart version From ab3b9da85f67d3937697a39cebcd3ef80bf08f16 Mon Sep 17 00:00:00 2001 From: Klavs Klavsen Date: Tue, 26 Jan 2021 08:51:19 +0100 Subject: [PATCH 100/111] Add useExistingRole and useClusterrole options - allowing installation in specific namespaces only when user has no access to entire cluster (like in typical OpenShift environments). Signed-off-by: Klavs Klavsen --- charts/kube-state-metrics/Chart.yaml | 2 +- .../templates/clusterrolebinding.yaml | 6 +- .../templates/{clusterrole.yaml => role.yaml} | 80 +++++++++++-------- .../templates/rolebinding.yaml | 27 +++++++ charts/kube-state-metrics/values.yaml | 6 ++ 5 files changed, 85 insertions(+), 36 deletions(-) rename charts/kube-state-metrics/templates/{clusterrole.yaml => role.yaml} (61%) create mode 100644 charts/kube-state-metrics/templates/rolebinding.yaml diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index c3c77edab207..bb0ace1ec5ff 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.9.8 +version: 2.10.0 appVersion: 1.9.7 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/clusterrolebinding.yaml b/charts/kube-state-metrics/templates/clusterrolebinding.yaml index 160db8bd182f..af158c512eec 100644 --- a/charts/kube-state-metrics/templates/clusterrolebinding.yaml +++ b/charts/kube-state-metrics/templates/clusterrolebinding.yaml @@ -1,4 +1,4 @@ -{{- if .Values.rbac.create -}} +{{- if and .Values.rbac.create .Values.rbac.useClusterRole -}} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -11,7 +11,11 @@ metadata: roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole +{{- if .Values.rbac.useExistingRole }} + name: {{ .Values.rbac.useExistingRole }} +{{- else }} name: {{ template "kube-state-metrics.fullname" . }} +{{- end }} subjects: - kind: ServiceAccount name: {{ template "kube-state-metrics.fullname" . }} diff --git a/charts/kube-state-metrics/templates/clusterrole.yaml b/charts/kube-state-metrics/templates/role.yaml similarity index 61% rename from charts/kube-state-metrics/templates/clusterrole.yaml rename to charts/kube-state-metrics/templates/role.yaml index a9198b823d6b..f1c2b79681d7 100644 --- a/charts/kube-state-metrics/templates/clusterrole.yaml +++ b/charts/kube-state-metrics/templates/role.yaml @@ -1,180 +1,192 @@ -{{- if .Values.rbac.create -}} +{{- if and (eq $.Values.rbac.create true) (not .Values.rbac.useExistingRole) -}} +{{- if eq .Values.rbac.useClusterRole false }} +{{- range (split "," $.Values.namespace) }} +{{- end }} +--- apiVersion: rbac.authorization.k8s.io/v1 +{{- if eq .Values.rbac.useClusterRole false }} +kind: Role +{{- else }} kind: ClusterRole +{{- end }} metadata: labels: - app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Release.Name }} - name: {{ template "kube-state-metrics.fullname" . }} + app.kubernetes.io/name: {{ template "kube-state-metrics.name" $ }} + helm.sh/chart: {{ $.Chart.Name }}-{{ $.Chart.Version }} + app.kubernetes.io/managed-by: {{ $.Release.Service }} + app.kubernetes.io/instance: {{ $.Release.Name }} + name: {{ template "kube-state-metrics.fullname" $ }} +{{- if eq .Values.rbac.useClusterRole false }} + namespace: {{ . }} +{{- end }} rules: -{{ if .Values.collectors.certificatesigningrequests }} +{{ if $.Values.collectors.certificatesigningrequests }} - apiGroups: ["certificates.k8s.io"] resources: - certificatesigningrequests verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.configmaps }} +{{ if $.Values.collectors.configmaps }} - apiGroups: [""] resources: - configmaps verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.cronjobs }} +{{ if $.Values.collectors.cronjobs }} - apiGroups: ["batch"] resources: - cronjobs verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.daemonsets }} +{{ if $.Values.collectors.daemonsets }} - apiGroups: ["extensions", "apps"] resources: - daemonsets verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.deployments }} +{{ if $.Values.collectors.deployments }} - apiGroups: ["extensions", "apps"] resources: - deployments verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.endpoints }} +{{ if $.Values.collectors.endpoints }} - apiGroups: [""] resources: - endpoints verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.horizontalpodautoscalers }} +{{ if $.Values.collectors.horizontalpodautoscalers }} - apiGroups: ["autoscaling"] resources: - horizontalpodautoscalers verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.ingresses }} +{{ if $.Values.collectors.ingresses }} - apiGroups: ["extensions", "networking.k8s.io"] resources: - ingresses verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.jobs }} +{{ if $.Values.collectors.jobs }} - apiGroups: ["batch"] resources: - jobs verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.limitranges }} +{{ if $.Values.collectors.limitranges }} - apiGroups: [""] resources: - limitranges verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.mutatingwebhookconfigurations }} +{{ if $.Values.collectors.mutatingwebhookconfigurations }} - apiGroups: ["admissionregistration.k8s.io"] resources: - mutatingwebhookconfigurations verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.namespaces }} +{{ if $.Values.collectors.namespaces }} - apiGroups: [""] resources: - namespaces verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.networkpolicies }} +{{ if $.Values.collectors.networkpolicies }} - apiGroups: ["networking.k8s.io"] resources: - networkpolicies verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.nodes }} +{{ if $.Values.collectors.nodes }} - apiGroups: [""] resources: - nodes verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.persistentvolumeclaims }} +{{ if $.Values.collectors.persistentvolumeclaims }} - apiGroups: [""] resources: - persistentvolumeclaims verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.persistentvolumes }} +{{ if $.Values.collectors.persistentvolumes }} - apiGroups: [""] resources: - persistentvolumes verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.poddisruptionbudgets }} +{{ if $.Values.collectors.poddisruptionbudgets }} - apiGroups: ["policy"] resources: - poddisruptionbudgets verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.pods }} +{{ if $.Values.collectors.pods }} - apiGroups: [""] resources: - pods verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.replicasets }} +{{ if $.Values.collectors.replicasets }} - apiGroups: ["extensions", "apps"] resources: - replicasets verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.replicationcontrollers }} +{{ if $.Values.collectors.replicationcontrollers }} - apiGroups: [""] resources: - replicationcontrollers verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.resourcequotas }} +{{ if $.Values.collectors.resourcequotas }} - apiGroups: [""] resources: - resourcequotas verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.secrets }} +{{ if $.Values.collectors.secrets }} - apiGroups: [""] resources: - secrets verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.services }} +{{ if $.Values.collectors.services }} - apiGroups: [""] resources: - services verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.statefulsets }} +{{ if $.Values.collectors.statefulsets }} - apiGroups: ["apps"] resources: - statefulsets verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.storageclasses }} +{{ if $.Values.collectors.storageclasses }} - apiGroups: ["storage.k8s.io"] resources: - storageclasses verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.validatingwebhookconfigurations }} +{{ if $.Values.collectors.validatingwebhookconfigurations }} - apiGroups: ["admissionregistration.k8s.io"] resources: - validatingwebhookconfigurations verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.volumeattachments }} +{{ if $.Values.collectors.volumeattachments }} - apiGroups: ["storage.k8s.io"] resources: - volumeattachments verbs: ["list", "watch"] {{ end -}} -{{ if .Values.collectors.verticalpodautoscalers }} +{{ if $.Values.collectors.verticalpodautoscalers }} - apiGroups: ["autoscaling.k8s.io"] resources: - verticalpodautoscalers verbs: ["list", "watch"] {{ end -}} {{- end -}} +{{- end -}} diff --git a/charts/kube-state-metrics/templates/rolebinding.yaml b/charts/kube-state-metrics/templates/rolebinding.yaml new file mode 100644 index 000000000000..89bb41b091e5 --- /dev/null +++ b/charts/kube-state-metrics/templates/rolebinding.yaml @@ -0,0 +1,27 @@ +{{- if and (eq .Values.rbac.create true) (eq .Values.rbac.useClusterRole false) -}} +{{- range (split "," $.Values.namespace) }} +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: RoleBinding +metadata: + labels: + app.kubernetes.io/name: {{ template "kube-state-metrics.name" $ }} + helm.sh/chart: {{ $.Chart.Name }}-{{ $.Chart.Version }} + app.kubernetes.io/managed-by: {{ $.Release.Service }} + app.kubernetes.io/instance: {{ $.Release.Name }} + name: {{ template "kube-state-metrics.fullname" $ }} + namespace: {{ . }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role +{{- if (not $.Values.rbac.useExistingRole) }} + name: {{ template "kube-state-metrics.fullname" $ }} +{{- else }} + name: {{ $.Values.rbac.useExistingRole }} +{{- end }} +subjects: +- kind: ServiceAccount + name: {{ template "kube-state-metrics.fullname" $ }} + namespace: {{ template "kube-state-metrics.namespace" $ }} +{{- end -}} +{{- end -}} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 5bc2ebea8830..66972fca7d3f 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -33,6 +33,12 @@ rbac: # If true, create & use RBAC resources create: true + # Set to a rolename to use existing role - skipping role creating - but still doing serviceaccount and rolebinding to it, rolename set here. + # useExistingRole: your-existing-role + + # If set to false - Run without Cluteradmin privs needed - ONLY works if namespace is also set (if useExistingRole is set this name is used as ClusterRole or Role to bind to) + useClusterRole: true + serviceAccount: # Specifies whether a ServiceAccount should be created, require rbac true create: true From f534903ed3ff3565f16c970bccb99f1335edb897 Mon Sep 17 00:00:00 2001 From: Carlos Date: Tue, 26 Jan 2021 15:18:21 +0100 Subject: [PATCH 101/111] Hardcoded telemetry internal port and bumped version --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/deployment.yaml | 4 +--- charts/kube-state-metrics/templates/service.yaml | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index bb0ace1ec5ff..d626941ba565 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.10.0 +version: 2.10.1 appVersion: 1.9.7 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 299c2a541042..d77e8b0eb21a 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -159,9 +159,7 @@ spec: {{ if .Values.selfMonitor.telemetryHost }} - --telemetry-host={{ .Values.selfMonitor.telemetryHost }} {{ end }} -{{ if .Values.selfMonitor.telemetryPort }} - - --telemetry-port={{ .Values.selfMonitor.telemetryPort }} -{{ end }} + - --telemetry-port=8081 {{- if .Values.kubeconfig.enabled }} volumeMounts: - name: kubeconfig diff --git a/charts/kube-state-metrics/templates/service.yaml b/charts/kube-state-metrics/templates/service.yaml index d0c1778259ca..4f8e4a497270 100644 --- a/charts/kube-state-metrics/templates/service.yaml +++ b/charts/kube-state-metrics/templates/service.yaml @@ -32,7 +32,7 @@ spec: - name: "metrics" protocol: TCP port: {{ .Values.selfMonitor.telemetryPort | default 8081 }} - targetPort: {{ .Values.selfMonitor.telemetryPort | default 8081 }} + targetPort: 8081 {{ end }} {{- if .Values.service.loadBalancerIP }} loadBalancerIP: "{{ .Values.service.loadBalancerIP }}" From 803672b227dcfa46e6e6776445b64b11129faedf Mon Sep 17 00:00:00 2001 From: lou-lan Date: Wed, 27 Jan 2021 15:28:30 +0800 Subject: [PATCH 102/111] Fix create role --- charts/kube-state-metrics/templates/role.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/templates/role.yaml b/charts/kube-state-metrics/templates/role.yaml index f1c2b79681d7..6259d2f61758 100644 --- a/charts/kube-state-metrics/templates/role.yaml +++ b/charts/kube-state-metrics/templates/role.yaml @@ -2,6 +2,7 @@ {{- if eq .Values.rbac.useClusterRole false }} {{- range (split "," $.Values.namespace) }} {{- end }} +{{- end -}} --- apiVersion: rbac.authorization.k8s.io/v1 {{- if eq .Values.rbac.useClusterRole false }} @@ -189,4 +190,3 @@ rules: verbs: ["list", "watch"] {{ end -}} {{- end -}} -{{- end -}} From f52f2cb9546ea4d3b12a16b5a815df38b5ab5232 Mon Sep 17 00:00:00 2001 From: Yashvardhan Kukreja Date: Sat, 23 Jan 2021 07:19:14 +0530 Subject: [PATCH 103/111] added: support for providing extraArgs to ksm --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/deployment.yaml | 5 +++++ charts/kube-state-metrics/values.yaml | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index d626941ba565..15a7a484c2af 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.10.1 +version: 2.11.0 appVersion: 1.9.7 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index d77e8b0eb21a..130fa5476d22 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -62,6 +62,11 @@ spec: fieldPath: metadata.namespace {{- end }} args: +{{ if .Values.extraArgs }} + {{- range .Values.extraArgs }} + - {{ . }} + {{- end }} +{{ end }} {{ if .Values.collectors.certificatesigningrequests }} - --collectors=certificatesigningrequests {{ end }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 66972fca7d3f..4f8a498eb613 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -17,6 +17,11 @@ autosharding: replicas: 1 +# List of additional cli arguments to configure kube-state-metrics +# for example: --enable-gzip-encoding, --log-file, etc. +# all the possible args can be found here: https://github.com/kubernetes/kube-state-metrics/blob/master/docs/cli-arguments.md +extraArgs: [] + service: port: 8080 # Default to clusterIP for backward compatibility From f43e17aa14ab4aea40198c296cfeb8e6ea3db314 Mon Sep 17 00:00:00 2001 From: costimuraru Date: Wed, 3 Feb 2021 11:19:19 +0200 Subject: [PATCH 104/111] allow for namespace flag to be passed as a list Signed-off-by: costimuraru --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 15a7a484c2af..508d23fa437e 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.11.0 +version: 2.12.1 appVersion: 1.9.7 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 130fa5476d22..e33f5f6ba7b6 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -152,7 +152,7 @@ spec: - --collectors=volumeattachments {{ end }} {{ if .Values.namespace }} - - --namespace={{ .Values.namespace }} + - --namespace={{ .Values.namespace | join "," }} {{ end }} {{ if .Values.autosharding.enabled }} - --pod=$(POD_NAME) From 166329e721c6fefdfa6c910d2346ea3a944be019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Thu, 11 Feb 2021 15:48:17 +0100 Subject: [PATCH 105/111] chart: Add custom labels to pdb and servicemonitor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Manuel Rüger --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/pdb.yaml | 5 ++++- charts/kube-state-metrics/templates/servicemonitor.yaml | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 508d23fa437e..0898861f44d0 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.12.1 +version: 2.12.2 appVersion: 1.9.7 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/pdb.yaml b/charts/kube-state-metrics/templates/pdb.yaml index 6adb50d79f04..d3ef8104e33b 100644 --- a/charts/kube-state-metrics/templates/pdb.yaml +++ b/charts/kube-state-metrics/templates/pdb.yaml @@ -9,9 +9,12 @@ metadata: helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" +{{- if .Values.customLabels }} +{{ toYaml .Values.customLabels | indent 4 }} +{{- end }} spec: selector: matchLabels: app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} {{ toYaml .Values.podDisruptionBudget | indent 2 }} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/charts/kube-state-metrics/templates/servicemonitor.yaml b/charts/kube-state-metrics/templates/servicemonitor.yaml index 8e8b8ac3f8a4..7d1cd7aa1b1f 100644 --- a/charts/kube-state-metrics/templates/servicemonitor.yaml +++ b/charts/kube-state-metrics/templates/servicemonitor.yaml @@ -12,6 +12,9 @@ metadata: {{- if .Values.prometheus.monitor.additionalLabels }} {{ toYaml .Values.prometheus.monitor.additionalLabels | indent 4 }} {{- end }} +{{- if .Values.customLabels }} +{{ toYaml .Values.customLabels | indent 4 }} +{{- end }} spec: selector: matchLabels: From 7caa39666aecac8b396cd7297f5640eda8ba23a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Thu, 11 Feb 2021 15:51:42 +0100 Subject: [PATCH 106/111] chart: Add AppVersion to labels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Manuel Rüger --- charts/kube-state-metrics/templates/deployment.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index e33f5f6ba7b6..5f6b644573a0 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -12,6 +12,7 @@ metadata: helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" + app.kubernetes.io/version: "{{ .Chart.AppVersion }}" {{- if .Values.customLabels }} {{ toYaml .Values.customLabels | indent 4 }} {{- end }} From 4342975c282b5a0d4686d62cf74352994408c861 Mon Sep 17 00:00:00 2001 From: Sam Weston Date: Tue, 23 Feb 2021 09:36:28 +0000 Subject: [PATCH 107/111] chart: Upgrade to multi-arch v1.9.8 image --- charts/kube-state-metrics/Chart.yaml | 4 ++-- charts/kube-state-metrics/values.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 0898861f44d0..0219b66f068b 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,8 +6,8 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.12.2 -appVersion: 1.9.7 +version: 2.13.0 +appVersion: 1.9.8 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 4f8a498eb613..9522cfe0c44f 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -1,8 +1,8 @@ # Default values for kube-state-metrics. prometheusScrape: true image: - repository: quay.io/coreos/kube-state-metrics - tag: v1.9.7 + repository: k8s.gcr.io/kube-state-metrics/kube-state-metrics + tag: v1.9.8 pullPolicy: IfNotPresent imagePullSecrets: [] From 7f47bf1152104bab1929bc12ea9acc70695250aa Mon Sep 17 00:00:00 2001 From: David Eads Date: Thu, 25 Mar 2021 10:20:50 -0400 Subject: [PATCH 108/111] update RBAC manifests to v1 --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/rolebinding.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 0219b66f068b..1c71d5be6555 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.13.0 +version: 2.13.1 appVersion: 1.9.8 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/rolebinding.yaml b/charts/kube-state-metrics/templates/rolebinding.yaml index 89bb41b091e5..732174a33404 100644 --- a/charts/kube-state-metrics/templates/rolebinding.yaml +++ b/charts/kube-state-metrics/templates/rolebinding.yaml @@ -1,7 +1,7 @@ {{- if and (eq .Values.rbac.create true) (eq .Values.rbac.useClusterRole false) -}} {{- range (split "," $.Values.namespace) }} --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: labels: From df6eb22f606da9419cc1628ad1547f2e525dd11f Mon Sep 17 00:00:00 2001 From: Eduardo Alves Date: Wed, 7 Apr 2021 17:36:41 +0200 Subject: [PATCH 109/111] Fix role.yaml for helm2 compatibility --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/role.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 1c71d5be6555..3a141c18ac20 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.13.1 +version: 2.13.2 appVersion: 1.9.8 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/role.yaml b/charts/kube-state-metrics/templates/role.yaml index 6259d2f61758..c493f1675382 100644 --- a/charts/kube-state-metrics/templates/role.yaml +++ b/charts/kube-state-metrics/templates/role.yaml @@ -1,4 +1,4 @@ -{{- if and (eq $.Values.rbac.create true) (not .Values.rbac.useExistingRole) -}} +{{- if and (eq $.Values.rbac.create true) (not .Values.rbac.useExistingRole) -}} {{- if eq .Values.rbac.useClusterRole false }} {{- range (split "," $.Values.namespace) }} {{- end }} From c8f5a4ceea4b1f195dca474170f03753bd8c7bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Fri, 16 Apr 2021 00:49:38 +0200 Subject: [PATCH 110/111] [kube-state-metrics] Fix CI issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Manuel Rüger --- .github/CODEOWNERS | 1 + charts/kube-state-metrics/values.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ea75285fa9e1..d55165bbe7ee 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -8,6 +8,7 @@ /charts/alertmanager/ @monotek @naseemkullah /charts/kube-prometheus-stack/ @bismarck @gianrubio @gkarthiks @scottrigby @vsliouniaev @Xtigyro +/charts/kube-state-metrics/ @mrueg @tariq1890 /charts/prometheus/ @gianrubio @monotek @naseemkullah @Xtigyro @zanhsieh /charts/prometheus-adapter/ @hectorj2f @mattiasgees @steven-sheehy /charts/prometheus-blackbox-exporter/ @desaintmartin @gianrubio @monotek @rsotnychenko diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 9522cfe0c44f..aaf97bd79471 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -172,7 +172,7 @@ resources: {} kubeTargetVersionOverride: "" # Enable self metrics configuration for service and Service Monitor -# Default values for telemetry configuration can be overriden +# Default values for telemetry configuration can be overridden selfMonitor: enabled: false # telemetryHost: 0.0.0.0 From c06c4e16dd873f7d9b93d3d70e7c6eaedd7dad9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Sun, 25 Apr 2021 18:21:44 +0200 Subject: [PATCH 111/111] [kube-state-metrics] Remove license MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is the same as in the main repository Signed-off-by: Manuel Rüger --- charts/kube-state-metrics/LICENSE | 202 ------------------------------ 1 file changed, 202 deletions(-) delete mode 100644 charts/kube-state-metrics/LICENSE diff --git a/charts/kube-state-metrics/LICENSE b/charts/kube-state-metrics/LICENSE deleted file mode 100644 index 393b7a33b5cf..000000000000 --- a/charts/kube-state-metrics/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright The Helm Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License.