Skip to content

Commit 08906de

Browse files
feat: vendor expanded archives
1 parent 1196468 commit 08906de

File tree

222 files changed

+61783
-145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

222 files changed

+61783
-145
lines changed
-14.2 KB
Binary file not shown.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
annotations:
2+
artifacthub.io/license: Apache-2.0
3+
artifacthub.io/links: |
4+
- name: Chart Source
5+
url: https://github.com/prometheus-community/helm-charts
6+
apiVersion: v2
7+
appVersion: 2.15.0
8+
description: Install kube-state-metrics to generate and expose cluster-level metrics
9+
home: https://github.com/kubernetes/kube-state-metrics/
10+
keywords:
11+
- metric
12+
- monitoring
13+
- prometheus
14+
- kubernetes
15+
maintainers:
16+
17+
name: tariq1890
18+
url: https://github.com/tariq1890
19+
20+
name: mrueg
21+
url: https://github.com/mrueg
22+
23+
name: dotdc
24+
url: https://github.com/dotdc
25+
name: kube-state-metrics
26+
sources:
27+
- https://github.com/kubernetes/kube-state-metrics/
28+
type: application
29+
version: 5.30.1
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# kube-state-metrics Helm Chart
2+
3+
Installs the [kube-state-metrics agent](https://github.com/kubernetes/kube-state-metrics).
4+
5+
## Get Repository Info
6+
<!-- textlint-disable -->
7+
```console
8+
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
9+
helm repo update
10+
```
11+
12+
_See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation._
13+
<!-- textlint-enable -->
14+
15+
## Install Chart
16+
17+
```console
18+
helm install [RELEASE_NAME] prometheus-community/kube-state-metrics [flags]
19+
```
20+
21+
_See [configuration](#configuration) below._
22+
23+
_See [helm install](https://helm.sh/docs/helm/helm_install/) for command documentation._
24+
25+
## Uninstall Chart
26+
27+
```console
28+
helm uninstall [RELEASE_NAME]
29+
```
30+
31+
This removes all the Kubernetes components associated with the chart and deletes the release.
32+
33+
_See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._
34+
35+
## Upgrading Chart
36+
37+
```console
38+
helm upgrade [RELEASE_NAME] prometheus-community/kube-state-metrics [flags]
39+
```
40+
41+
_See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._
42+
43+
### Migrating from stable/kube-state-metrics and kubernetes/kube-state-metrics
44+
45+
You can upgrade in-place:
46+
47+
1. [get repository info](#get-repository-info)
48+
1. [upgrade](#upgrading-chart) your existing release name using the new chart repository
49+
50+
## Upgrading to v3.0.0
51+
52+
v3.0.0 includes kube-state-metrics v2.0, see the [changelog](https://github.com/kubernetes/kube-state-metrics/blob/release-2.0/CHANGELOG.md) for major changes on the application-side.
53+
54+
The upgraded chart now the following changes:
55+
56+
* Dropped support for helm v2 (helm v3 or later is required)
57+
* collectors key was renamed to resources
58+
* namespace key was renamed to namespaces
59+
60+
## Configuration
61+
62+
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:
63+
64+
```console
65+
helm show values prometheus-community/kube-state-metrics
66+
```
67+
68+
### kube-rbac-proxy
69+
70+
You can enable `kube-state-metrics` endpoint protection using `kube-rbac-proxy`. By setting `kubeRBACProxy.enabled: true`, this chart will deploy one RBAC proxy container per endpoint (metrics & telemetry).
71+
To authorize access, authenticate your requests (via a `ServiceAccount` for example) with a `ClusterRole` attached such as:
72+
73+
```yaml
74+
apiVersion: rbac.authorization.k8s.io/v1
75+
kind: ClusterRole
76+
metadata:
77+
name: kube-state-metrics-read
78+
rules:
79+
- apiGroups: [ "" ]
80+
resources: ["services/kube-state-metrics"]
81+
verbs:
82+
- get
83+
```
84+
85+
See [kube-rbac-proxy examples](https://github.com/brancz/kube-rbac-proxy/tree/master/examples/resource-attributes) for more details.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
kube-state-metrics is a simple service that listens to the Kubernetes API server and generates metrics about the state of the objects.
2+
The exposed metrics can be found here:
3+
https://github.com/kubernetes/kube-state-metrics/blob/master/docs/README.md#exposed-metrics
4+
5+
The metrics are exported on the HTTP endpoint /metrics on the listening port.
6+
In your case, {{ template "kube-state-metrics.fullname" . }}.{{ template "kube-state-metrics.namespace" . }}.svc.cluster.local:{{ .Values.service.port }}/metrics
7+
8+
They are served either as plaintext or protobuf depending on the Accept header.
9+
They are designed to be consumed either by Prometheus itself or by a scraper that is compatible with scraping a Prometheus client endpoint.
10+
11+
{{- if .Values.kubeRBACProxy.enabled}}
12+
13+
kube-rbac-proxy endpoint protections is enabled:
14+
- Metrics endpoints are now HTTPS
15+
- Ensure that the client authenticates the requests (e.g. via service account) with the following role permissions:
16+
```
17+
rules:
18+
- apiGroups: [ "" ]
19+
resources: ["services/{{ template "kube-state-metrics.fullname" . }}"]
20+
verbs:
21+
- get
22+
```
23+
{{- end }}
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "kube-state-metrics.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
If release name contains chart name it will be used as a full name.
13+
*/}}
14+
{{- define "kube-state-metrics.fullname" -}}
15+
{{- if .Values.fullnameOverride -}}
16+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
17+
{{- else -}}
18+
{{- $name := default .Chart.Name .Values.nameOverride -}}
19+
{{- if contains $name .Release.Name -}}
20+
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
21+
{{- else -}}
22+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
23+
{{- end -}}
24+
{{- end -}}
25+
{{- end -}}
26+
27+
{{/*
28+
Create the name of the service account to use
29+
*/}}
30+
{{- define "kube-state-metrics.serviceAccountName" -}}
31+
{{- if .Values.serviceAccount.create -}}
32+
{{ default (include "kube-state-metrics.fullname" .) .Values.serviceAccount.name }}
33+
{{- else -}}
34+
{{ default "default" .Values.serviceAccount.name }}
35+
{{- end -}}
36+
{{- end -}}
37+
38+
{{/*
39+
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
40+
*/}}
41+
{{- define "kube-state-metrics.namespace" -}}
42+
{{- if .Values.namespaceOverride -}}
43+
{{- .Values.namespaceOverride -}}
44+
{{- else -}}
45+
{{- .Release.Namespace -}}
46+
{{- end -}}
47+
{{- end -}}
48+
49+
{{/*
50+
Create chart name and version as used by the chart label.
51+
*/}}
52+
{{- define "kube-state-metrics.chart" -}}
53+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
54+
{{- end -}}
55+
56+
{{/*
57+
Generate basic labels
58+
*/}}
59+
{{- define "kube-state-metrics.labels" }}
60+
helm.sh/chart: {{ template "kube-state-metrics.chart" . }}
61+
app.kubernetes.io/managed-by: {{ .Release.Service }}
62+
app.kubernetes.io/component: metrics
63+
app.kubernetes.io/part-of: {{ template "kube-state-metrics.name" . }}
64+
{{- include "kube-state-metrics.selectorLabels" . }}
65+
{{- if .Chart.AppVersion }}
66+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
67+
{{- end }}
68+
{{- if .Values.customLabels }}
69+
{{ tpl (toYaml .Values.customLabels) . }}
70+
{{- end }}
71+
{{- if .Values.releaseLabel }}
72+
release: {{ .Release.Name }}
73+
{{- end }}
74+
{{- end }}
75+
76+
{{/*
77+
Selector labels
78+
*/}}
79+
{{- define "kube-state-metrics.selectorLabels" }}
80+
{{- if .Values.selectorOverride }}
81+
{{ toYaml .Values.selectorOverride }}
82+
{{- else }}
83+
app.kubernetes.io/name: {{ include "kube-state-metrics.name" . }}
84+
app.kubernetes.io/instance: {{ .Release.Name }}
85+
{{- end }}
86+
{{- end }}
87+
88+
{{/* Sets default scrape limits for servicemonitor */}}
89+
{{- define "servicemonitor.scrapeLimits" -}}
90+
{{- with .sampleLimit }}
91+
sampleLimit: {{ . }}
92+
{{- end }}
93+
{{- with .targetLimit }}
94+
targetLimit: {{ . }}
95+
{{- end }}
96+
{{- with .labelLimit }}
97+
labelLimit: {{ . }}
98+
{{- end }}
99+
{{- with .labelNameLengthLimit }}
100+
labelNameLengthLimit: {{ . }}
101+
{{- end }}
102+
{{- with .labelValueLengthLimit }}
103+
labelValueLengthLimit: {{ . }}
104+
{{- end }}
105+
{{- end -}}
106+
107+
{{/*
108+
Formats imagePullSecrets. Input is (dict "Values" .Values "imagePullSecrets" .{specific imagePullSecrets})
109+
*/}}
110+
{{- define "kube-state-metrics.imagePullSecrets" -}}
111+
{{- range (concat .Values.global.imagePullSecrets .imagePullSecrets) }}
112+
{{- if eq (typeOf .) "map[string]interface {}" }}
113+
- {{ toYaml . | trim }}
114+
{{- else }}
115+
- name: {{ . }}
116+
{{- end }}
117+
{{- end }}
118+
{{- end -}}
119+
120+
{{/*
121+
The image to use for kube-state-metrics
122+
*/}}
123+
{{- define "kube-state-metrics.image" -}}
124+
{{- if .Values.image.sha }}
125+
{{- if .Values.global.imageRegistry }}
126+
{{- printf "%s/%s:%s@%s" .Values.global.imageRegistry .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) .Values.image.sha }}
127+
{{- else }}
128+
{{- printf "%s/%s:%s@%s" .Values.image.registry .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) .Values.image.sha }}
129+
{{- end }}
130+
{{- else }}
131+
{{- if .Values.global.imageRegistry }}
132+
{{- printf "%s/%s:%s" .Values.global.imageRegistry .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) }}
133+
{{- else }}
134+
{{- printf "%s/%s:%s" .Values.image.registry .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) }}
135+
{{- end }}
136+
{{- end }}
137+
{{- end }}
138+
139+
{{/*
140+
The image to use for kubeRBACProxy
141+
*/}}
142+
{{- define "kubeRBACProxy.image" -}}
143+
{{- if .Values.kubeRBACProxy.image.sha }}
144+
{{- if .Values.global.imageRegistry }}
145+
{{- printf "%s/%s:%s@%s" .Values.global.imageRegistry .Values.kubeRBACProxy.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.kubeRBACProxy.image.tag) .Values.kubeRBACProxy.image.sha }}
146+
{{- else }}
147+
{{- printf "%s/%s:%s@%s" .Values.kubeRBACProxy.image.registry .Values.kubeRBACProxy.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.kubeRBACProxy.image.tag) .Values.kubeRBACProxy.image.sha }}
148+
{{- end }}
149+
{{- else }}
150+
{{- if .Values.global.imageRegistry }}
151+
{{- printf "%s/%s:%s" .Values.global.imageRegistry .Values.kubeRBACProxy.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.kubeRBACProxy.image.tag) }}
152+
{{- else }}
153+
{{- printf "%s/%s:%s" .Values.kubeRBACProxy.image.registry .Values.kubeRBACProxy.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.kubeRBACProxy.image.tag) }}
154+
{{- end }}
155+
{{- end }}
156+
{{- end }}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{{- if and .Values.networkPolicy.enabled (eq .Values.networkPolicy.flavor "cilium") }}
2+
apiVersion: cilium.io/v2
3+
kind: CiliumNetworkPolicy
4+
metadata:
5+
{{- if .Values.annotations }}
6+
annotations:
7+
{{ toYaml .Values.annotations | nindent 4 }}
8+
{{- end }}
9+
labels:
10+
{{- include "kube-state-metrics.labels" . | indent 4 }}
11+
name: {{ template "kube-state-metrics.fullname" . }}
12+
namespace: {{ template "kube-state-metrics.namespace" . }}
13+
spec:
14+
endpointSelector:
15+
matchLabels:
16+
{{- include "kube-state-metrics.selectorLabels" . | indent 6 }}
17+
egress:
18+
{{- if and .Values.networkPolicy.cilium .Values.networkPolicy.cilium.kubeApiServerSelector }}
19+
{{ toYaml .Values.networkPolicy.cilium.kubeApiServerSelector | nindent 6 }}
20+
{{- else }}
21+
- toEntities:
22+
- kube-apiserver
23+
{{- end }}
24+
ingress:
25+
- toPorts:
26+
- ports:
27+
- port: {{ .Values.service.port | quote }}
28+
protocol: TCP
29+
{{- if .Values.selfMonitor.enabled }}
30+
- port: {{ .Values.selfMonitor.telemetryPort | default 8081 | quote }}
31+
protocol: TCP
32+
{{ end }}
33+
{{ end }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{{- if and .Values.rbac.create .Values.rbac.useClusterRole -}}
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRoleBinding
4+
metadata:
5+
labels:
6+
{{- include "kube-state-metrics.labels" . | indent 4 }}
7+
name: {{ template "kube-state-metrics.fullname" . }}
8+
roleRef:
9+
apiGroup: rbac.authorization.k8s.io
10+
kind: ClusterRole
11+
{{- if .Values.rbac.useExistingRole }}
12+
name: {{ .Values.rbac.useExistingRole }}
13+
{{- else }}
14+
name: {{ template "kube-state-metrics.fullname" . }}
15+
{{- end }}
16+
subjects:
17+
- kind: ServiceAccount
18+
name: {{ template "kube-state-metrics.serviceAccountName" . }}
19+
namespace: {{ template "kube-state-metrics.namespace" . }}
20+
{{- end -}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{- if .Values.customResourceState.enabled}}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: {{ template "kube-state-metrics.fullname" . }}-customresourcestate-config
6+
namespace: {{ template "kube-state-metrics.namespace" . }}
7+
labels:
8+
{{- include "kube-state-metrics.labels" . | indent 4 }}
9+
{{- if .Values.annotations }}
10+
annotations:
11+
{{ toYaml .Values.annotations | nindent 4 }}
12+
{{- end }}
13+
data:
14+
config.yaml: |
15+
{{- toYaml .Values.customResourceState.config | nindent 4 }}
16+
{{- end }}

0 commit comments

Comments
 (0)