fluentd-ds.yaml 2.8 KB

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