Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Update node-problem-detector to v0.8.8 #1507

Merged
merged 2 commits into from
Jun 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions assets/charts/components/node-problem-detector/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
16 changes: 8 additions & 8 deletions assets/charts/components/node-problem-detector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
apiVersion: v1
name: node-problem-detector
version: "1.8.6"
appVersion: v0.8.5
home: https://github.com/kubernetes/node-problem-detector
appVersion: v0.8.8
description: |
This chart installs a [node-problem-detector](https://github.com/kubernetes/node-problem-detector) daemonset. This tool aims to make various node problems visible to the upstream layers in cluster management stack. It is a daemon which runs on each node, detects node problems and reports them to apiserver.
engine: gotpl
home: https://github.com/kubernetes/node-problem-detector
icon: https://github.com/kubernetes/kubernetes/raw/master/logo/logo.png
keywords:
- node
- problem
- detector
- monitoring
maintainers:
- email: no-reply@deliveryhero.com
name: max-rocket-internet
name: node-problem-detector
sources:
- https://github.com/kubernetes/node-problem-detector
- https://kubernetes.io/docs/concepts/architecture/nodes/#condition
maintainers:
- name: max-rocket-internet
email: no-reply@deliveryhero.com
engine: gotpl
version: 2.0.2
7 changes: 4 additions & 3 deletions assets/charts/components/node-problem-detector/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# node-problem-detector

![Version: 1.8.6](https://img.shields.io/badge/Version-1.8.6-informational?style=flat-square) ![AppVersion: v0.8.5](https://img.shields.io/badge/AppVersion-v0.8.5-informational?style=flat-square)
![Version: 2.0.2](https://img.shields.io/badge/Version-2.0.2-informational?style=flat-square) ![AppVersion: v0.8.8](https://img.shields.io/badge/AppVersion-v0.8.8-informational?style=flat-square)

This chart installs a [node-problem-detector](https://github.com/kubernetes/node-problem-detector) daemonset. This tool aims to make various node problems visible to the upstream layers in cluster management stack. It is a daemon which runs on each node, detects node problems and reports them to apiserver.

Expand Down Expand Up @@ -55,12 +55,13 @@ helm install my-release deliveryhero/node-problem-detector -f values.yaml
| fullnameOverride | string | `""` | |
| hostNetwork | bool | `false` | Run pod on host network Flag to run Node Problem Detector on the host's network. This is typically not recommended, but may be useful for certain use cases. |
| hostPID | bool | `false` | |
| hostpath.logdir | string | `"/var/log/"` | Log directory path on K8s host |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"k8s.gcr.io/node-problem-detector/node-problem-detector"` | |
| image.tag | string | `"v0.8.5"` | |
| image.tag | string | `"v0.8.8"` | |
| imagePullSecrets | list | `[]` | |
| labels | object | `{}` | |
| logDir.host | string | `"/var/log/"` | log directory on k8s host |
| logDir.pod | string | `""` | log directory in pod (volume mount), use logDir.host if empty |
| maxUnavailable | int | `1` | The max pods unavailable during an update |
| metrics.serviceMonitor.additionalLabels | object | `{}` | |
| metrics.serviceMonitor.enabled | bool | `false` | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,37 @@ Return the appropriate apiVersion for podSecurityPolicy.
{{- print "extensions/v1beta1" -}}
{{- end -}}
{{- end -}}


{{/*
Concat npd.config.* to make node-problem-detector CLI args more readable
*/}}
{{- define "npd.cli.args" -}}
{{ include "npd.config.systemLogMonitor" . }} {{ include "npd.config.customPluginMonitor" . }} {{ include "npd.config.prometheus" . }} {{ include "npd.config.k8sExporter" . }}
{{- end -}}

{{- define "npd.config.systemLogMonitor" -}}
--config.system-log-monitor=
{{- range $index, $monitor := .Values.settings.log_monitors -}}
{{- if ne $index 0 -}},{{- end -}}
{{- $monitor -}}
{{- end -}}
{{- end -}}

{{- define "npd.config.customPluginMonitor" -}}
{{- if .Values.settings.custom_plugin_monitors -}}
--config.custom-plugin-monitor=
{{- range $index, $monitor := .Values.settings.custom_plugin_monitors -}}
{{- if ne $index 0 -}},{{- end -}}
{{- $monitor -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{- define "npd.config.prometheus" -}}
{{- printf "--prometheus-address=%s --prometheus-port=%.0f" .Values.settings.prometheus_address .Values.settings.prometheus_port -}}
{{- end -}}

{{- define "npd.config.k8sExporter" -}}
--k8s-exporter-heartbeat-period={{ .Values.settings.heartBeatPeriod }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ metadata:
spec:
updateStrategy:
type: {{ .Values.updateStrategy }}
{{- if eq .Values.updateStrategy "RollingUpdate"}}
{{- if eq .Values.updateStrategy "RollingUpdate"}}
rollingUpdate:
maxUnavailable: {{ .Values.maxUnavailable }}
{{- end}}
{{- end}}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "node-problem-detector.name" . }}
Expand All @@ -34,9 +34,9 @@ spec:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/custom-config-configmap.yaml") . | sha256sum }}
scheduler.alpha.kubernetes.io/critical-pod: ''
{{- if .Values.annotations }}
{{ toYaml .Values.annotations | indent 8 }}
{{- end }}
{{- if .Values.annotations }}
{{- toYaml .Values.annotations | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ template "node-problem-detector.serviceAccountName" . }}
{{- if .Values.imagePullSecrets }}
Expand All @@ -55,59 +55,59 @@ spec:
command:
- "/bin/sh"
- "-c"
- "exec /node-problem-detector --logtostderr --config.system-log-monitor={{- range $index, $monitor := .Values.settings.log_monitors }}{{if ne $index 0}},{{end}}{{ $monitor }}{{- end }} {{- if .Values.settings.custom_plugin_monitors }} --custom-plugin-monitors={{- range $index, $monitor := .Values.settings.custom_plugin_monitors }}{{if ne $index 0}},{{end}}{{ $monitor }}{{- end }} {{- end }} --prometheus-address={{ .Values.settings.prometheus_address }} --prometheus-port={{ .Values.settings.prometheus_port }} --k8s-exporter-heartbeat-period={{ .Values.settings.heartBeatPeriod }}"
{{- if .Values.securityContext }}
- "exec /node-problem-detector --logtostderr {{ include "npd.cli.args" $ }}"
{{- if .Values.securityContext }}
securityContext:
{{ toYaml .Values.securityContext | indent 12 }}
{{- end }}
{{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
{{- if .Values.env }}
{{ toYaml .Values.env | indent 12 }}
{{- end }}
{{- if .Values.env }}
{{- toYaml .Values.env | nindent 12 }}
{{- end }}
volumeMounts:
- name: log
mountPath: {{ .Values.hostpath.logdir }}
mountPath: {{ default (default "/var/log/" .Values.logDir.host) .Values.logDir.pod }}
- name: localtime
mountPath: /etc/localtime
readOnly: true
- name: custom-config
mountPath: /custom-config
readOnly: true
{{- if .Values.extraVolumeMounts }}
{{ toYaml .Values.extraVolumeMounts | indent 12 }}
{{- end }}
{{- if .Values.extraVolumeMounts }}
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
{{- end }}
ports:
- containerPort: {{ .Values.settings.prometheus_port }}
name: exporter
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.affinity }}
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- if .Values.nodeSelector }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
{{- toYaml .Values.nodeSelector | nindent 8 }}
{{- end }}
volumes:
- name: log
hostPath:
path: {{ .Values.hostpath.logdir }}
path: {{ default "/var/log/" .Values.logDir.host }}
- name: localtime
hostPath:
path: /etc/localtime
type: "FileOrCreate"
- name: custom-config
configMap:
name: {{ include "node-problem-detector.customConfig" . }}
{{- if .Values.extraVolumes }}
{{ toYaml .Values.extraVolumes | indent 8 }}
{{- end }}
{{- if .Values.extraVolumes }}
{{- toYaml .Values.extraVolumes | nindent 8 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.metrics.serviceMonitor.additionalLabels }}
{{ toYaml .Values.metrics.serviceMonitor.additionalLabels | indent 4 }}
{{- toYaml .Values.metrics.serviceMonitor.additionalLabels | nindent 4 }}
{{- end }}
namespace: {{ .Release.Namespace }}
spec:
Expand Down
33 changes: 27 additions & 6 deletions assets/charts/components/node-problem-detector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,31 @@ settings:
# https://github.com/kubernetes/node-problem-detector/tree/master/config
# settings.custom_monitor_definitions -- Custom plugin monitor config files
custom_monitor_definitions: {}
# docker-monitor-filelog.json: |
# {
# "plugin": "filelog",
# "pluginConfig": {
# "timestamp": "^time=\"(\\S*)\"",
# "message": "msg=\"([^\n]*)\"",
# "timestampFormat": "2006-01-02T15:04:05.999999999-07:00"
# },
# "logPath": "/var/log/docker.log",
# "lookback": "5m",
# "bufferSize": 10,
# "source": "docker-monitor",
# "conditions": [],
# "rules": [
# {
# "type": "temporary",
# "reason": "CorruptDockerImage",
# "pattern": "Error trying v2 registry: failed to register layer: rename /var/lib/docker/image/(.+) /var/lib/docker/image/(.+): directory not empty.*"
# }
# ]
# }
# settings.log_monitors -- User-specified custom monitor definitions
log_monitors:
- /config/kernel-monitor.json
- /config/docker-monitor.json
# - /custom-config/kernel-monitor.json
# - /custom-config/docker-monitor-filelog.json
# An example of activating a custom log monitor definition in
# Node Problem Detector
# - /custom-config/docker-monitor-filelog.json
Expand All @@ -25,13 +44,15 @@ settings:
# settings.heartBeatPeriod -- Syncing interval with API server
heartBeatPeriod: 5m0s

hostpath:
# hostpath.logdir -- Log directory path on K8s host
logdir: /var/log/
logDir:
# logDir.host -- log directory on k8s host
host: /var/log/
# logDir.pod -- log directory in pod (volume mount), use logDir.host if empty
pod: ""

image:
repository: k8s.gcr.io/node-problem-detector/node-problem-detector
tag: v0.8.5
tag: v0.8.8
pullPolicy: IfNotPresent

imagePullSecrets: []
Expand Down
14 changes: 14 additions & 0 deletions docs/development/updating-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,17 @@ helm fetch --untar --untardir ./ vmware-tanzu/velero
```

- Chart location: https://github.com/vmware-tanzu/helm-charts/tree/main/charts/velero

## node-problem-detector

Run the following commands in the root of this repository:

```bash
cd assets/charts/components
rm -rf node-problem-detector
helm repo add deliveryhero https://charts.deliveryhero.io/
helm repo update
helm fetch --untar --untardir ./ deliveryhero/node-problem-detector
```

- Chart location: https://github.com/deliveryhero/helm-charts/blob/master/stable/node-problem-detector/Chart.yaml.
Loading