diff --git a/helm/exporter-node/Chart.yaml b/helm/exporter-node/Chart.yaml index 71a68d823..7ff6e5851 100755 --- a/helm/exporter-node/Chart.yaml +++ b/helm/exporter-node/Chart.yaml @@ -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 @@ -12,4 +12,4 @@ sources: keywords: - node-exporter - monitoring -- prometheus \ No newline at end of file +- prometheus diff --git a/helm/exporter-node/templates/daemonset.yaml b/helm/exporter-node/templates/daemonset.yaml index 52d536a6f..86a55447d 100755 --- a/helm/exporter-node/templates/daemonset.yaml +++ b/helm/exporter-node/templates/daemonset.yaml @@ -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 }} diff --git a/helm/exporter-node/templates/endpoints.yaml b/helm/exporter-node/templates/endpoints.yaml new file mode 100644 index 000000000..07b6464a1 --- /dev/null +++ b/helm/exporter-node/templates/endpoints.yaml @@ -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 }} diff --git a/helm/exporter-node/templates/psp-clusterrole.yaml b/helm/exporter-node/templates/psp-clusterrole.yaml index b1bef87fd..05e2053ea 100644 --- a/helm/exporter-node/templates/psp-clusterrole.yaml +++ b/helm/exporter-node/templates/psp-clusterrole.yaml @@ -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 }} diff --git a/helm/exporter-node/templates/psp-clusterrolebinding.yaml b/helm/exporter-node/templates/psp-clusterrolebinding.yaml index 647589907..6136d7d7c 100644 --- a/helm/exporter-node/templates/psp-clusterrolebinding.yaml +++ b/helm/exporter-node/templates/psp-clusterrolebinding.yaml @@ -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 }} diff --git a/helm/exporter-node/templates/psp.yaml b/helm/exporter-node/templates/psp.yaml index c2b6be351..1824d8604 100644 --- a/helm/exporter-node/templates/psp.yaml +++ b/helm/exporter-node/templates/psp.yaml @@ -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 }} diff --git a/helm/exporter-node/templates/service.yaml b/helm/exporter-node/templates/service.yaml index 232e9969a..8d59c6e69 100755 --- a/helm/exporter-node/templates/service.yaml +++ b/helm/exporter-node/templates/service.yaml @@ -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 }} diff --git a/helm/exporter-node/templates/serviceaccount.yaml b/helm/exporter-node/templates/serviceaccount.yaml index 7661949fa..7ee2249ff 100755 --- a/helm/exporter-node/templates/serviceaccount.yaml +++ b/helm/exporter-node/templates/serviceaccount.yaml @@ -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 }} diff --git a/helm/exporter-node/values.yaml b/helm/exporter-node/values.yaml index 59369454f..242f6f5f7 100755 --- a/helm/exporter-node/values.yaml +++ b/helm/exporter-node/values.yaml @@ -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 diff --git a/helm/kube-prometheus/Chart.yaml b/helm/kube-prometheus/Chart.yaml index 7ea270e2e..0b904f429 100644 --- a/helm/kube-prometheus/Chart.yaml +++ b/helm/kube-prometheus/Chart.yaml @@ -7,4 +7,4 @@ maintainers: name: kube-prometheus sources: - https://github.com/coreos/prometheus-operator -version: 0.0.92 +version: 0.0.93 diff --git a/helm/kube-prometheus/requirements.yaml b/helm/kube-prometheus/requirements.yaml index d7ba9a5ab..1ed9741a0 100644 --- a/helm/kube-prometheus/requirements.yaml +++ b/helm/kube-prometheus/requirements.yaml @@ -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