chore(netdata): use configmap for readability and extendability (#2601)
* chore(netdata): use configmap for readability * whoops * typo * mount confimap on initcont * subpath * type file * add /dev
This commit is contained in:
@@ -18,7 +18,7 @@ maintainers:
|
|||||||
name: netdata
|
name: netdata
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/netdata
|
- https://github.com/netdata
|
||||||
version: 0.0.4
|
version: 0.0.5
|
||||||
annotations:
|
annotations:
|
||||||
truecharts.org/catagories: |
|
truecharts.org/catagories: |
|
||||||
- utilities
|
- utilities
|
||||||
|
|||||||
@@ -1 +1,20 @@
|
|||||||
{{ include "common.all" . }}
|
{{- include "common.setup" . }}
|
||||||
|
|
||||||
|
{{/* Append the hardcoded settings */}}
|
||||||
|
{{- define "netdata.harcodedValues" -}}
|
||||||
|
persistence:
|
||||||
|
netdata-configs:
|
||||||
|
enabled: "true"
|
||||||
|
mountPath: "/etc/netdata/truecharts-defaults/.netdata.conf"
|
||||||
|
subPath: "netdata-conf"
|
||||||
|
type: "custom"
|
||||||
|
volumeSpec:
|
||||||
|
configMap:
|
||||||
|
name: {{ printf "%v-configs" (include "common.names.fullname" .) }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- $_ := mergeOverwrite .Values (include "netdata.harcodedValues" . | fromYaml) -}}
|
||||||
|
|
||||||
|
{{- include "netdata.configmap" . }}
|
||||||
|
|
||||||
|
{{/* Render the templates */}}
|
||||||
|
{{ include "common.postSetup" . }}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
{{- define "netdata.configmap" -}}
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}-configs
|
||||||
|
labels:
|
||||||
|
{{- include "common.labels" . | nindent 4 }}
|
||||||
|
data:
|
||||||
|
netdata-conf: |-
|
||||||
|
[global]
|
||||||
|
memory mode = dbengine
|
||||||
|
dbengine multihost disk space = 4096
|
||||||
|
page cache size = 64
|
||||||
|
{{- end -}}
|
||||||
@@ -99,6 +99,12 @@ persistence:
|
|||||||
hostPath: "/proc"
|
hostPath: "/proc"
|
||||||
mountPath: "/host/proc"
|
mountPath: "/host/proc"
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
dev:
|
||||||
|
enabled: true
|
||||||
|
type: hostPath
|
||||||
|
hostPath: "/dev"
|
||||||
|
mountPath: "/host/dev"
|
||||||
|
readOnly: true
|
||||||
sys:
|
sys:
|
||||||
enabled: true
|
enabled: true
|
||||||
type: hostPath
|
type: hostPath
|
||||||
@@ -119,16 +125,17 @@ initContainers:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: config
|
- name: config
|
||||||
mountPath: "/etc/netdata"
|
mountPath: "/etc/netdata"
|
||||||
|
- name: netdata-configs
|
||||||
|
mountPath: "/etc/netdata/truecharts-defaults/.netdata.conf"
|
||||||
|
subPath: netdata-conf
|
||||||
|
readOnly: true
|
||||||
command: ["/bin/sh", "-c"]
|
command: ["/bin/sh", "-c"]
|
||||||
args:
|
args:
|
||||||
- >
|
- >
|
||||||
export configfile=/etc/netdata/netdata.conf;
|
export configfile=/etc/netdata/netdata.conf;
|
||||||
if [ ! -f $configfile ]; then
|
if [ ! -f $configfile ]; then
|
||||||
echo "Creating config file...";
|
cp /etc/netdata/truecharts-defaults/.netdata.conf $configfile
|
||||||
echo '[global]' > $configfile;
|
|
||||||
echo ' memory mode = dbengine' >> $configfile;
|
|
||||||
echo ' dbengine multihost disk space = 4096' >> $configfile;
|
|
||||||
echo ' page cache size = 64' >> $configfile;
|
|
||||||
else
|
else
|
||||||
echo "Config file exists, skipping...";
|
echo "Config file exists, skipping...";
|
||||||
fi;
|
fi;
|
||||||
|
cat $configfile
|
||||||
|
|||||||
Reference in New Issue
Block a user