Skip to content

Commit

Permalink
[prometheus-node-exporter] Add Termination Msg Params to Daemonset (#…
Browse files Browse the repository at this point in the history
…4191)

* added more customizable vars for volumes and where termination message paths should go

Signed-off-by: Nicole <[email protected]>

* added additional vars for termination msg pts, env vars for kuberbacproxy and termination grace period seconds

Signed-off-by: Nicole <[email protected]>

* flip kuberbacproxy to false again

Signed-off-by: Nicole <[email protected]>

* added notes for env var and for restart policy
Added notes in vals files and restart policy
Signed-off-by: Nicole <[email protected]>

* added definition in values file for volumemounts type

Signed-off-by: Nicole <[email protected]>

* remove small fix for bug for later pr

Signed-off-by: Nicole <[email protected]>

* fix version

Signed-off-by: Nicole <[email protected]>

* remove most changes except for termination params

Signed-off-by: Nicole <[email protected]>

* remove env from the ds

Signed-off-by: Nicole <[email protected]>

* using suggestion, used a toggle instead for setting termination message paths

Signed-off-by: Nicole <[email protected]>

* revert krp and terminationmsgpath back to false from true that was set for testing

Signed-off-by: Nicole <[email protected]>

* Added with statement for termination grace period

Signed-off-by: Nicole <[email protected]>

* disable termination msg path

Signed-off-by: Nicole <[email protected]>

* added null or 30 default message

Signed-off-by: Nicole <[email protected]>

---------

Signed-off-by: Nicole <[email protected]>
  • Loading branch information
nfrazier08 authored Feb 1, 2024
1 parent f336ff6 commit c24cde3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/prometheus-node-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords:
- prometheus
- exporter
type: application
version: 4.26.1
version: 4.27.0
appVersion: 1.7.0
home: https://github.com/prometheus/node_exporter/
sources:
Expand Down
15 changes: 15 additions & 0 deletions charts/prometheus-node-exporter/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "prometheus-node-exporter.serviceAccountName" . }}
{{- with .Values.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ . }}
{{- end }}
containers:
{{- $servicePort := ternary .Values.kubeRBACProxy.port .Values.service.port .Values.kubeRBACProxy.enabled }}
- name: node-exporter
Expand Down Expand Up @@ -124,6 +127,12 @@ spec:
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.terminationMessageParams.enabled }}
{{- with .Values.terminationMessageParams }}
terminationMessagePath: {{ .terminationMessagePath }}
terminationMessagePolicy: {{ .terminationMessagePolicy }}
{{- end }}
{{- end }}
volumeMounts:
- name: proc
mountPath: /host/proc
Expand Down Expand Up @@ -209,6 +218,12 @@ spec:
resources:
{{ toYaml .Values.kubeRBACProxy.resources | nindent 12 }}
{{- end }}
{{- if .Values.terminationMessageParams.enabled }}
{{- with .Values.terminationMessageParams }}
terminationMessagePath: {{ .terminationMessagePath }}
terminationMessagePolicy: {{ .terminationMessagePolicy }}
{{- end }}
{{- end }}
{{- if .Values.kubeRBACProxy.containerSecurityContext }}
securityContext:
{{ toYaml .Values.kubeRBACProxy.containerSecurityContext | nindent 12 }}
Expand Down
15 changes: 14 additions & 1 deletion charts/prometheus-node-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ kubeRBACProxy:
sha: ""
pullPolicy: IfNotPresent

# List of additional cli arguments to configure kube-rbac-prxy
# List of additional cli arguments to configure kube-rbac-proxy
# for example: --tls-cipher-suites, --log-file, etc.
# all the possible args can be found here: https://github.com/brancz/kube-rbac-proxy#usage
extraArgs: []
Expand Down Expand Up @@ -361,10 +361,23 @@ nodeSelector:
kubernetes.io/os: linux
# kubernetes.io/arch: amd64

# Specify grace period for graceful termination of pods. Defaults to 30 if null or not specified
terminationGracePeriodSeconds: null

tolerations:
- effect: NoSchedule
operator: Exists

# Enable or disable container termination message settings
# https://kubernetes.io/docs/tasks/debug/debug-application/determine-reason-pod-failure/
terminationMessageParams:
enabled: false
# If enabled, specify the path for termination messages
terminationMessagePath: /dev/termination-log
# If enabled, specify the policy for termination messages
terminationMessagePolicy: File


## Assign a PriorityClassName to pods if set
# priorityClassName: ""

Expand Down

0 comments on commit c24cde3

Please sign in to comment.