apiVersion: v1
kind: ConfigMap
metadata:
name: custom-otel-collector-config
data:
otel-collector-config.yaml: |
receivers:
otlp:
protocols:
grpc:
exporters:
debug: {}
prometheus:
service:
pipelines:
traces:
receivers: [otlp]
exporters: [debug]
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: custom-otel-collector-deployment
spec:
replicas: 1
selector:
matchLabels:
component: otel-collector
template:
metadata:
labels:
component: otel-collector
spec:
containers:
- name: opentelemetry-collector
image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest
command:
- "/otelcol-contrib"
- "--config=/conf/otel-collector-config.yaml"
ports:
- name: otlp
containerPort: 4317
protocol: TCP
volumeMounts:
- name: otel-collector-config-vol
mountPath: /conf
readOnly: true
volumes:
- name: otel-collector-config-vol
configMap:
name: custom-otel-collector-config
---
apiVersion: v1
kind: Service
metadata:
name: custom-otel-collector-service
labels:
component: otel-collector
spec:
type: ClusterIP
ports:
- name: otlp-grpc
port: 4317
targetPort: 4317
selector:
component: otel-collector
apiVersion: v1
kind: ConfigMap
metadata:
name: custom-otel-collector-config
data:
otel-collector-config.yaml: |
receivers:
otlp:
protocols:
grpc:
exporters:
debug: {}
prometheus:
service:
pipelines:
traces:
receivers: [otlp]
exporters: [debug]
1
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: custom-otel-collector-deployment
spec:
replicas: 1
selector:
matchLabels:
component: otel-collector
template:
metadata:
labels:
component: otel-collector
spec:
containers:
- name: opentelemetry-collector
image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest
2
command:
- "/otelcol-contrib"
- "--config=/conf/otel-collector-config.yaml"
ports:
- name: otlp
containerPort: 4317
protocol: TCP
volumeMounts:
- name: otel-collector-config-vol
mountPath: /conf
readOnly: true
volumes:
- name: otel-collector-config-vol
configMap:
name: custom-otel-collector-config
---
apiVersion: v1
kind: Service
metadata:
name: custom-otel-collector-service
3
labels:
component: otel-collector
spec:
type: ClusterIP
ports:
- name: otlp-grpc
port: 4317
targetPort: 4317
selector:
component: otel-collector
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow