From d5879135f077e4aaaa09c8e4ebf5d9ef2a063a78 Mon Sep 17 00:00:00 2001 From: Eric Wolinetz Date: Fri, 5 Jan 2018 11:06:43 -0600 Subject: Adding support for ES 5.x tech preview opt in --- .../files/2.x/eventrouter-template.yaml | 103 +++++++++++++++++++ .../files/5.x/eventrouter-template.yaml | 103 +++++++++++++++++++ .../files/eventrouter-template.yaml | 103 ------------------- .../tasks/install_eventrouter.yaml | 2 +- .../templates/5.x/eventrouter-template.j2 | 109 +++++++++++++++++++++ .../templates/eventrouter-template.j2 | 109 --------------------- 6 files changed, 316 insertions(+), 213 deletions(-) create mode 100644 roles/openshift_logging_eventrouter/files/2.x/eventrouter-template.yaml create mode 100644 roles/openshift_logging_eventrouter/files/5.x/eventrouter-template.yaml delete mode 100644 roles/openshift_logging_eventrouter/files/eventrouter-template.yaml create mode 100644 roles/openshift_logging_eventrouter/templates/5.x/eventrouter-template.j2 delete mode 100644 roles/openshift_logging_eventrouter/templates/eventrouter-template.j2 (limited to 'roles/openshift_logging_eventrouter') diff --git a/roles/openshift_logging_eventrouter/files/2.x/eventrouter-template.yaml b/roles/openshift_logging_eventrouter/files/2.x/eventrouter-template.yaml new file mode 100644 index 000000000..cc01c010d --- /dev/null +++ b/roles/openshift_logging_eventrouter/files/2.x/eventrouter-template.yaml @@ -0,0 +1,103 @@ +# this openshift template should match (except nodeSelector) jinja2 template in +# ../templates/eventrouter-template.j2 +kind: Template +apiVersion: v1 +metadata: + name: eventrouter-template + annotations: + description: "A pod forwarding kubernetes events to EFK aggregated logging stack." + tags: "events,EFK,logging" +objects: + - kind: ServiceAccount + apiVersion: v1 + metadata: + name: aggregated-logging-eventrouter + - kind: ClusterRole + apiVersion: v1 + metadata: + name: event-reader + rules: + - apiGroups: [""] + resources: ["events"] + verbs: ["get", "watch", "list"] + - kind: ConfigMap + apiVersion: v1 + metadata: + name: logging-eventrouter + data: + config.json: |- + { + "sink": "${SINK}" + } + - kind: DeploymentConfig + apiVersion: v1 + metadata: + name: logging-eventrouter + labels: + component: eventrouter + logging-infra: eventrouter + provider: openshift + spec: + selector: + component: eventrouter + logging-infra: eventrouter + provider: openshift + replicas: ${REPLICAS} + template: + metadata: + labels: + component: eventrouter + logging-infra: eventrouter + provider: openshift + name: logging-eventrouter + spec: + serviceAccount: aggregated-logging-eventrouter + serviceAccountName: aggregated-logging-eventrouter + containers: + - name: kube-eventrouter + image: ${IMAGE} + imagePullPolicy: IfNotPresent + resources: + limits: + memory: ${MEMORY} + cpu: ${CPU} + requires: + memory: ${MEMORY} + volumeMounts: + - name: config-volume + mountPath: /etc/eventrouter + volumes: + - name: config-volume + configMap: + name: logging-eventrouter + - kind: ClusterRoleBinding + apiVersion: v1 + metadata: + name: event-reader-binding + subjects: + - kind: ServiceAccount + name: aggregated-logging-eventrouter + namespace: ${NAMESPACE} + roleRef: + kind: ClusterRole + name: event-reader + +parameters: + - name: SINK + displayName: Sink + value: stdout + - name: REPLICAS + displayName: Replicas + value: "1" + - name: IMAGE + displayName: Image + value: "docker.io/openshift/origin-logging-eventrouter:latest" + - name: MEMORY + displayName: Memory + value: "128Mi" + - name: CPU + displayName: CPU + value: "100m" + - name: NAMESPACE + displayName: Namespace + value: default diff --git a/roles/openshift_logging_eventrouter/files/5.x/eventrouter-template.yaml b/roles/openshift_logging_eventrouter/files/5.x/eventrouter-template.yaml new file mode 100644 index 000000000..cc01c010d --- /dev/null +++ b/roles/openshift_logging_eventrouter/files/5.x/eventrouter-template.yaml @@ -0,0 +1,103 @@ +# this openshift template should match (except nodeSelector) jinja2 template in +# ../templates/eventrouter-template.j2 +kind: Template +apiVersion: v1 +metadata: + name: eventrouter-template + annotations: + description: "A pod forwarding kubernetes events to EFK aggregated logging stack." + tags: "events,EFK,logging" +objects: + - kind: ServiceAccount + apiVersion: v1 + metadata: + name: aggregated-logging-eventrouter + - kind: ClusterRole + apiVersion: v1 + metadata: + name: event-reader + rules: + - apiGroups: [""] + resources: ["events"] + verbs: ["get", "watch", "list"] + - kind: ConfigMap + apiVersion: v1 + metadata: + name: logging-eventrouter + data: + config.json: |- + { + "sink": "${SINK}" + } + - kind: DeploymentConfig + apiVersion: v1 + metadata: + name: logging-eventrouter + labels: + component: eventrouter + logging-infra: eventrouter + provider: openshift + spec: + selector: + component: eventrouter + logging-infra: eventrouter + provider: openshift + replicas: ${REPLICAS} + template: + metadata: + labels: + component: eventrouter + logging-infra: eventrouter + provider: openshift + name: logging-eventrouter + spec: + serviceAccount: aggregated-logging-eventrouter + serviceAccountName: aggregated-logging-eventrouter + containers: + - name: kube-eventrouter + image: ${IMAGE} + imagePullPolicy: IfNotPresent + resources: + limits: + memory: ${MEMORY} + cpu: ${CPU} + requires: + memory: ${MEMORY} + volumeMounts: + - name: config-volume + mountPath: /etc/eventrouter + volumes: + - name: config-volume + configMap: + name: logging-eventrouter + - kind: ClusterRoleBinding + apiVersion: v1 + metadata: + name: event-reader-binding + subjects: + - kind: ServiceAccount + name: aggregated-logging-eventrouter + namespace: ${NAMESPACE} + roleRef: + kind: ClusterRole + name: event-reader + +parameters: + - name: SINK + displayName: Sink + value: stdout + - name: REPLICAS + displayName: Replicas + value: "1" + - name: IMAGE + displayName: Image + value: "docker.io/openshift/origin-logging-eventrouter:latest" + - name: MEMORY + displayName: Memory + value: "128Mi" + - name: CPU + displayName: CPU + value: "100m" + - name: NAMESPACE + displayName: Namespace + value: default diff --git a/roles/openshift_logging_eventrouter/files/eventrouter-template.yaml b/roles/openshift_logging_eventrouter/files/eventrouter-template.yaml deleted file mode 100644 index cc01c010d..000000000 --- a/roles/openshift_logging_eventrouter/files/eventrouter-template.yaml +++ /dev/null @@ -1,103 +0,0 @@ -# this openshift template should match (except nodeSelector) jinja2 template in -# ../templates/eventrouter-template.j2 -kind: Template -apiVersion: v1 -metadata: - name: eventrouter-template - annotations: - description: "A pod forwarding kubernetes events to EFK aggregated logging stack." - tags: "events,EFK,logging" -objects: - - kind: ServiceAccount - apiVersion: v1 - metadata: - name: aggregated-logging-eventrouter - - kind: ClusterRole - apiVersion: v1 - metadata: - name: event-reader - rules: - - apiGroups: [""] - resources: ["events"] - verbs: ["get", "watch", "list"] - - kind: ConfigMap - apiVersion: v1 - metadata: - name: logging-eventrouter - data: - config.json: |- - { - "sink": "${SINK}" - } - - kind: DeploymentConfig - apiVersion: v1 - metadata: - name: logging-eventrouter - labels: - component: eventrouter - logging-infra: eventrouter - provider: openshift - spec: - selector: - component: eventrouter - logging-infra: eventrouter - provider: openshift - replicas: ${REPLICAS} - template: - metadata: - labels: - component: eventrouter - logging-infra: eventrouter - provider: openshift - name: logging-eventrouter - spec: - serviceAccount: aggregated-logging-eventrouter - serviceAccountName: aggregated-logging-eventrouter - containers: - - name: kube-eventrouter - image: ${IMAGE} - imagePullPolicy: IfNotPresent - resources: - limits: - memory: ${MEMORY} - cpu: ${CPU} - requires: - memory: ${MEMORY} - volumeMounts: - - name: config-volume - mountPath: /etc/eventrouter - volumes: - - name: config-volume - configMap: - name: logging-eventrouter - - kind: ClusterRoleBinding - apiVersion: v1 - metadata: - name: event-reader-binding - subjects: - - kind: ServiceAccount - name: aggregated-logging-eventrouter - namespace: ${NAMESPACE} - roleRef: - kind: ClusterRole - name: event-reader - -parameters: - - name: SINK - displayName: Sink - value: stdout - - name: REPLICAS - displayName: Replicas - value: "1" - - name: IMAGE - displayName: Image - value: "docker.io/openshift/origin-logging-eventrouter:latest" - - name: MEMORY - displayName: Memory - value: "128Mi" - - name: CPU - displayName: CPU - value: "100m" - - name: NAMESPACE - displayName: Namespace - value: default diff --git a/roles/openshift_logging_eventrouter/tasks/install_eventrouter.yaml b/roles/openshift_logging_eventrouter/tasks/install_eventrouter.yaml index cbbc6a8ec..fffdd9f8b 100644 --- a/roles/openshift_logging_eventrouter/tasks/install_eventrouter.yaml +++ b/roles/openshift_logging_eventrouter/tasks/install_eventrouter.yaml @@ -23,7 +23,7 @@ # create EventRouter deployment config - name: Generate EventRouter template template: - src: eventrouter-template.j2 + src: "{{ __base_file_dir }}/eventrouter-template.j2" dest: "{{ tempdir }}/templates/eventrouter-template.yaml" vars: node_selector: "{{ openshift_logging_eventrouter_nodeselector | default({}) }}" diff --git a/roles/openshift_logging_eventrouter/templates/5.x/eventrouter-template.j2 b/roles/openshift_logging_eventrouter/templates/5.x/eventrouter-template.j2 new file mode 100644 index 000000000..3bd29163b --- /dev/null +++ b/roles/openshift_logging_eventrouter/templates/5.x/eventrouter-template.j2 @@ -0,0 +1,109 @@ +# this jinja2 template should always match (except nodeSelector) openshift template in +# ../files/eventrouter-template.yaml +kind: Template +apiVersion: v1 +metadata: + name: eventrouter-template + annotations: + description: "A pod forwarding kubernetes events to EFK aggregated logging stack." + tags: "events,EFK,logging" +objects: + - kind: ServiceAccount + apiVersion: v1 + metadata: + name: aggregated-logging-eventrouter + - kind: ClusterRole + apiVersion: v1 + metadata: + name: event-reader + rules: + - apiGroups: [""] + resources: ["events"] + verbs: ["get", "watch", "list"] + - kind: ConfigMap + apiVersion: v1 + metadata: + name: logging-eventrouter + data: + config.json: |- + { + "sink": "${SINK}" + } + - kind: DeploymentConfig + apiVersion: v1 + metadata: + name: logging-eventrouter + labels: + component: eventrouter + logging-infra: eventrouter + provider: openshift + spec: + selector: + component: eventrouter + logging-infra: eventrouter + provider: openshift + replicas: "${{ '{{' }}REPLICAS{{ '}}' }}" + template: + metadata: + labels: + component: eventrouter + logging-infra: eventrouter + provider: openshift + name: logging-eventrouter + spec: + serviceAccount: aggregated-logging-eventrouter + serviceAccountName: aggregated-logging-eventrouter +{% if node_selector is iterable and node_selector | length > 0 %} + nodeSelector: +{% for key, value in node_selector.items() %} + {{ key }}: "{{ value }}" +{% endfor %} +{% endif %} + containers: + - name: kube-eventrouter + image: ${IMAGE} + imagePullPolicy: IfNotPresent + resources: + limits: + memory: ${MEMORY} + requires: + cpu: ${CPU} + memory: ${MEMORY} + volumeMounts: + - name: config-volume + mountPath: /etc/eventrouter + volumes: + - name: config-volume + configMap: + name: logging-eventrouter + - kind: ClusterRoleBinding + apiVersion: v1 + metadata: + name: event-reader-binding + subjects: + - kind: ServiceAccount + name: aggregated-logging-eventrouter + namespace: ${NAMESPACE} + roleRef: + kind: ClusterRole + name: event-reader + +parameters: + - name: SINK + displayName: Sink + value: stdout + - name: REPLICAS + displayName: Replicas + value: "1" + - name: IMAGE + displayName: Image + value: "docker.io/openshift/origin-logging-eventrouter:latest" + - name: MEMORY + displayName: Memory + value: "128Mi" + - name: CPU + displayName: CPU + value: "100m" + - name: NAMESPACE + displayName: Namespace + value: default diff --git a/roles/openshift_logging_eventrouter/templates/eventrouter-template.j2 b/roles/openshift_logging_eventrouter/templates/eventrouter-template.j2 deleted file mode 100644 index 3bd29163b..000000000 --- a/roles/openshift_logging_eventrouter/templates/eventrouter-template.j2 +++ /dev/null @@ -1,109 +0,0 @@ -# this jinja2 template should always match (except nodeSelector) openshift template in -# ../files/eventrouter-template.yaml -kind: Template -apiVersion: v1 -metadata: - name: eventrouter-template - annotations: - description: "A pod forwarding kubernetes events to EFK aggregated logging stack." - tags: "events,EFK,logging" -objects: - - kind: ServiceAccount - apiVersion: v1 - metadata: - name: aggregated-logging-eventrouter - - kind: ClusterRole - apiVersion: v1 - metadata: - name: event-reader - rules: - - apiGroups: [""] - resources: ["events"] - verbs: ["get", "watch", "list"] - - kind: ConfigMap - apiVersion: v1 - metadata: - name: logging-eventrouter - data: - config.json: |- - { - "sink": "${SINK}" - } - - kind: DeploymentConfig - apiVersion: v1 - metadata: - name: logging-eventrouter - labels: - component: eventrouter - logging-infra: eventrouter - provider: openshift - spec: - selector: - component: eventrouter - logging-infra: eventrouter - provider: openshift - replicas: "${{ '{{' }}REPLICAS{{ '}}' }}" - template: - metadata: - labels: - component: eventrouter - logging-infra: eventrouter - provider: openshift - name: logging-eventrouter - spec: - serviceAccount: aggregated-logging-eventrouter - serviceAccountName: aggregated-logging-eventrouter -{% if node_selector is iterable and node_selector | length > 0 %} - nodeSelector: -{% for key, value in node_selector.items() %} - {{ key }}: "{{ value }}" -{% endfor %} -{% endif %} - containers: - - name: kube-eventrouter - image: ${IMAGE} - imagePullPolicy: IfNotPresent - resources: - limits: - memory: ${MEMORY} - requires: - cpu: ${CPU} - memory: ${MEMORY} - volumeMounts: - - name: config-volume - mountPath: /etc/eventrouter - volumes: - - name: config-volume - configMap: - name: logging-eventrouter - - kind: ClusterRoleBinding - apiVersion: v1 - metadata: - name: event-reader-binding - subjects: - - kind: ServiceAccount - name: aggregated-logging-eventrouter - namespace: ${NAMESPACE} - roleRef: - kind: ClusterRole - name: event-reader - -parameters: - - name: SINK - displayName: Sink - value: stdout - - name: REPLICAS - displayName: Replicas - value: "1" - - name: IMAGE - displayName: Image - value: "docker.io/openshift/origin-logging-eventrouter:latest" - - name: MEMORY - displayName: Memory - value: "128Mi" - - name: CPU - displayName: CPU - value: "100m" - - name: NAMESPACE - displayName: Namespace - value: default -- cgit v1.2.3