diff --git a/stable/prometheus/README.md b/stable/prometheus/README.md index 8ee88caeea..471e17d3b2 100644 --- a/stable/prometheus/README.md +++ b/stable/prometheus/README.md @@ -101,6 +101,7 @@ Parameter | Description | Default `nodeExporter.image.tag` | node-exporter container image tag | `v0.13.0` `nodeExporter.image.pullPolicy` | node-exporter container image pull policy | `IfNotPresent` `nodeExporter.extraArgs` | Additional node-exporter container arguments | `{}` +`nodeExporter.extraHostPathMounts` | Additional node-exporter hostPath mounts | `[]` `nodeExporter.nodeSelector` | node labels for node-exporter pod assignment | `{}` `nodeExporter.podAnnotations` | annotations to be added to node-exporter pods | `{}` `nodeExporter.resources` | node-exporter resource requests and limits (YAML) | `{}` @@ -117,6 +118,7 @@ Parameter | Description | Default `server.image.pullPolicy` | Prometheus server container image pull policy | `IfNotPresent` `server.alertmanagerURL` | (optional) alertmanager URL; only used if alertmanager.enabled = false | `""` `server.extraArgs` | Additional Prometheus server container arguments | `{}` +`server.extraHostPathMounts` | Additional Prometheus server hostPath mounts | `[]` `server.ingress.enabled` | If true, Prometheus server Ingress will be created | `false` `server.ingress.annotations` | Prometheus server Ingress annotations | `[]` `server.ingress.hosts` | Prometheus server Ingress hostnames | `[]` diff --git a/stable/prometheus/templates/node-exporter-daemonset.yaml b/stable/prometheus/templates/node-exporter-daemonset.yaml index 06be4c9dbb..941d80a058 100644 --- a/stable/prometheus/templates/node-exporter-daemonset.yaml +++ b/stable/prometheus/templates/node-exporter-daemonset.yaml @@ -44,6 +44,11 @@ spec: - name: sys mountPath: /host/sys readOnly: true + {{- range .Values.nodeExporter.extraHostPathMounts }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + readOnly: {{ .readOnly }} + {{- end }} hostNetwork: true hostPID: true {{- if .Values.nodeExporter.nodeSelector }} @@ -57,4 +62,9 @@ spec: - name: sys hostPath: path: /sys + {{- range .Values.nodeExporter.extraHostPathMounts }} + - name: {{ .name }} + hostPath: + path: {{ .hostPath }} + {{- end }} {{- end -}} diff --git a/stable/prometheus/templates/server-deployment.yaml b/stable/prometheus/templates/server-deployment.yaml index f462a70c85..dfb869f2a9 100644 --- a/stable/prometheus/templates/server-deployment.yaml +++ b/stable/prometheus/templates/server-deployment.yaml @@ -65,6 +65,11 @@ spec: - name: storage-volume mountPath: {{ .Values.alertmanager.persistentVolume.mountPath }} subPath: "{{ .Values.server.persistentVolume.subPath }}" + {{- range .Values.server.extraHostPathMounts }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + readOnly: {{ .readOnly }} + {{- end }} {{- if .Values.server.nodeSelector }} nodeSelector: {{ toYaml .Values.server.nodeSelector | indent 8 }} @@ -81,3 +86,8 @@ spec: {{- else }} emptyDir: {} {{- end -}} + {{- range .Values.server.extraHostPathMounts }} + - name: {{ .name }} + hostPath: + path: {{ .hostPath }} + {{- end }} diff --git a/stable/prometheus/values.yaml b/stable/prometheus/values.yaml index c47b510417..d8458571e6 100644 --- a/stable/prometheus/values.yaml +++ b/stable/prometheus/values.yaml @@ -216,6 +216,14 @@ nodeExporter: ## extraArgs: {} + ## Additional node-exporter hostPath mounts + ## + extraHostPathMounts: [] + # - name: textfile-dir + # mountPath: /srv/txt_collector + # hostPath: /var/lib/node-exporter + # readOnly: true + ## Node labels for node-exporter pod assignment ## Ref: https://kubernetes.io/docs/user-guide/node-selection/ ## @@ -274,6 +282,14 @@ server: ## extraArgs: {} + ## Additional Prometheus server hostPath mounts + ## + extraHostPathMounts: [] + # - name: certs-dir + # mountPath: /etc/kubernetes/certs + # hostPath: /etc/kubernetes/certs + # readOnly: true + ingress: ## If true, Prometheus server Ingress will be created ##