forked from prometheus-community/helm-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request prometheus-community#854 from mrueg/migrate-ksm
[kube-state-metrics] New helm chart
- Loading branch information
Showing
22 changed files
with
1,067 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: v1 | ||
name: kube-state-metrics | ||
description: Install kube-state-metrics to generate and expose cluster-level metrics | ||
keywords: | ||
- metric | ||
- monitoring | ||
- prometheus | ||
- kubernetes | ||
version: 2.13.2 | ||
appVersion: 1.9.8 | ||
home: https://github.com/kubernetes/kube-state-metrics/ | ||
sources: | ||
- https://github.com/kubernetes/kube-state-metrics/ | ||
maintainers: | ||
- name: tariq1890 | ||
email: tariq.ibrahim@mulesoft.com | ||
- name: mrueg | ||
email: manuel@rueg.eu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
approvers: | ||
- tariq1890 | ||
- mrueg | ||
reviewers: | ||
- tariq1890 | ||
- mrueg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# kube-state-metrics Helm Chart | ||
|
||
Installs the [kube-state-metrics agent](https://github.com/kubernetes/kube-state-metrics). | ||
|
||
## Get Repo Info | ||
|
||
```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._ | ||
|
||
## 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 | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
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/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" . }}.{{ 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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- 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). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "kube-state-metrics.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- 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 -}} | ||
|
||
{{/* | ||
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 -}} |
23 changes: 23 additions & 0 deletions
23
charts/kube-state-metrics/templates/clusterrolebinding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{{- if and .Values.rbac.create .Values.rbac.useClusterRole -}} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
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" . }} | ||
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" . }} | ||
namespace: {{ template "kube-state-metrics.namespace" . }} | ||
{{- end -}} |
Oops, something went wrong.