fluentd.j2 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. apiVersion: extensions/v1beta1
  2. kind: "DaemonSet"
  3. metadata:
  4. name: "{{daemonset_name}}"
  5. labels:
  6. provider: openshift
  7. component: "{{daemonset_component}}"
  8. logging-infra: "{{daemonset_component}}"
  9. spec:
  10. selector:
  11. matchLabels:
  12. provider: openshift
  13. component: "{{daemonset_component}}"
  14. updateStrategy:
  15. type: RollingUpdate
  16. rollingUpdate:
  17. minReadySeconds: 600
  18. template:
  19. metadata:
  20. name: "{{daemonset_container_name}}"
  21. labels:
  22. logging-infra: "{{daemonset_component}}"
  23. provider: openshift
  24. component: "{{daemonset_component}}"
  25. spec:
  26. serviceAccountName: "{{daemonset_serviceAccount}}"
  27. nodeSelector:
  28. {{fluentd_nodeselector_key}}: "{{fluentd_nodeselector_value}}"
  29. containers:
  30. - name: "{{daemonset_container_name}}"
  31. image: "{{openshift_logging_image_prefix}}{{daemonset_name}}:{{openshift_logging_image_version}}"
  32. imagePullPolicy: Always
  33. securityContext:
  34. privileged: true
  35. resources:
  36. limits:
  37. cpu: {{openshift_logging_fluentd_cpu_limit}}
  38. memory: {{openshift_logging_fluentd_memory_limit}}
  39. volumeMounts:
  40. - name: runlogjournal
  41. mountPath: /run/log/journal
  42. - name: varlog
  43. mountPath: /var/log
  44. - name: varlibdockercontainers
  45. mountPath: /var/lib/docker/containers
  46. readOnly: true
  47. - name: config
  48. mountPath: /etc/fluent/configs.d/user
  49. readOnly: true
  50. - name: certs
  51. mountPath: /etc/fluent/keys
  52. readOnly: true
  53. - name: dockerhostname
  54. mountPath: /etc/docker-hostname
  55. readOnly: true
  56. - name: localtime
  57. mountPath: /etc/localtime
  58. readOnly: true
  59. - name: dockercfg
  60. mountPath: /etc/sysconfig/docker
  61. readOnly: true
  62. {% if openshift_logging_use_mux_client | bool %}
  63. - name: muxcerts
  64. mountPath: /etc/fluent/muxkeys
  65. readOnly: true
  66. {% endif %}
  67. env:
  68. - name: "K8S_HOST_URL"
  69. value: "{{openshift_logging_master_url}}"
  70. - name: "ES_HOST"
  71. value: "{{openshift_logging_es_host}}"
  72. - name: "ES_PORT"
  73. value: "{{openshift_logging_es_port}}"
  74. - name: "ES_CLIENT_CERT"
  75. value: "{{openshift_logging_es_client_cert}}"
  76. - name: "ES_CLIENT_KEY"
  77. value: "{{openshift_logging_es_client_key}}"
  78. - name: "ES_CA"
  79. value: "{{openshift_logging_es_ca}}"
  80. - name: "OPS_HOST"
  81. value: "{{ops_host}}"
  82. - name: "OPS_PORT"
  83. value: "{{ops_port}}"
  84. - name: "OPS_CLIENT_CERT"
  85. value: "{{openshift_logging_es_ops_client_cert}}"
  86. - name: "OPS_CLIENT_KEY"
  87. value: "{{openshift_logging_es_ops_client_key}}"
  88. - name: "OPS_CA"
  89. value: "{{openshift_logging_es_ops_ca}}"
  90. - name: "ES_COPY"
  91. value: "{{openshift_logging_fluentd_es_copy|lower}}"
  92. - name: "ES_COPY_HOST"
  93. value: "{{es_copy_host | default('')}}"
  94. - name: "ES_COPY_PORT"
  95. value: "{{es_copy_port | default('')}}"
  96. - name: "ES_COPY_SCHEME"
  97. value: "{{es_copy_scheme | default('https')}}"
  98. - name: "ES_COPY_CLIENT_CERT"
  99. value: "{{es_copy_client_cert | default('')}}"
  100. - name: "ES_COPY_CLIENT_KEY"
  101. value: "{{es_copy_client_key | default('')}}"
  102. - name: "ES_COPY_CA"
  103. value: "{{es_copy_ca | default('')}}"
  104. - name: "ES_COPY_USERNAME"
  105. value: "{{es_copy_username | default('')}}"
  106. - name: "ES_COPY_PASSWORD"
  107. value: "{{es_copy_password | default('')}}"
  108. - name: "OPS_COPY_HOST"
  109. value: "{{ops_copy_host | default('')}}"
  110. - name: "OPS_COPY_PORT"
  111. value: "{{ops_copy_port | default('')}}"
  112. - name: "OPS_COPY_SCHEME"
  113. value: "{{ops_copy_scheme | default('https')}}"
  114. - name: "OPS_COPY_CLIENT_CERT"
  115. value: "{{ops_copy_client_cert | default('')}}"
  116. - name: "OPS_COPY_CLIENT_KEY"
  117. value: "{{ops_copy_client_key | default('')}}"
  118. - name: "OPS_COPY_CA"
  119. value: "{{ops_copy_ca | default('')}}"
  120. - name: "OPS_COPY_USERNAME"
  121. value: "{{ops_copy_username | default('')}}"
  122. - name: "OPS_COPY_PASSWORD"
  123. value: "{{ops_copy_password | default('')}}"
  124. - name: "USE_JOURNAL"
  125. value: "{{openshift_logging_fluentd_use_journal|lower}}"
  126. - name: "JOURNAL_SOURCE"
  127. value: "{{openshift_logging_fluentd_journal_source | default('')}}"
  128. - name: "JOURNAL_READ_FROM_HEAD"
  129. value: "{{openshift_logging_fluentd_journal_read_from_head|lower}}"
  130. - name: "USE_MUX_CLIENT"
  131. value: "{{openshift_logging_use_mux_client| default('false')}}"
  132. volumes:
  133. - name: runlogjournal
  134. hostPath:
  135. path: /run/log/journal
  136. - name: varlog
  137. hostPath:
  138. path: /var/log
  139. - name: varlibdockercontainers
  140. hostPath:
  141. path: /var/lib/docker/containers
  142. - name: config
  143. configMap:
  144. name: logging-fluentd
  145. - name: certs
  146. secret:
  147. secretName: logging-fluentd
  148. - name: dockerhostname
  149. hostPath:
  150. path: /etc/hostname
  151. - name: localtime
  152. hostPath:
  153. path: /etc/localtime
  154. - name: dockercfg
  155. hostPath:
  156. path: /etc/sysconfig/docker
  157. {% if openshift_logging_use_mux_client | bool %}
  158. - name: muxcerts
  159. secret:
  160. secretName: logging-mux
  161. {% endif %}