diff --git a/dp-terraform/helm/rhacs-terraform/charts/logging/README.md b/dp-terraform/helm/rhacs-terraform/charts/logging/README.md index ce9d937106..cc435b89a2 100644 --- a/dp-terraform/helm/rhacs-terraform/charts/logging/README.md +++ b/dp-terraform/helm/rhacs-terraform/charts/logging/README.md @@ -1,6 +1,7 @@ # Data plane terraform logging Helm chart This chart installs resource into `openshift-logging` namespace. This namespace is Openshift dedicated namespace for logging stack for OSD cluster. +It installs on top the openshift eventrouter in order to log kubernetes events in the `openshift-logging` namespace. ## Custom resource definitions diff --git a/dp-terraform/helm/rhacs-terraform/charts/logging/templates/02-eventrouter-01-rbac.yaml b/dp-terraform/helm/rhacs-terraform/charts/logging/templates/02-eventrouter-01-rbac.yaml new file mode 100644 index 0000000000..75e0eac081 --- /dev/null +++ b/dp-terraform/helm/rhacs-terraform/charts/logging/templates/02-eventrouter-01-rbac.yaml @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: eventrouter + namespace: openshift-logging +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: event-reader +rules: +- apiGroups: [""] + resources: ["events"] + verbs: ["get", "watch", "list"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: event-reader-binding +subjects: +- kind: ServiceAccount + name: eventrouter + namespace: openshift-logging +roleRef: + aoiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: event-reader diff --git a/dp-terraform/helm/rhacs-terraform/charts/logging/templates/02-eventrouter-02-configmap.yaml b/dp-terraform/helm/rhacs-terraform/charts/logging/templates/02-eventrouter-02-configmap.yaml new file mode 100644 index 0000000000..f062ff641f --- /dev/null +++ b/dp-terraform/helm/rhacs-terraform/charts/logging/templates/02-eventrouter-02-configmap.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: eventrouter + namespace: openshift-logging +data: + config.json: |- + { + "sink": "stdout" + } diff --git a/dp-terraform/helm/rhacs-terraform/charts/logging/templates/02-eventrouter-03-deployment.yaml b/dp-terraform/helm/rhacs-terraform/charts/logging/templates/02-eventrouter-03-deployment.yaml new file mode 100644 index 0000000000..6dd3a6d7ee --- /dev/null +++ b/dp-terraform/helm/rhacs-terraform/charts/logging/templates/02-eventrouter-03-deployment.yaml @@ -0,0 +1,39 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: eventrouter + namespace: openshift-logging + labels: + component: "eventrouter" + logging-infra: "eventrouter" + provider: "openshift" +spec: + replicas: 1 + selector: + component: "eventrouter" + logging-infra: "eventrouter" + provider: "openshift" + template: + metadata: + labels: + component: "eventrouter" + logging-infra: "eventrouter" + provider: "openshift" + name: eventrouter + spec: + serviceAccount: eventrouter + containers: + - name: kube-eventrouter + image: "registry.redhat.io/openshift-logging/eventrouter-rhel8:v0.4" + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: "100m" + memory: "128Mi" + volumeMounts: + - name: config-volume + mountPath: /etc/eventrouter + volumes: + - name: config-volume + configMap: + name: eventrouter