eventrouter-template.j2 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # this jinja2 template should always match (except nodeSelector) openshift template in
  2. # ../files/eventrouter-template.yaml
  3. kind: Template
  4. apiVersion: v1
  5. metadata:
  6. name: eventrouter-template
  7. annotations:
  8. description: "A pod forwarding kubernetes events to EFK aggregated logging stack."
  9. tags: "events,EFK,logging"
  10. objects:
  11. - kind: ServiceAccount
  12. apiVersion: v1
  13. metadata:
  14. name: aggregated-logging-eventrouter
  15. - kind: ClusterRole
  16. apiVersion: v1
  17. metadata:
  18. name: event-reader
  19. rules:
  20. - apiGroups: [""]
  21. resources: ["events"]
  22. verbs: ["get", "watch", "list"]
  23. - kind: ConfigMap
  24. apiVersion: v1
  25. metadata:
  26. name: logging-eventrouter
  27. data:
  28. config.json: |-
  29. {
  30. "sink": "${SINK}"
  31. }
  32. - kind: DeploymentConfig
  33. apiVersion: v1
  34. metadata:
  35. name: logging-eventrouter
  36. labels:
  37. component: eventrouter
  38. logging-infra: eventrouter
  39. provider: openshift
  40. spec:
  41. selector:
  42. component: eventrouter
  43. logging-infra: eventrouter
  44. provider: openshift
  45. replicas: ${REPLICAS}
  46. template:
  47. metadata:
  48. labels:
  49. component: eventrouter
  50. logging-infra: eventrouter
  51. provider: openshift
  52. name: logging-eventrouter
  53. spec:
  54. serviceAccount: aggregated-logging-eventrouter
  55. serviceAccountName: aggregated-logging-eventrouter
  56. {% if node_selector is iterable and node_selector | length > 0 %}
  57. nodeSelector:
  58. {% for key, value in node_selector.iteritems() %}
  59. {{ key }}: "{{ value }}"
  60. {% endfor %}
  61. {% endif %}
  62. containers:
  63. - name: kube-eventrouter
  64. image: ${IMAGE}
  65. imagePullPolicy: Always
  66. resources:
  67. limits:
  68. memory: ${MEMORY}
  69. requires:
  70. cpu: ${CPU}
  71. memory: ${MEMORY}
  72. volumeMounts:
  73. - name: config-volume
  74. mountPath: /etc/eventrouter
  75. volumes:
  76. - name: config-volume
  77. configMap:
  78. name: logging-eventrouter
  79. - kind: ClusterRoleBinding
  80. apiVersion: v1
  81. metadata:
  82. name: event-reader-binding
  83. subjects:
  84. - kind: ServiceAccount
  85. name: aggregated-logging-eventrouter
  86. namespace: ${NAMESPACE}
  87. roleRef:
  88. kind: ClusterRole
  89. name: event-reader
  90. parameters:
  91. - name: SINK
  92. displayName: Sink
  93. value: stdout
  94. - name: REPLICAS
  95. displayName: Replicas
  96. value: "1"
  97. - name: IMAGE
  98. displayName: Image
  99. value: "docker.io/openshift/origin-logging-eventrouter:latest"
  100. - name: MEMORY
  101. displayName: Memory
  102. value: "128Mi"
  103. - name: CPU
  104. displayName: CPU
  105. value: "100m"
  106. - name: NAMESPACE
  107. displayName: Namespace
  108. value: default