{{- if .Values.enabled -}} apiVersion: {{ template "daemonset_api_version" . }} kind: DaemonSet metadata: name: {{ template "fluentd.fullname" . }}-windows labels: app: {{ template "fluentd.name" . }} chart: {{ template "fluentd.version" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} {{- if .Values.labels }} {{ toYaml .Values.labels | indent 4 }} {{- end }} spec: {{- if .Values.updateStrategy }} updateStrategy: {{ toYaml .Values.updateStrategy | indent 4 }} {{- end }} selector: matchLabels: app: {{ template "fluentd.name" . }} release: {{ .Release.Name }} template: metadata: labels: app: {{ template "fluentd.name" . }} chart: {{ template "fluentd.version" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} {{- if .Values.labels }} {{ toYaml .Values.labels | indent 4 }} {{- end }} {{- if .Values.annotations }} {{ toYaml .Values.annotations | indent 8 }} {{- end }} spec: serviceAccountName: {{ template "fluentd.fullname" . }} initContainers: - name: init-{{ template "fluentd.fullname" . }} image: {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }} command: - 'powershell' - '-command' - 'New-Item -ItemType Directory -Force -Path /var/lib/rancher/fluentd/log' volumeMounts: - mountPath: /var/lib/rancher name: rancher containers: - name: {{ template "fluentd.fullname" . }} image: {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} {{- if .Values.command }} command: {{ .Values.command }} {{ end }} env: {{- range $key, $value := .Values.env }} - name: {{ $key }} value: {{ $value | quote }} {{- end }} - name: K8S_NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName resources: {{ toYaml .Values.resources | indent 10 }} volumeMounts: - mountPath: /fluentd/etc/config/precan name: config - mountPath: /fluentd/etc/config/entry name: entry - mountPath: /fluentd/etc/config/ssl name: ssl - mountPath: {{ .Values.cluster.dockerRoot }} name: dockerroot - mountPath: /var/log/containers name: varlogcontainers - mountPath: /var/log/pods name: varlogpods - mountPath: /var/lib/rancher/rke/log name: rkelog - mountPath: /fluentd/log name: fluentdlog {{- if .Values.extraVolumeMounts }} {{ toYaml .Values.extraVolumeMounts | indent 8 }} {{- end }} ports: {{- range $port := .Values.service.ports }} - name: {{ $port.name }} containerPort: {{ $port.port }} {{- if $port.protocol }} protocol: {{ $port.protocol }} {{- end }} {{- end }} {{- if .Values.livenessProbe.enabled }} # use metrics endpoint to monitor liveness livenessProbe: httpGet: path: /metrics port: 24231 scheme: HTTP initialDelaySeconds: 60 periodSeconds: 60 timeoutSeconds: 3 failureThreshold: 3 successThreshold: 1 {{- end }} - name: {{ template "fluentd.fullname" . }}-{{ .Values.configmapReload.name }} image: {{ template "system_default_registry" . }}{{ .Values.configmapReload.image.repository }}:{{ .Values.configmapReload.image.tag }} imagePullPolicy: "{{ .Values.configmapReload.image.pullPolicy }}" args: - --volume-dir=/fluentd/etc/config/precan - --volume-dir=/fluentd/etc/config/ssl - --volume-dir=/fluentd/etc/config/entry - --webhook-method=GET - --webhook-url=http://127.0.0.1:24444/api/config.reload resources: {{ toYaml .Values.configmapReload.resources | indent 12 }} volumeMounts: - mountPath: /fluentd/etc/config/precan name: config - mountPath: /fluentd/etc/config/entry name: entry - mountPath: /fluentd/etc/config/ssl name: ssl terminationGracePeriodSeconds: 30 volumes: - hostPath: path: {{ .Values.cluster.dockerRoot }} name: dockerroot - hostPath: path: /var/log/containers name: varlogcontainers - hostPath: path: /var/log/pods name: varlogpods - hostPath: path: /var/lib/rancher/rke/log name: rkelog - hostPath: path: /var/lib/rancher/fluentd/log name: fluentdlog - hostPath: path: /var/lib/rancher name: rancher - name: config secret: secretName: {{ template "fluentd.fullname" . }} - name: entry secret: secretName: {{ template "fluentd.fullname" . }}-entry - name: ssl secret: secretName: {{ template "fluentd.fullname" . }}-ssl {{- if .Values.extraVolumes }} {{ toYaml .Values.extraVolumes | indent 6 }} {{- end }} nodeSelector: {{- include "windows-node-selector" . | nindent 8 }} {{- if .Values.nodeSelector }} {{ toYaml .Values.nodeSelector | indent 8 }} {{- end }} {{- if .Values.tolerations }} tolerations: {{ toYaml .Values.tolerations | indent 6 }} {{- end }} {{- end }}