"...fluentd/charts/fluentd-windows/jmayer/system-charts" did not exist on "ba4a52ae24e56fdc1d7fdc3959167c633a6205da"
daemonset.yaml 5.39 KB
Newer Older
shanewxy's avatar
shanewxy committed
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 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
{{- 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 }}