Skip to content

Commit

Permalink
Merge pull request #1343 from ctolon22/master
Browse files Browse the repository at this point in the history
Added Helm Chart support for self monitor
  • Loading branch information
k8s-ci-robot authored Feb 1, 2021
2 parents 2446bf1 + 2629e01 commit 238e80e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/kube-state-metrics/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords:
- monitoring
- prometheus
- kubernetes
version: 2.11.0
version: 2.12.0
appVersion: 1.9.7
home: https://github.com/kubernetes/kube-state-metrics/
sources:
Expand Down
4 changes: 4 additions & 0 deletions charts/kube-state-metrics/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ spec:
{{ if .Values.kubeconfig.enabled }}
- --kubeconfig=/opt/k8s/.kube/config
{{ end }}
{{ if .Values.selfMonitor.telemetryHost }}
- --telemetry-host={{ .Values.selfMonitor.telemetryHost }}
{{ end }}
- --telemetry-port=8081
{{- if .Values.kubeconfig.enabled }}
volumeMounts:
- name: kubeconfig
Expand Down
6 changes: 6 additions & 0 deletions charts/kube-state-metrics/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ spec:
nodePort: {{ .Values.service.nodePort }}
{{- end }}
targetPort: 8080
{{ if .Values.selfMonitor.enabled }}
- name: "metrics"
protocol: TCP
port: {{ .Values.selfMonitor.telemetryPort | default 8081 }}
targetPort: 8081
{{ end }}
{{- if .Values.service.loadBalancerIP }}
loadBalancerIP: "{{ .Values.service.loadBalancerIP }}"
{{- end }}
Expand Down
6 changes: 6 additions & 0 deletions charts/kube-state-metrics/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
7 changes: 7 additions & 0 deletions charts/kube-state-metrics/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,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

0 comments on commit 238e80e

Please sign in to comment.