kibana.j2 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. apiVersion: "v1"
  2. kind: "DeploymentConfig"
  3. metadata:
  4. name: "{{ deploy_name }}"
  5. labels:
  6. provider: openshift
  7. component: "{{ component }}"
  8. logging-infra: "{{ logging_component }}"
  9. spec:
  10. replicas: {{ kibana_replicas | default(1) }}
  11. selector:
  12. provider: openshift
  13. component: "{{ component }}"
  14. logging-infra: "{{ logging_component }}"
  15. strategy:
  16. rollingParams:
  17. intervalSeconds: 1
  18. timeoutSeconds: 600
  19. updatePeriodSeconds: 1
  20. type: Rolling
  21. template:
  22. metadata:
  23. name: "{{ deploy_name }}"
  24. labels:
  25. logging-infra: "{{ logging_component }}"
  26. provider: openshift
  27. component: "{{ component }}"
  28. spec:
  29. affinity:
  30. podAntiAffinity:
  31. preferredDuringSchedulingIgnoredDuringExecution:
  32. - weight: 100
  33. podAffinityTerm:
  34. labelSelector:
  35. matchExpressions:
  36. - key: logging-infra
  37. operator: In
  38. values:
  39. - kibana
  40. topologyKey: kubernetes.io/hostname
  41. serviceAccountName: aggregated-logging-kibana
  42. {% if kibana_node_selector is iterable and kibana_node_selector | length > 0 %}
  43. nodeSelector:
  44. {% for key, value in kibana_node_selector.items() %}
  45. {{ key }}: "{{ value }}"
  46. {% endfor %}
  47. {% endif %}
  48. containers:
  49. -
  50. name: "kibana"
  51. image: "{{ openshift_logging_kibana_image }}"
  52. imagePullPolicy: IfNotPresent
  53. {% if (kibana_memory_limit is defined and kibana_memory_limit is not none and kibana_memory_limit != "") or (kibana_cpu_limit is defined and kibana_cpu_limit is not none and kibana_cpu_limit != "") or (kibana_cpu_request is defined and kibana_cpu_request is not none and kibana_cpu_request != "") %}
  54. resources:
  55. {% if (kibana_memory_limit is defined and kibana_memory_limit is not none and kibana_memory_limit != "") or (kibana_cpu_limit is defined and kibana_cpu_limit is not none and kibana_cpu_limit != "") %}
  56. limits:
  57. {% if kibana_cpu_limit is not none and kibana_cpu_limit != "" %}
  58. cpu: "{{ kibana_cpu_limit }}"
  59. {% endif %}
  60. {% if kibana_memory_limit is not none and kibana_memory_limit != "" %}
  61. memory: "{{ kibana_memory_limit }}"
  62. {% endif %}
  63. {% endif %}
  64. {% if (kibana_memory_limit is defined and kibana_memory_limit is not none and kibana_memory_limit != "") or (kibana_cpu_request is defined and kibana_cpu_request is not none and kibana_cpu_request != "") %}
  65. requests:
  66. {% if kibana_cpu_request is not none and kibana_cpu_request != "" %}
  67. cpu: "{{ kibana_cpu_request }}"
  68. {% endif %}
  69. {% if kibana_memory_limit is not none and kibana_memory_limit != "" %}
  70. memory: "{{ kibana_memory_limit }}"
  71. {% endif %}
  72. {% endif %}
  73. {% endif %}
  74. env:
  75. - name: "ELASTICSEARCH_URL"
  76. value: "https://{{ es_host }}:{{ es_port }}"
  77. -
  78. name: "KIBANA_MEMORY_LIMIT"
  79. valueFrom:
  80. resourceFieldRef:
  81. containerName: kibana
  82. resource: limits.memory
  83. volumeMounts:
  84. - name: kibana
  85. mountPath: /etc/kibana/keys
  86. readOnly: true
  87. readinessProbe:
  88. exec:
  89. command:
  90. - "/usr/share/kibana/probe/readiness.sh"
  91. initialDelaySeconds: 5
  92. timeoutSeconds: 4
  93. periodSeconds: 5
  94. -
  95. name: "kibana-proxy"
  96. image: "{{ openshift_logging_kibana_proxy_image }}"
  97. imagePullPolicy: IfNotPresent
  98. {% if (kibana_proxy_memory_limit is defined and kibana_proxy_memory_limit is not none and kibana_proxy_memory_limit != "") or (kibana_proxy_cpu_limit is defined and kibana_proxy_cpu_limit is not none and kibana_proxy_cpu_limit != "") or (kibana_proxy_cpu_request is defined and kibana_proxy_cpu_request is not none and kibana_proxy_cpu_request != "") %}
  99. resources:
  100. {% if (kibana_proxy_memory_limit is defined and kibana_proxy_memory_limit is not none and kibana_proxy_memory_limit != "") or (kibana_proxy_cpu_limit is defined and kibana_proxy_cpu_limit is not none and kibana_proxy_cpu_limit != "") %}
  101. limits:
  102. {% if kibana_proxy_cpu_limit is not none and kibana_proxy_cpu_limit != "" %}
  103. cpu: "{{ kibana_proxy_cpu_limit }}"
  104. {% endif %}
  105. {% if kibana_proxy_memory_limit is not none and kibana_proxy_memory_limit != "" %}
  106. memory: "{{ kibana_proxy_memory_limit }}"
  107. {% endif %}
  108. {% endif %}
  109. {% if (kibana_proxy_memory_limit is defined and kibana_proxy_memory_limit is not none and kibana_proxy_memory_limit != "") or (kibana_proxy_cpu_request is defined and kibana_proxy_cpu_request is not none and kibana_proxy_cpu_request != "") %}
  110. requests:
  111. {% if kibana_proxy_cpu_request is not none and kibana_proxy_cpu_request != "" %}
  112. cpu: "{{ kibana_proxy_cpu_request }}"
  113. {% endif %}
  114. {% if kibana_proxy_memory_limit is not none and kibana_proxy_memory_limit != "" %}
  115. memory: "{{ kibana_proxy_memory_limit }}"
  116. {% endif %}
  117. {% endif %}
  118. {% endif %}
  119. ports:
  120. -
  121. name: "oaproxy"
  122. containerPort: 3000
  123. env:
  124. -
  125. name: "OAP_BACKEND_URL"
  126. value: "http://localhost:5601"
  127. -
  128. name: "OAP_AUTH_MODE"
  129. value: "oauth2"
  130. -
  131. name: "OAP_TRANSFORM"
  132. value: "user_header,token_header"
  133. -
  134. name: "OAP_OAUTH_ID"
  135. value: kibana-proxy
  136. -
  137. name: "OAP_MASTER_URL"
  138. value: {{ openshift_logging_kibana_master_url }}
  139. -
  140. name: "OAP_PUBLIC_MASTER_URL"
  141. value: {{ openshift_logging_kibana_master_public_url }}
  142. -
  143. name: "OAP_LOGOUT_REDIRECT"
  144. value: {{ openshift_logging_kibana_master_public_url }}/console/logout
  145. -
  146. name: "OAP_MASTER_CA_FILE"
  147. value: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
  148. -
  149. name: "OAP_DEBUG"
  150. value: "{{ openshift_logging_kibana_proxy_debug }}"
  151. -
  152. name: "OAP_OAUTH_SECRET_FILE"
  153. value: "/secret/oauth-secret"
  154. -
  155. name: "OAP_SERVER_CERT_FILE"
  156. value: "/secret/server-cert"
  157. -
  158. name: "OAP_SERVER_KEY_FILE"
  159. value: "/secret/server-key"
  160. -
  161. name: "OAP_SERVER_TLS_FILE"
  162. value: "/secret/server-tls.json"
  163. -
  164. name: "OAP_SESSION_SECRET_FILE"
  165. value: "/secret/session-secret"
  166. -
  167. name: "OCP_AUTH_PROXY_MEMORY_LIMIT"
  168. valueFrom:
  169. resourceFieldRef:
  170. containerName: kibana-proxy
  171. resource: limits.memory
  172. volumeMounts:
  173. - name: kibana-proxy
  174. mountPath: /secret
  175. readOnly: true
  176. volumes:
  177. - name: kibana
  178. secret:
  179. secretName: logging-kibana
  180. - name: kibana-proxy
  181. secret:
  182. secretName: logging-kibana-proxy