Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support of kubernetes-events monitor #187

Merged
merged 4 commits into from
Sep 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased

### Fixed

- smartagent/kubernetes-events now works with `otelK8sClusterReceiver` deployment. (#187)

## [0.31.0] - 2021-08-10

### Changed
Expand Down
10 changes: 10 additions & 0 deletions helm-charts/splunk-otel-collector/templates/clusterRole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ rules:
verbs: ['use']
resourceNames: [{{ template "splunk-otel-collector.fullname" . }}]
{{- end }}
{{- if .Values.otelK8sClusterReceiver.k8sEventsEnabled }}
- apiGroups:
- ""
resources:
- configmaps
nitaliya marked this conversation as resolved.
Show resolved Hide resolved
verbs:
- get
- update
- patch
{{- end }}
- apiGroups:
- ""
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ receivers:
k8s_cluster:
auth_type: serviceAccount
metadata_exporters: [signalfx]
{{- if .Values.otelK8sClusterReceiver.k8sEventsEnabled }}
smartagent/kubernetes-events:
type: kubernetes-events
whitelistedEvents:
- reason: Created
involvedObjectKind: Pod
- reason: Unhealthy
involvedObjectKind: Pod
- reason: Failed
involvedObjectKind: Pod
- reason: FailedCreate
involvedObjectKind: Job
{{- end }}

processors:
{{- include "splunk-otel-collector.otelMemoryLimiterConfig" .Values.otelK8sClusterReceiver | nindent 2 }}
Expand Down Expand Up @@ -94,4 +107,15 @@ service:
- resource/add_collector_k8s
- resourcedetection
exporters: [signalfx]
{{- if .Values.otelK8sClusterReceiver.k8sEventsEnabled }}
logs/events:
receivers:
- smartagent/kubernetes-events
processors:
- memory_limiter
- batch
- resource
- resourcedetection
exporters: [signalfx]
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.otelK8sClusterReceiver.k8sEventsEnabled }}
- name: MY_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: MY_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
{{- end }}
- name: SPLUNK_ACCESS_TOKEN
valueFrom:
secretKeyRef:
Expand Down
5 changes: 5 additions & 0 deletions helm-charts/splunk-otel-collector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ otelK8sClusterReceiver:
annotations: {}
podAnnotations: {}

# This Flag enables k8s events collection with smartagent/kubernetes-events receiver
# You can override list of events collected by default using the following config option:
# `otelK8sClusterReceiver.config.receivers.smartagent/kubernetes-events.whitelistedEvents`
k8sEventsEnabled: false

# k8s cluster receiver extra pod labels
podLabels: {}

Expand Down