daemonset.yaml 4.95 KB
Newer Older
1
2
3
4
5
6
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: {{ template "kured.fullname" . }}
  namespace: {{ .Release.Namespace }}
  labels:
7
    {{- include "kured.labels" . | nindent 4 }}
8
9
10
spec:
  updateStrategy:
    type: {{ .Values.updateStrategy }}
11
12
13
14
{{- if eq .Values.updateStrategy "RollingUpdate"}}
    rollingUpdate:
      maxUnavailable: {{ .Values.maxUnavailable }}
{{- end}}
15
16
  selector:
    matchLabels:
17
      {{- include "kured.matchLabels" . | nindent 6 }}
18
19
20
  template:
    metadata:
      labels:
21
        {{- include "kured.labels" . | nindent 8 }}
t3mi's avatar
t3mi committed
22
23
24
        {{- if .Values.podLabels }}
        {{- toYaml .Values.podLabels | nindent 8 }}
        {{- end }}
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
      {{- if .Values.podAnnotations }}
      annotations:
      {{- range $key, $value := .Values.podAnnotations }}
        {{ $key }}: {{ $value | quote }}
      {{- end }}
      {{- end }}
    spec:
      serviceAccountName: {{ template "kured.serviceAccountName" . }}
      hostPID: true
      restartPolicy: Always
      {{- with .Values.image.pullSecrets }}
      imagePullSecrets:
{{ toYaml . | indent 8 }}
      {{- end }}
      {{- if .Values.priorityClassName }}
      priorityClassName: {{ .Values.priorityClassName }}
      {{- end }}
      containers:
        - name: {{ .Chart.Name }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          securityContext:
            privileged: true # Give permission to nsenter /proc/1/ns/mnt
          resources:
{{ toYaml .Values.resources | indent 12 }}
          command:
            - /usr/bin/kured
          args:
            - --ds-name={{ template "kured.fullname" . }}
            - --ds-namespace={{ .Release.Namespace }}
55
56
          {{- if .Values.configuration.lockTtl }}
            - --lock-ttl={{ .Values.configuration.lockTtl }}
57
58
          {{- end }}
          {{- if .Values.configuration.alertFilterRegexp }}
59
            - --alert-filter-regexp={{ .Values.configuration.alertFilterRegexp }}
60
          {{- end }}
61
          {{- range .Values.configuration.blockingPodSelector }}
62
            - --blocking-pod-selector={{ . }}
63
64
          {{- end }}
          {{- if .Values.configuration.endTime }}
65
            - --end-time={{ .Values.configuration.endTime }}
66
67
          {{- end }}
          {{- if .Values.configuration.lockAnnotation }}
68
            - --lock-annotation={{ .Values.configuration.lockAnnotation }}
69
70
          {{- end }}
          {{- if .Values.configuration.period }}
71
            - --period={{ .Values.configuration.period }}
72
73
          {{- end }}
          {{- if .Values.configuration.prometheusUrl }}
74
            - --prometheus-url={{ .Values.configuration.prometheusUrl }}
75
          {{- end }}
76
          {{- range .Values.configuration.rebootDays }}
77
            - --reboot-days={{ . }}
78
79
          {{- end }}
          {{- if .Values.configuration.rebootSentinel }}
80
            - --reboot-sentinel={{ .Values.configuration.rebootSentinel }}
81
82
          {{- end }}
          {{- if .Values.configuration.slackChannel }}
83
            - --slack-channel={{ .Values.configuration.slackChannel }}
84
85
          {{- end }}
          {{- if .Values.configuration.slackHookUrl }}
86
            - --slack-hook-url={{ .Values.configuration.slackHookUrl }}
87
88
          {{- end }}
          {{- if .Values.configuration.slackUsername }}
89
            - --slack-username={{ .Values.configuration.slackUsername }}
90
          {{- end }}
91
92
          {{- if .Values.configuration.messageTemplateDrain }}
            - --message-template-drain={{ .Values.configuration.messageTemplateDrain }}
93
          {{- end }}
94
95
          {{- if .Values.configuration.messageTemplateReboot }}
            - --message-template-reboot={{ .Values.configuration.messageTemplateReboot }}
96
          {{- end }}
97
          {{- if .Values.configuration.startTime }}
98
            - --start-time={{ .Values.configuration.startTime }}
99
100
          {{- end }}
          {{- if .Values.configuration.timeZone }}
101
            - --time-zone={{ .Values.configuration.timeZone }}
102
          {{- end }}
103
104
105
106
107
108
109
110
111
          {{- range $key, $value := .Values.extraArgs }}
            {{- if $value }}
            - --{{ $key }}={{ $value }}
            {{- else }}
            - --{{ $key }}
            {{- end }}
          {{- end }}
          ports:
            - containerPort: 8080
112
              name: metrics
113
114
115
116
117
118
119
          env:
            # Pass in the name of the node on which this pod is scheduled
            # for use with drain/uncordon operations and lock acquisition
            - name: KURED_NODE_ID
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
audunsolemdal's avatar
audunsolemdal committed
120
            {{- if .Values.extraEnvVars }}
audunsolemdal's avatar
audunsolemdal committed
121
              {{ toYaml .Values.extraEnvVars | nindent 12 }}
audunsolemdal's avatar
audunsolemdal committed
122
            {{- end }}
123
124
125
126
      {{- with .Values.tolerations }}
      tolerations:
{{ toYaml . | indent 8 }}
      {{- end }}
127
128
129
130
131
132
133
      {{- with .Values.nodeSelector }}
      nodeSelector:
{{ toYaml . | indent 8 }}
      {{- end }}
      {{- with .Values.affinity }}
      affinity:
{{ toYaml . | indent 8 }}
134
      {{- end }}