You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.8 KiB

7 years ago
  1. ---
  2. # https://raw.githubusercontent.com/kubernetes/kubernetes/v1.5.2/cluster/addons/fluentd-elasticsearch/es-controller.yaml
  3. apiVersion: extensions/v1beta1
  4. kind: DaemonSet
  5. metadata:
  6. name: "fluentd-es-v{{ fluentd_version }}"
  7. namespace: "{{ system_namespace }}"
  8. labels:
  9. k8s-app: fluentd-es
  10. kubernetes.io/cluster-service: "true"
  11. version: "v{{ fluentd_version }}"
  12. spec:
  13. template:
  14. metadata:
  15. labels:
  16. k8s-app: fluentd-es
  17. kubernetes.io/cluster-service: "true"
  18. version: "v{{ fluentd_version }}"
  19. spec:
  20. tolerations:
  21. - effect: NoSchedule
  22. operator: Exists
  23. containers:
  24. - name: fluentd-es
  25. image: "{{ fluentd_image_repo }}:{{ fluentd_image_tag }}"
  26. command:
  27. - '/bin/sh'
  28. - '-c'
  29. - '/usr/sbin/td-agent -c {{ fluentd_config_dir }}/{{ fluentd_config_file}} 2>&1 >> /var/log/fluentd.log'
  30. resources:
  31. limits:
  32. {% if fluentd_cpu_limit is defined and fluentd_cpu_limit != "0m" %}
  33. cpu: {{ fluentd_cpu_limit }}
  34. {% endif %}
  35. memory: {{ fluentd_mem_limit }}
  36. requests:
  37. cpu: {{ fluentd_cpu_requests }}
  38. memory: {{ fluentd_mem_requests }}
  39. volumeMounts:
  40. - name: varlog
  41. mountPath: /var/log
  42. - name: dockercontainers
  43. mountPath: "{{ docker_daemon_graph }}/containers"
  44. readOnly: true
  45. - name: config
  46. mountPath: "{{ fluentd_config_dir }}"
  47. terminationGracePeriodSeconds: 30
  48. volumes:
  49. - name: varlog
  50. hostPath:
  51. path: /var/log
  52. - name: dockercontainers
  53. hostPath:
  54. path: {{ docker_daemon_graph }}/containers
  55. - name: config
  56. configMap:
  57. name: fluentd-config
  58. {% if rbac_enabled %}
  59. serviceAccountName: efk
  60. {% endif %}