1
0
mirror of https://github.com/coreos/prometheus-operator.git synced 2026-02-05 15:46:31 +01:00

Helm: Support 'external' node_exporters (#1560)

Similar to how `exporter-kube-etcd` supports monitoring of etcd clusters
running outside the Kubernetes cluster, this patch permits to configure
`exporter-node` to *not* deploy `node_exporter` as a `DaemonSet` in the
cluster, and instead fetch metrics from pre-provisioned `node_exporter`
instances, e.g. deployed as part of the host OS.
This commit is contained in:
Nicolas Trangez
2018-07-06 09:43:23 +02:00
committed by Giancarlo Rubio
parent 3f143e2da0
commit 970f99fe97
11 changed files with 52 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
apiVersion: v1
description: A Helm chart for Kubernetes node exporter
name: exporter-node
version: 0.3.3
version: 0.4.1
maintainers:
- name: Giancarlo Rubio
email: gianrubio@gmail.com

View File

@@ -1,3 +1,4 @@
{{- if .Values.enableDaemonSet }}
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
@@ -48,3 +49,4 @@ spec:
volumes:
{{ toYaml .Values.container.volumes | indent 6 }}
{{- end}}
{{- end }}

View File

@@ -0,0 +1,21 @@
{{- if .Values.endpoints }}
apiVersion: v1
kind: Endpoints
metadata:
labels:
app: {{ template "exporter-node.name" . }}
component: node-exporter
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
name: {{ template "exporter-node.fullname" . }}
subsets:
- addresses:
{{- range .Values.endpoints }}
- ip: {{ . }}
{{- end }}
ports:
- name: metrics
port: {{ .Values.nodeExporterPort }}
protocol: TCP
{{- end }}

View File

@@ -1,3 +1,4 @@
{{- if .Values.enableDaemonSet }}
{{- if .Values.global.rbacEnable }}
{{- if .Values.global.pspEnable }}
kind: ClusterRole
@@ -21,3 +22,4 @@ rules:
- {{ template "exporter-node.fullname" . }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -1,3 +1,4 @@
{{- if .Values.enableDaemonSet }}
{{- if .Values.global.rbacEnable }}
{{- if .Values.global.pspEnable }}
{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }}
@@ -23,3 +24,4 @@ subjects:
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -1,3 +1,4 @@
{{- if .Values.enableDaemonSet }}
{{- if .Values.global.pspEnable }}
apiVersion: extensions/v1beta1
kind: PodSecurityPolicy
@@ -51,3 +52,4 @@ spec:
max: 65535
readOnlyRootFilesystem: false
{{- end }}
{{- end }}

View File

@@ -9,6 +9,7 @@ metadata:
release: {{ .Release.Name }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
spec:
{{- if .Values.enableDaemonSet }}
type: {{ .Values.service.type }}
ports:
- name: metrics
@@ -19,3 +20,12 @@ spec:
app: {{ template "exporter-node.fullname" . }}
component: node-exporter
release: {{ .Release.Name }}
{{- else }}
type: ClusterIP
clusterIP: None
ports:
- name: metrics
port: {{ .Values.service.externalPort }}
protocol: TCP
targetPort: metrics
{{- end }}

View File

@@ -1,3 +1,4 @@
{{- if .Values.enableDaemonSet }}
{{- if .Values.global.rbacEnable }}
apiVersion: v1
kind: ServiceAccount
@@ -11,3 +12,4 @@ metadata:
imagePullSecrets:
{{ toYaml .Values.global.imagePullSecrets | indent 2 }}
{{- end }}
{{- end }}

View File

@@ -65,3 +65,10 @@ additionalServiceMonitorLabels: {}
##Custom Labels to be added to Prometheus Rules ConfigMap
##
additionalRulesConfigMapLabels: {}
# deploy node_exporter as a DaemonSet
enableDaemonSet: true
# for deployments that have node_exporter deployed outside of the cluster, list
# their addresses here
endpoints: []
nodeExporterPort: 9100

View File

@@ -7,4 +7,4 @@ maintainers:
name: kube-prometheus
sources:
- https://github.com/coreos/prometheus-operator
version: 0.0.92
version: 0.0.93

View File

@@ -58,7 +58,7 @@ dependencies:
repository: https://s3-eu-west-1.amazonaws.com/coreos-charts/stable/
- name: exporter-node
version: 0.3.3
version: 0.4.1
#e2e-repository: file://../exporter-node
repository: https://s3-eu-west-1.amazonaws.com/coreos-charts/stable/
condition: deployExporterNode