From 334d459fe571d0875a2c866e126e232a9bf30164 Mon Sep 17 00:00:00 2001 From: Yong Wen Chua Date: Mon, 13 Jan 2020 18:59:36 +0800 Subject: [PATCH] [stable/prometheus] Add Telemetry port to Kube-state-metrics (#20072) * [stable/prometheus] Add Telemetry port to Kube-state-metrics Signed-off-by: Yong Wen Chua * Bump kubestatemetrics to 1.9.1 Fixes SegFault with HPA Signed-off-by: Yong Wen Chua * Add Values for Service Signed-off-by: Yong Wen Chua --- stable/prometheus/Chart.yaml | 2 +- stable/prometheus/README.md | 3 ++- .../prometheus/templates/kube-state-metrics-deployment.yaml | 2 ++ stable/prometheus/templates/kube-state-metrics-svc.yaml | 4 ++++ stable/prometheus/values.yaml | 4 +++- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/stable/prometheus/Chart.yaml b/stable/prometheus/Chart.yaml index 5d99418bbf..ff44e13149 100644 --- a/stable/prometheus/Chart.yaml +++ b/stable/prometheus/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: prometheus -version: 10.1.0 +version: 10.2.0 appVersion: 2.15.2 description: Prometheus is a monitoring system and time series database. home: https://prometheus.io/ diff --git a/stable/prometheus/README.md b/stable/prometheus/README.md index 04dc5d19bd..127d458ec4 100644 --- a/stable/prometheus/README.md +++ b/stable/prometheus/README.md @@ -115,7 +115,7 @@ spec: You should adjust `prometheus.io/path` based on the URL that your pod serves metrics from. `prometheus.io/port` should be set to the port that your pod serves metrics from. -Note that the values for `prometheus.io/scrape` and `prometheus.io/port` must be +Note that the values for `prometheus.io/scrape` and `prometheus.io/port` must be enclosed in double quotes. ## Configuration @@ -216,6 +216,7 @@ Parameter | Description | Default `kubeStateMetrics.service.loadBalancerIP` | IP address to assign to load balancer (if supported) | `""` `kubeStateMetrics.service.loadBalancerSourceRanges` | list of IP CIDRs allowed access to load balancer (if supported) | `[]` `kubeStateMetrics.service.servicePort` | kube-state-metrics service port | `80` +`kubeStateMetrics.service.serviceTelemetryPort` | kube-state-metrics service port for self Telemetry | `81` `kubeStateMetrics.service.type` | type of kube-state-metrics service to create | `ClusterIP` `nodeExporter.enabled` | If true, create node-exporter | `true` `nodeExporter.name` | node-exporter container name | `node-exporter` diff --git a/stable/prometheus/templates/kube-state-metrics-deployment.yaml b/stable/prometheus/templates/kube-state-metrics-deployment.yaml index eaeda969c2..0c1f5d52c5 100644 --- a/stable/prometheus/templates/kube-state-metrics-deployment.yaml +++ b/stable/prometheus/templates/kube-state-metrics-deployment.yaml @@ -43,6 +43,8 @@ spec: ports: - name: metrics containerPort: 8080 + - name: telemetry + containerPort: 8081 resources: {{ toYaml .Values.kubeStateMetrics.resources | indent 12 }} {{- if .Values.imagePullSecrets }} diff --git a/stable/prometheus/templates/kube-state-metrics-svc.yaml b/stable/prometheus/templates/kube-state-metrics-svc.yaml index 717d85fedb..705771b774 100644 --- a/stable/prometheus/templates/kube-state-metrics-svc.yaml +++ b/stable/prometheus/templates/kube-state-metrics-svc.yaml @@ -34,6 +34,10 @@ spec: port: {{ .Values.kubeStateMetrics.service.servicePort }} protocol: TCP targetPort: 8080 + - name: telemetry + port: {{ .Values.kubeStateMetrics.service.serviceTelemetryPort }} + protocol: TCP + targetPort: 8081 selector: {{- include "prometheus.kubeStateMetrics.matchLabels" . | nindent 4 }} type: "{{ .Values.kubeStateMetrics.service.type }}" diff --git a/stable/prometheus/values.yaml b/stable/prometheus/values.yaml index 89ba20734a..3ed0fd5b19 100644 --- a/stable/prometheus/values.yaml +++ b/stable/prometheus/values.yaml @@ -353,7 +353,7 @@ kubeStateMetrics: ## image: repository: quay.io/coreos/kube-state-metrics - tag: v1.9.0 + tag: v1.9.1 pullPolicy: IfNotPresent ## kube-state-metrics priorityClassName @@ -442,6 +442,8 @@ kubeStateMetrics: loadBalancerIP: "" loadBalancerSourceRanges: [] servicePort: 80 + # Port for Kubestatemetric self telemetry + serviceTelemetryPort: 81 type: ClusterIP nodeExporter: