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

[Research] OTEL collector #647

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
33 changes: 33 additions & 0 deletions chart/templates/otel-collector/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: otel-collector-config
data:
config.yaml: |-
receivers:
otlp:
protocols:
http:
endpoint: 0.0.0.0:4318

processors:
# Data sources: traces, metrics, logs
memory_limiter:
check_interval: 5s
limit_mib: 4000
spike_limit_mib: 500

exporters:
debug:
verbosity: detailed
otlp:
endpoint: 34.135.42.102:4317
tls:
insecure: true

service:
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter]
exporters: [debug, otlp]
59 changes: 59 additions & 0 deletions chart/templates/otel-collector/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: otel-collector
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: otel-collector
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels: matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
app.kubernetes.io/component: otel-collector
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/otel-collector/configmap.yaml") . | sha256sum }}
cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
labels: {{- include "common.labels.standard" . | nindent 8 }}
app.kubernetes.io/component: otel-collector
spec:
securityContext:
fsGroup: 101
supplementalGroups:
- 2345
containers:
- name: otel-collector
ports:
- containerPort: 4318
name: metrics
protocol: TCP
image: otel/opentelemetry-collector-contrib:0.115.1
resources:
limits:
cpu: 100m
memory: 200Mi
requests:
cpu: 100m
memory: 200Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- all
readOnlyRootFilesystem: true
runAsGroup: 101
runAsNonRoot: false
runAsUser: 101
volumeMounts:
- mountPath: /etc/otelcol-contrib/config.yaml
name: data
subPath: config.yaml
readOnly: true
terminationGracePeriodSeconds: 30
volumes:
- name: data
configMap:
name: otel-collector-config
19 changes: 19 additions & 0 deletions chart/templates/otel-collector/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: otel-collector
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: otel-collector
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
spec:
ports:
- name: metrics
port: 4318
protocol: TCP
targetPort: metrics
selector:
{{- include "common.labels.matchLabels" . | nindent 4 }}
app.kubernetes.io/component: otel-collector
Loading