Node-Exporter: Override default image entrypoint

This updates the node-exporter chart to provide the mechanism
for overriding the default image's entrypoint, which brings it in
line with the other charts

Change-Id: Ia8f6a306a6f72d7dba37e5c5736e0f5a11ad1bf0
This commit is contained in:
Steve Wilkerson 2018-06-13 11:31:05 -05:00
parent 01d196e761
commit c5b0b6a8bf
3 changed files with 38 additions and 6 deletions

View File

@ -0,0 +1,26 @@
#!/bin/sh
{{/*
Copyright 2017 The Openstack-Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
set -ex
exec /bin/node_exporter \
--collector.ntp \
--collector.ntp.server={{ .Values.conf.ntp_server_ip }} \
--collector.meminfo_numa \
--collector.bonding \
--collector.mountstats
--logtostderr

View File

@ -22,6 +22,8 @@ kind: ConfigMap
metadata:
name: node-exporter-bin
data:
node-exporter.sh: |
{{ tuple "bin/_node-exporter.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
image-repo-sync.sh: |
{{- include "helm-toolkit.scripts.image_repo_sync" . | indent 4 }}
{{- end }}

View File

@ -57,12 +57,8 @@ spec:
- name: node-exporter
{{ tuple $envAll "node_exporter" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.node_exporter | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
args:
- --collector.ntp
- --collector.ntp.server={{ .Values.conf.ntp_server_ip }}
- --collector.meminfo_numa
- --collector.bonding
- --collector.mountstats
command:
- /tmp/node-exporter.sh
ports:
- name: metrics
containerPort: {{ tuple "node_metrics" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
@ -74,6 +70,10 @@ spec:
- name: sys
mountPath: /host/sys
readOnly: true
- name: node-exporter-bin
mountPath: /tmp/node-exporter.sh
subPath: node-exporter.sh
readOnly: true
volumes:
- name: proc
hostPath:
@ -81,4 +81,8 @@ spec:
- name: sys
hostPath:
path: /sys
- name: node-exporter-bin
configMap:
name: node-exporter-bin
defaultMode: 0555
{{- end }}