diff --git a/opentelemetry-operator/chart/Chart.yaml b/opentelemetry-operator/chart/Chart.yaml index 7cb196be..0fbdb85c 100644 --- a/opentelemetry-operator/chart/Chart.yaml +++ b/opentelemetry-operator/chart/Chart.yaml @@ -3,7 +3,7 @@ apiVersion: v2 name: opentelemetry-operator -version: 0.0.15 +version: 0.0.16 description: OpenTelemetry Operator Helm chart for Kubernetes icon: https://raw.githubusercontent.com/cncf/artwork/a718fa97fffec1b9fd14147682e9e3ac0c8817cb/projects/opentelemetry/icon/color/opentelemetry-icon-color.png type: application diff --git a/opentelemetry-operator/chart/templates/clusterrole.yaml b/opentelemetry-operator/chart/templates/clusterrole.yaml new file mode 100644 index 00000000..ea795b67 --- /dev/null +++ b/opentelemetry-operator/chart/templates/clusterrole.yaml @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: logs-collector + labels: + app: logs-collector +rules: +- apiGroups: [""] + resources: ["pods", "namespaces", "nodes"] + verbs: ["get", "watch", "list"] +- apiGroups: ["apps"] + resources: ["replicasets"] + verbs: ["get", "list", "watch"] +- apiGroups: ["extensions"] + resources: ["replicasets"] + verbs: ["get", "list", "watch"] diff --git a/opentelemetry-operator/chart/templates/clusterrolebindings.yaml b/opentelemetry-operator/chart/templates/clusterrolebindings.yaml new file mode 100644 index 00000000..8a3523eb --- /dev/null +++ b/opentelemetry-operator/chart/templates/clusterrolebindings.yaml @@ -0,0 +1,17 @@ +# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: logs-collector + labels: + app: logs-collector +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: logs-collector +subjects: + - kind: ServiceAccount + name: logs-collector + namespace: otel diff --git a/opentelemetry-operator/chart/templates/logs-collector.yaml b/opentelemetry-operator/chart/templates/logs-collector.yaml index 98956899..aae2c807 100644 --- a/opentelemetry-operator/chart/templates/logs-collector.yaml +++ b/opentelemetry-operator/chart/templates/logs-collector.yaml @@ -8,17 +8,23 @@ kind: OpenTelemetryCollector metadata: name: logs spec: - mode: deployment - image: {{ index .Values "opentelemetry-operator" "manager" "collectorImage" "repository" }}:{{ index .Values "opentelemetry-operator" "manager" "collectorImage" "tag" }} - volumeMounts: - - mountPath: /var/log - name: varlog - readOnly: true - volumes: - - name: varlog - hostPath: - path: /var/log + mode: daemonset + tolerations: + - operator: Exists env: + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: KUBE_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: MY_POD_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP - name: username valueFrom: secretKeyRef: @@ -28,7 +34,25 @@ spec: valueFrom: secretKeyRef: name: otel-basic-auth - key: password + key: password + - name: cluster + value: "{{ .Values.open_telemetry.cluster }}" + - name: region + value: "{{ .Values.open_telemetry.region }}" +{{- if index .Values "opentelemetry-operator" "manager" "podMonitor" "enabled" }} + ports: + - name: prometheus + port: 9999 +{- end }} + image: {{ index .Values "opentelemetry-operator" "manager" "collectorImage" "repository" }}:{{ index .Values "opentelemetry-operator" "manager" "collectorImage" "tag" }} + volumeMounts: + - mountPath: /var/log + name: varlog + readOnly: true + volumes: + - name: varlog + hostPath: + path: /var/log config: | receivers: filelog: @@ -39,41 +63,183 @@ spec: start_at: end retry_on_failure: enabled: true + operators: - - type: router - id: get-format + - id: get-format + type: router routes: - - output: parser-containerd + - output: set-containerd expr: 'body matches "^[^ Z]+Z"' - default: parse-time - # Parse CRI-Containerd format - - type: regex_parser - id: parser-containerd - regex: '^(?P