aboutsummaryrefslogtreecommitdiffstats
path: root/deployments/helm/v2/emco/fluentd/templates/forwarder-daemonset.yaml
blob: 7c6e44df6766430c306bbb5dae64c2452b6dce17 (plain)
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
32
33
34
35
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{{- if .Values.forwarder.enabled }}
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: {{ include "fluentd.fullname" . }}
  labels: {{- include "fluentd.labels" . | nindent 4 }}
    app.kubernetes.io/component: forwarder
spec:
  selector:
    matchLabels: {{- include "fluentd.matchLabels" . | nindent 6 }}
      app.kubernetes.io/component: forwarder
  updateStrategy: {{- toYaml .Values.forwarder.updateStrategy | nindent 4 }}
  template:
    metadata:
      labels: {{- include "fluentd.labels" . | nindent 8 }}
        app.kubernetes.io/component: forwarder
      annotations:
        checksum/config: {{ include (print $.Template.BasePath "/forwarder-configmap.yaml") . | sha256sum }}
        {{- if .Values.forwarder.podAnnotations }}
        {{- include "fluentd.tplValue" (dict "value" .Values.forwarder.podAnnotations "context" $) | nindent 8 }}
        {{- end }}
    spec:
{{- include "fluentd.imagePullSecrets" . | nindent 6 }}
      serviceAccountName: {{ template "fluentd.serviceAccountName" . }}
      {{- if .Values.forwarder.affinity }}
      affinity: {{- include "fluentd.tplValue" (dict "value" .Values.forwarder.affinity "context" $) | nindent 8 }}
      {{- end }}
      {{- if .Values.forwarder.nodeSelector }}
      nodeSelector: {{- include "fluentd.tplValue" (dict "value" .Values.forwarder.nodeSelector "context" $) | nindent 8 }}
      {{- end }}
      {{- if .Values.forwarder.tolerations }}
      tolerations: {{- include "fluentd.tplValue" (dict "value" .Values.forwarder.tolerations "context" $) | nindent 8 }}
      {{- end }}
      {{- if .Values.forwarder.securityContext.enabled }}
      securityContext:
        runAsUser: {{ .Values.forwarder.securityContext.runAsUser }}
        fsGroup: {{ .Values.forwarder.securityContext.fsGroup }}
      {{- end }}
      containers:
        - name: fluentd
          image: {{ include "fluentd.image" . }}
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          env:
            - name: FLUENTD_CONF
              value: {{ .Values.forwarder.configFile }}
            - name: FLUENTD_OPT
              value: {{ .Values.forwarder.extraArgs | quote }}
            - name: FLUENTD_DAEMON_USER
              value: {{ .Values.forwarder.daemonUser | quote }}
            - name: FLUEND_DAEMON_GROUP
              value: {{ .Values.forwarder.daemonGroup | quote }}
            {{- if .Values.forwarder.extraEnv }}
            {{- toYaml .Values.forwarder.extraEnv | nindent 12 }}
            {{- end }}
          ports:
            {{- if .Values.forwarder.containerPorts }}
            {{- toYaml .Values.forwarder.containerPorts | nindent 12 }}
            {{- end }}
            {{- if .Values.metrics.enabled }}
            - name: metrics
              containerPort: {{ .Values.metrics.service.port }}
              protocol: TCP
            {{- end }}
          {{- if .Values.forwarder.livenessProbe.enabled }}
          livenessProbe:
            httpGet:
              path: /fluentd.healthcheck?json=%7B%22ping%22%3A+%22pong%22%7D
              port: http
            initialDelaySeconds: {{ .Values.forwarder.livenessProbe.initialDelaySeconds }}
            periodSeconds: {{ .Values.forwarder.livenessProbe.periodSeconds }}
            timeoutSeconds: {{ .Values.forwarder.livenessProbe.timeoutSeconds }}
            successThreshold: {{ .Values.forwarder.livenessProbe.successThreshold }}
            failureThreshold: {{ .Values.forwarder.livenessProbe.failureThreshold }}
          {{- end }}
          {{- if .Values.forwarder.readinessProbe.enabled }}
          readinessProbe:
            httpGet:
              path: /fluentd.healthcheck?json=%7B%22ping%22%3A+%22pong%22%7D
              port: http
            initialDelaySeconds: {{ .Values.forwarder.readinessProbe.initialDelaySeconds }}
            periodSeconds: {{ .Values.forwarder.readinessProbe.periodSeconds }}
            timeoutSeconds: {{ .Values.forwarder.readinessProbe.timeoutSeconds }}
            successThreshold: {{ .Values.forwarder.readinessProbe.successThreshold }}
            failureThreshold: {{ .Values.forwarder.readinessProbe.failureThreshold }}
          {{- end }}
          {{- if .Values.forwarder.resources }}
          resources: {{- toYaml .Values.forwarder.resources | nindent 12 }}
          {{- end }}
          volumeMounts:
            - name: fluentd-config
              mountPath: /opt/bitnami/fluentd/conf
            - name: buffer
              mountPath: /opt/bitnami/fluentd/logs/buffers
            {{- if .Values.tls.enabled }}
            - name: certs
              mountPath: /opt/bitnami/fluentd/certs
            {{- end }}
            - name: varlog
              mountPath: /var/log
            - name: varlibdockercontainers
              mountPath: /var/lib/docker/containers
              readOnly: true
      volumes:
        {{- if .Values.tls.enabled }}
        - name: certs
          secret:
            secretName: {{ template "fluentd.tls.secretName" . }}
            items:
              - key: tls.crt
                path: tls.crt
              - key: tls.key
                path: tls.key
        {{- end }}
        - name: fluentd-config
          configMap:
            name: {{ template "fluentd.forwarder.configMap" . }}
        - name: buffer
          emptyDir: {}
        - name: varlog
          hostPath:
            path: /var/log
        - name: varlibdockercontainers
          hostPath:
            path: /var/lib/docker/containers
{{- end }}