kibana.j2 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. serviceAccountName: aggregated-logging-kibana
  30. {% if kibana_node_selector is iterable and kibana_node_selector | length > 0 %}
  31. nodeSelector:
  32. {% for key, value in kibana_node_selector.iteritems() %}
  33. {{ key }}: "{{ value }}"
  34. {% endfor %}
  35. {% endif %}
  36. containers:
  37. -
  38. name: "kibana"
  39. image: {{ image }}
  40. imagePullPolicy: Always
  41. {% 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 != "") %}
  42. resources:
  43. limits:
  44. {% if kibana_cpu_limit is not none and kibana_cpu_limit != "" %}
  45. cpu: "{{ kibana_cpu_limit }}"
  46. {% endif %}
  47. {% if kibana_memory_limit is not none and kibana_memory_limit != "" %}
  48. memory: "{{ kibana_memory_limit }}"
  49. requests:
  50. memory: "{{ kibana_memory_limit }}"
  51. {% endif %}
  52. {% endif %}
  53. env:
  54. - name: "ES_HOST"
  55. value: "{{ es_host }}"
  56. - name: "ES_PORT"
  57. value: "{{ es_port }}"
  58. -
  59. name: "KIBANA_MEMORY_LIMIT"
  60. valueFrom:
  61. resourceFieldRef:
  62. containerName: kibana
  63. resource: limits.memory
  64. volumeMounts:
  65. - name: kibana
  66. mountPath: /etc/kibana/keys
  67. readOnly: true
  68. readinessProbe:
  69. exec:
  70. command:
  71. - "/usr/share/kibana/probe/readiness.sh"
  72. initialDelaySeconds: 5
  73. timeoutSeconds: 4
  74. periodSeconds: 5
  75. -
  76. name: "kibana-proxy"
  77. image: {{ proxy_image }}
  78. imagePullPolicy: Always
  79. {% 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 != "") %}
  80. resources:
  81. limits:
  82. {% if kibana_proxy_cpu_limit is not none and kibana_proxy_cpu_limit != "" %}
  83. cpu: "{{ kibana_proxy_cpu_limit }}"
  84. {% endif %}
  85. {% if kibana_proxy_memory_limit is not none and kibana_proxy_memory_limit != "" %}
  86. memory: "{{ kibana_proxy_memory_limit }}"
  87. requests:
  88. memory: "{{ kibana_proxy_memory_limit }}"
  89. {% endif %}
  90. {% endif %}
  91. ports:
  92. -
  93. name: "oaproxy"
  94. containerPort: 3000
  95. env:
  96. -
  97. name: "OAP_BACKEND_URL"
  98. value: "http://localhost:5601"
  99. -
  100. name: "OAP_AUTH_MODE"
  101. value: "oauth2"
  102. -
  103. name: "OAP_TRANSFORM"
  104. value: "user_header,token_header"
  105. -
  106. name: "OAP_OAUTH_ID"
  107. value: kibana-proxy
  108. -
  109. name: "OAP_MASTER_URL"
  110. value: {{ openshift_logging_kibana_master_url }}
  111. -
  112. name: "OAP_PUBLIC_MASTER_URL"
  113. value: {{ openshift_logging_kibana_master_public_url }}
  114. -
  115. name: "OAP_LOGOUT_REDIRECT"
  116. value: {{ openshift_logging_kibana_master_public_url }}/console/logout
  117. -
  118. name: "OAP_MASTER_CA_FILE"
  119. value: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
  120. -
  121. name: "OAP_DEBUG"
  122. value: "{{ openshift_logging_kibana_proxy_debug }}"
  123. -
  124. name: "OAP_OAUTH_SECRET_FILE"
  125. value: "/secret/oauth-secret"
  126. -
  127. name: "OAP_SERVER_CERT_FILE"
  128. value: "/secret/server-cert"
  129. -
  130. name: "OAP_SERVER_KEY_FILE"
  131. value: "/secret/server-key"
  132. -
  133. name: "OAP_SERVER_TLS_FILE"
  134. value: "/secret/server-tls.json"
  135. -
  136. name: "OAP_SESSION_SECRET_FILE"
  137. value: "/secret/session-secret"
  138. -
  139. name: "OCP_AUTH_PROXY_MEMORY_LIMIT"
  140. valueFrom:
  141. resourceFieldRef:
  142. containerName: kibana-proxy
  143. resource: limits.memory
  144. volumeMounts:
  145. - name: kibana-proxy
  146. mountPath: /secret
  147. readOnly: true
  148. volumes:
  149. - name: kibana
  150. secret:
  151. secretName: logging-kibana
  152. - name: kibana-proxy
  153. secret:
  154. secretName: logging-kibana-proxy