fluentd-es-ds.yaml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. apiVersion: v1
  2. kind: ServiceAccount
  3. metadata:
  4. name: fluentd-es
  5. namespace: logging
  6. labels:
  7. k8s-app: fluentd-es
  8. kubernetes.io/cluster-service: "true"
  9. addonmanager.kubernetes.io/mode: Reconcile
  10. ---
  11. kind: ClusterRole
  12. apiVersion: rbac.authorization.k8s.io/v1
  13. metadata:
  14. name: fluentd-es
  15. labels:
  16. k8s-app: fluentd-es
  17. kubernetes.io/cluster-service: "true"
  18. addonmanager.kubernetes.io/mode: Reconcile
  19. rules:
  20. - apiGroups:
  21. - ""
  22. resources:
  23. - "namespaces"
  24. - "pods"
  25. verbs:
  26. - "get"
  27. - "watch"
  28. - "list"
  29. ---
  30. kind: ClusterRoleBinding
  31. apiVersion: rbac.authorization.k8s.io/v1
  32. metadata:
  33. name: fluentd-es
  34. labels:
  35. k8s-app: fluentd-es
  36. kubernetes.io/cluster-service: "true"
  37. addonmanager.kubernetes.io/mode: Reconcile
  38. subjects:
  39. - kind: ServiceAccount
  40. name: fluentd-es
  41. namespace: logging
  42. apiGroup: ""
  43. roleRef:
  44. kind: ClusterRole
  45. name: fluentd-es
  46. apiGroup: ""
  47. ---
  48. apiVersion: apps/v1
  49. kind: DaemonSet
  50. metadata:
  51. name: fluentd-es-v2.2.0
  52. namespace: logging
  53. labels:
  54. k8s-app: fluentd-es
  55. version: v2.2.0
  56. kubernetes.io/cluster-service: "true"
  57. addonmanager.kubernetes.io/mode: Reconcile
  58. spec:
  59. selector:
  60. matchLabels:
  61. k8s-app: fluentd-es
  62. version: v2.2.0
  63. template:
  64. metadata:
  65. labels:
  66. k8s-app: fluentd-es
  67. kubernetes.io/cluster-service: "true"
  68. version: v2.2.0
  69. # This annotation ensures that fluentd does not get evicted if the node
  70. # supports critical pod annotation based priority scheme.
  71. # Note that this does not guarantee admission on the nodes (#40573).
  72. annotations:
  73. scheduler.alpha.kubernetes.io/critical-pod: ''
  74. seccomp.security.alpha.kubernetes.io/pod: 'docker/default'
  75. spec:
  76. # priorityClassName: system-node-critical
  77. serviceAccountName: fluentd-es
  78. containers:
  79. - name: fluentd-es
  80. image: dotbalo/fluentd-elasticsearch:v2.2.0
  81. env:
  82. - name: FLUENTD_ARGS
  83. value: --no-supervisor -q
  84. resources:
  85. limits:
  86. memory: 500Mi
  87. requests:
  88. cpu: 100m
  89. memory: 200Mi
  90. volumeMounts:
  91. - name: varlog
  92. mountPath: /var/log
  93. - name: varlibdockercontainers
  94. mountPath: /var/lib/docker/containers
  95. readOnly: true
  96. - name: config-volume
  97. mountPath: /etc/fluent/config.d
  98. nodeSelector:
  99. beta.kubernetes.io/fluentd-ds-ready: "true"
  100. terminationGracePeriodSeconds: 30
  101. tolerations:
  102. - effect: NoSchedule
  103. key: node-role.kubernetes.io/master
  104. operator: Exists
  105. volumes:
  106. - name: varlog
  107. hostPath:
  108. path: /var/log
  109. - name: varlibdockercontainers
  110. hostPath:
  111. path: /var/lib/docker/containers
  112. - name: config-volume
  113. configMap:
  114. name: fluentd-es-config-v0.1.4