diff --git a/charts/netdata/Chart.yaml b/charts/netdata/Chart.yaml index e06e417..3cf2eac 100644 --- a/charts/netdata/Chart.yaml +++ b/charts/netdata/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: netdata -version: 3.5.1 +version: 3.6.1 description: Real-time performance monitoring, done right! type: application keywords: diff --git a/charts/netdata/README.md b/charts/netdata/README.md index 0ce83e7..83758e7 100644 --- a/charts/netdata/README.md +++ b/charts/netdata/README.md @@ -1,6 +1,6 @@ # Netdata Helm chart for Kubernetes deployments -[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/netdata)](https://artifacthub.io/packages/search?repo=netdata) ![Version: 3.5.1](https://img.shields.io/badge/Version-3.5.1-informational) ![AppVersion: v1.29.1](https://img.shields.io/badge/AppVersion-v1.29.1-informational) +[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/netdata)](https://artifacthub.io/packages/search?repo=netdata) ![Version: 3.6.1](https://img.shields.io/badge/Version-3.6.1-informational) ![AppVersion: v1.29.1](https://img.shields.io/badge/AppVersion-v1.29.1-informational) _Based on the work of varyumin (https://github.com/varyumin/netdata)_. @@ -153,7 +153,8 @@ The following table lists the configurable parameters of the netdata chart and t | `child.podLabels` | Additional labels to add to the child pods | `{}` | | `child.podAnnotations` | Additional annotations to add to the child pods | `{}` | | `child.podAnnotationAppArmor.enabled` | Whether or not to include the AppArmor security annotation | `true` | -| `child.persistUniqueID` | Whether or not to persist `netdata.public.unique.id` across restarts | `true` | +| `child.persistence.hostPath` | Host node directory for storing child instance data | `/var/lib/netdata-k8s-child` | +| `child.persistence.enabled` | Whether or not to persist `/var/lib/netdata` in the `child.persistence.hostPath`. | `true` | | `child.configs` | Manage custom child's configs | See [Configuration files](#configuration-files). | | `child.claiming.enabled` | Enable child claiming for netdata cloud | `false` | | `child.claiming.token` | Claim token | `""` | diff --git a/charts/netdata/templates/daemonset.yaml b/charts/netdata/templates/daemonset.yaml index 6f8b179..26ea38c 100644 --- a/charts/netdata/templates/daemonset.yaml +++ b/charts/netdata/templates/daemonset.yaml @@ -58,37 +58,22 @@ spec: resources: {{ toYaml .Values.sysctlImage.resources | indent 12 }} {{- end }} - {{- if .Values.child.persistUniqueID }} - - name: init-nodeuid + {{- if and .Values.child.persistence.enabled .Values.child.persistence.hostPath }} + - name: init-persistence image: "{{ .Values.wgetImage.repository }}:{{ .Values.wgetImage.tag }}" resources: requests: cpu: 10m imagePullPolicy: {{ .Values.wgetImage.pullPolicy }} volumeMounts: - - name: nodeuid - mountPath: "/nodeuid" - env: - - name: MY_NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName + - name: persistencevarlibdir + mountPath: "/persistencevarlibdir" command: - "/bin/sh" args: - "-c" - ' - TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token); - URL="https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}/api/v1/nodes/${MY_NODE_NAME}"; - HEADER="Authorization: Bearer ${TOKEN}"; - - DATA=$(wget -q -T 5 --no-check-certificate --header "${HEADER}" -O - "${URL}"); - [ -z "${DATA}" ] && exit 1; - - UID=$(echo "${DATA}" | grep -m 1 uid | grep -o ":.*" | tr -d ": \","); - [ -z "${UID}" ] && exit 1; - - echo -n "${UID}" > /nodeuid/netdata.public.unique.id; + chmod 777 /persistencevarlibdir; ' {{- end }} containers: @@ -164,9 +149,9 @@ spec: subPath: {{ $name }} {{- end }} {{- end }} - {{- if .Values.child.persistUniqueID }} - - name: nodeuid - mountPath: "/var/lib/netdata/registry/" + {{- if and .Values.child.persistence.enabled .Values.child.persistence.hostPath }} + - name: persistencevarlibdir + mountPath: /var/lib/netdata {{- end }} {{- if .Values.sd.child.enabled }} - name: sd-shared @@ -226,9 +211,13 @@ spec: - name: config configMap: name: netdata-conf-child - {{- if .Values.child.persistUniqueID }} - - name: nodeuid - emptyDir: {} + {{- with .Values.child.persistence }} + {{- if and .enabled .hostPath }} + - name: persistencevarlibdir + hostPath: + path: {{ .hostPath }}/var/lib/netdata + type: DirectoryOrCreate + {{- end }} {{- end }} {{- if .Values.sd.child.enabled }} - name: sd-shared diff --git a/charts/netdata/values.yaml b/charts/netdata/values.yaml index 8ca4fad..8262dba 100644 --- a/charts/netdata/values.yaml +++ b/charts/netdata/values.yaml @@ -241,7 +241,9 @@ child: podAnnotations: {} - persistUniqueID: true + persistence: + enabled: true + hostPath: /var/lib/netdata-k8s-child configs: netdata: