daemonset.yaml 2.16 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: {{ include "telegraf.fullname" . }}
  labels:
    app.kubernetes.io/name: {{ include "telegraf.name" . }}
    helm.sh/chart: {{ include "telegraf.chart" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: {{ include "telegraf.name" . }}
      app.kubernetes.io/instance: {{ .Release.Name }}
  template:
    metadata:
      labels:
        app.kubernetes.io/name: {{ include "telegraf.name" . }}
        app.kubernetes.io/instance: {{ .Release.Name }}
      annotations:
        # Include a hash of the configmap in the pod template
        # This means that if the configmap changes, the deployment will be rolled
        checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
    spec:
      serviceAccountName: {{ template "telegraf.serviceAccountName" . }}
      containers:
      - name: {{ .Chart.Name }}
        image: "{{ .Values.image.repo }}:{{ .Values.image.tag }}"
        imagePullPolicy: {{ default "" .Values.image.pullPolicy | quote }}
        resources:
{{ toYaml .Values.resources | indent 10 }}
        env:
32 33 34 35
        - name: HOSTIP
          valueFrom:
            fieldRef:
              fieldPath: status.hostIP
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
{{ toYaml .Values.env | indent 8 }}
        volumeMounts:
        - name: varrunutmpro
          mountPath: /var/run/utmp
          readOnly: true
        - name: sysro
          mountPath: /rootfs/sys
          readOnly: true
        - name: procro
          mountPath: /rootfs/proc
          readOnly: true
        - name: docker-socket
          mountPath: /var/run/docker.sock
        - name: config
          mountPath: /etc/telegraf
    {{- with .Values.tolerations }}
      tolerations:
{{ toYaml . | indent 8 }}
    {{- end }}
      volumes:
      - name: sysro
        hostPath:
          path: /sys
      - name: docker-socket
        hostPath:
          path: /var/run/docker.sock
      - name: procro
        hostPath:
          path: /proc
      - name: varrunutmpro
        hostPath:
          path: /var/run/utmp
      - name: config
        configMap:
          name:  {{ include "telegraf.fullname" . }}