fluentd.j2 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. - name: dockerdaemoncfg
  63. mountPath: /etc/docker
  64. readOnly: true
  65. env:
  66. - name: "K8S_HOST_URL"
  67. value: "{{ openshift_logging_fluentd_master_url }}"
  68. - name: "ES_HOST"
  69. value: "{{ app_host }}"
  70. - name: "ES_PORT"
  71. value: "{{ app_port }}"
  72. - name: "ES_CLIENT_CERT"
  73. value: "{{ openshift_logging_fluentd_app_client_cert }}"
  74. - name: "ES_CLIENT_KEY"
  75. value: "{{ openshift_logging_fluentd_app_client_key }}"
  76. - name: "ES_CA"
  77. value: "{{ openshift_logging_fluentd_app_ca }}"
  78. - name: "OPS_HOST"
  79. value: "{{ ops_host }}"
  80. - name: "OPS_PORT"
  81. value: "{{ ops_port }}"
  82. - name: "OPS_CLIENT_CERT"
  83. value: "{{ openshift_logging_fluentd_ops_client_cert }}"
  84. - name: "OPS_CLIENT_KEY"
  85. value: "{{ openshift_logging_fluentd_ops_client_key }}"
  86. - name: "OPS_CA"
  87. value: "{{ openshift_logging_fluentd_ops_ca }}"
  88. - name: "ES_COPY"
  89. value: "false"
  90. - name: "USE_JOURNAL"
  91. value: "{{ openshift_logging_fluentd_use_journal | lower }}"
  92. - name: "JOURNAL_SOURCE"
  93. value: "{{ openshift_logging_fluentd_journal_source | default('') }}"
  94. - name: "JOURNAL_READ_FROM_HEAD"
  95. value: "{{ openshift_logging_fluentd_journal_read_from_head | lower }}"
  96. - name: "BUFFER_QUEUE_LIMIT"
  97. value: "{{ openshift_logging_fluentd_buffer_queue_limit }}"
  98. - name: "BUFFER_SIZE_LIMIT"
  99. value: "{{ openshift_logging_fluentd_buffer_size_limit }}"
  100. volumes:
  101. - name: runlogjournal
  102. hostPath:
  103. path: /run/log/journal
  104. - name: varlog
  105. hostPath:
  106. path: /var/log
  107. - name: varlibdockercontainers
  108. hostPath:
  109. path: /var/lib/docker/containers
  110. - name: config
  111. configMap:
  112. name: logging-fluentd
  113. - name: certs
  114. secret:
  115. secretName: logging-fluentd
  116. - name: dockerhostname
  117. hostPath:
  118. path: /etc/hostname
  119. - name: localtime
  120. hostPath:
  121. path: /etc/localtime
  122. - name: dockercfg
  123. hostPath:
  124. path: /etc/sysconfig/docker
  125. - name: dockerdaemoncfg
  126. hostPath:
  127. path: /etc/docker