|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: DaemonSet |
| 3 | +metadata: |
| 4 | + name: {{ template "fluentd_kubernetes.fullname" . }} |
| 5 | + labels: |
| 6 | + k8s-app: fluentd-logging |
| 7 | + version: v1 |
| 8 | + kubernetes.io/cluster-service: "true" |
| 9 | + app: {{ template "fluentd_kubernetes.name" . }} |
| 10 | + chart: {{ template "fluentd_kubernetes.chart" . }} |
| 11 | + release: {{ .Release.Name }} |
| 12 | + heritage: {{ .Release.Service }} |
| 13 | +spec: |
| 14 | + selector: |
| 15 | + matchLabels: |
| 16 | + k8s-app: fluentd-logging |
| 17 | + app: {{ template "fluentd_kubernetes.name" . }} |
| 18 | + release: {{ .Release.Name }} |
| 19 | + template: |
| 20 | + metadata: |
| 21 | + labels: |
| 22 | + k8s-app: fluentd-logging |
| 23 | + version: v1 |
| 24 | + kubernetes.io/cluster-service: "true" |
| 25 | + app: {{ template "fluentd_kubernetes.name" . }} |
| 26 | + release: {{ .Release.Name }} |
| 27 | + {{- if .Values.role }} |
| 28 | + annotations: |
| 29 | + iam.amazonaws.com/role: {{ .Values.role }} |
| 30 | + {{- end }} |
| 31 | + spec: |
| 32 | + serviceAccountName: {{ template "fluentd_kubernetes.fullname" . }} |
| 33 | + tolerations: |
| 34 | + - key: node-role.kubernetes.io/master |
| 35 | + effect: NoSchedule |
| 36 | + containers: |
| 37 | + - name: fluentd |
| 38 | + image: {{ .Values.image.repository}}:{{ .Values.image.tag }} |
| 39 | + imagePullPolicy: {{ .Values.image.pullPolicy | default "IfNotPresent" }} |
| 40 | + env: |
| 41 | + {{- if .Values.role }} |
| 42 | + - name: FLUENT_ELASTICSEARCH_HOST |
| 43 | + value: "localhost" |
| 44 | + - name: FLUENT_ELASTICSEARCH_PORT |
| 45 | + value: "9200" |
| 46 | + - name: FLUENT_ELASTICSEARCH_SCHEME |
| 47 | + value: "http" |
| 48 | + {{- else }} |
| 49 | + - name: FLUENT_ELASTICSEARCH_HOST |
| 50 | + value: "{{ .Values.elasticsearch.endpoint }}" |
| 51 | + - name: FLUENT_ELASTICSEARCH_PORT |
| 52 | + value: "443" |
| 53 | + - name: FLUENT_ELASTICSEARCH_SCHEME |
| 54 | + value: "https" |
| 55 | + {{- end }} |
| 56 | + {{- range $name, $value := .Values.env }} |
| 57 | + {{- if (not (empty $value)) and (not (eq $name "FLUENT_ELASTICSEARCH_HOST" "FLUENT_ELASTICSEARCH_SCHEME")) }} |
| 58 | + - name: {{ $name | quote }} |
| 59 | + value: {{ $value | quote }} |
| 60 | + {{- end }} |
| 61 | + {{- end }} |
| 62 | + resources: |
| 63 | +{{ toYaml .Values.resources | indent 10 }} |
| 64 | + volumeMounts: |
| 65 | + - name: varlog |
| 66 | + mountPath: /var/log |
| 67 | + - name: varlibdockercontainers |
| 68 | + mountPath: /var/lib/docker/containers |
| 69 | + readOnly: true |
| 70 | + {{- if .Values.role }} |
| 71 | + - name: signing-proxy |
| 72 | + # This image, abutaha/aws-es-proxy:0.9, still has issues, but the Fluentd plugin seems not to be affected by them. |
| 73 | + # Still, the image should be updated when possible, but once we find a good image it should not need to be |
| 74 | + # updated further until AWS changes their signing algorithm. |
| 75 | + # https://github.com/abutaha/aws-es-proxy/issues/27 |
| 76 | + # https://github.com/abutaha/aws-es-proxy/issues/29 |
| 77 | + # https://github.com/abutaha/aws-es-proxy/issues/35 |
| 78 | + # An alternative is mozilla/aws-signing-proxy but as of version 1.0.3 it did not work |
| 79 | + # https://github.com/mozilla-services/aws-signing-proxy/issues/9 |
| 80 | + image: abutaha/aws-es-proxy:0.9 |
| 81 | + imagePullPolicy: IfNotPresent |
| 82 | + args: |
| 83 | + - "-endpoint" |
| 84 | + - "https://{{ .Values.elasticsearch.endpoint }}" |
| 85 | + - "-listen" |
| 86 | + - "127.0.0.1:9200" |
| 87 | + {{- if .Values.debug.signer }} |
| 88 | + - "-pretty" |
| 89 | + - "-verbose" |
| 90 | + - "-log-to-file" |
| 91 | + {{- end }} |
| 92 | + resources: |
| 93 | + requests: |
| 94 | + cpu: 5m |
| 95 | + memory: 10Mi |
| 96 | + {{- end }} |
| 97 | + terminationGracePeriodSeconds: 30 |
| 98 | + volumes: |
| 99 | + - name: varlog |
| 100 | + hostPath: |
| 101 | + path: /var/log |
| 102 | + - name: varlibdockercontainers |
| 103 | + hostPath: |
| 104 | + path: /var/lib/docker/containers |
0 commit comments