kibana.j2 4.9 KB

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