2017-01-26 23:33:01 +00:00
|
|
|
---
|
|
|
|
# https://raw.githubusercontent.com/kubernetes/kubernetes/v1.5.2/cluster/addons/fluentd-elasticsearch/es-controller.yaml
|
|
|
|
apiVersion: extensions/v1beta1
|
|
|
|
kind: DaemonSet
|
|
|
|
metadata:
|
|
|
|
name: "fluentd-es-v{{ fluentd_version }}"
|
|
|
|
namespace: "{{ system_namespace }}"
|
|
|
|
labels:
|
|
|
|
k8s-app: fluentd-es
|
|
|
|
kubernetes.io/cluster-service: "true"
|
|
|
|
version: "v{{ fluentd_version }}"
|
|
|
|
spec:
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
k8s-app: fluentd-es
|
|
|
|
kubernetes.io/cluster-service: "true"
|
|
|
|
version: "v{{ fluentd_version }}"
|
|
|
|
spec:
|
2017-08-24 09:04:25 +00:00
|
|
|
tolerations:
|
|
|
|
- effect: NoSchedule
|
|
|
|
operator: Exists
|
2017-01-26 23:33:01 +00:00
|
|
|
containers:
|
|
|
|
- name: fluentd-es
|
|
|
|
image: "{{ fluentd_image_repo }}:{{ fluentd_image_tag }}"
|
|
|
|
command:
|
|
|
|
- '/bin/sh'
|
|
|
|
- '-c'
|
2017-08-10 06:48:53 +00:00
|
|
|
- '/usr/sbin/td-agent -c {{ fluentd_config_dir }}/{{ fluentd_config_file}} 2>&1 >> /var/log/fluentd.log'
|
2017-01-26 23:33:01 +00:00
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
{% if fluentd_cpu_limit is defined and fluentd_cpu_limit != "0m" %}
|
2017-07-28 05:10:13 +00:00
|
|
|
cpu: {{ fluentd_cpu_limit }}
|
2017-01-26 23:33:01 +00:00
|
|
|
{% endif %}
|
|
|
|
memory: {{ fluentd_mem_limit }}
|
|
|
|
requests:
|
|
|
|
cpu: {{ fluentd_cpu_requests }}
|
|
|
|
memory: {{ fluentd_mem_requests }}
|
|
|
|
volumeMounts:
|
|
|
|
- name: varlog
|
|
|
|
mountPath: /var/log
|
|
|
|
- name: varlibdockercontainers
|
|
|
|
mountPath: /var/lib/docker/containers
|
|
|
|
readOnly: true
|
2017-08-10 06:48:53 +00:00
|
|
|
- name: config
|
|
|
|
mountPath: "{{ fluentd_config_dir }}"
|
2017-01-26 23:33:01 +00:00
|
|
|
terminationGracePeriodSeconds: 30
|
|
|
|
volumes:
|
|
|
|
- name: varlog
|
|
|
|
hostPath:
|
|
|
|
path: /var/log
|
|
|
|
- name: varlibdockercontainers
|
|
|
|
hostPath:
|
|
|
|
path: /var/lib/docker/containers
|
2017-08-10 06:48:53 +00:00
|
|
|
- name: config
|
|
|
|
configMap:
|
|
|
|
name: fluentd-config
|
|
|
|
{% if rbac_enabled %}
|
|
|
|
serviceAccountName: efk
|
|
|
|
{% endif %}
|