-
Notifications
You must be signed in to change notification settings - Fork 3
/
opentelemetry-gateway.yaml
141 lines (141 loc) · 3.34 KB
/
opentelemetry-gateway.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
---
apiVersion: v1
kind: Namespace
metadata:
name: observability
---
apiVersion: v1
kind: ConfigMap
metadata:
name: opentelemetry-gateway-config
namespace: observability
data:
# TODO: remove hostnetwork-v2 scc and flip exporter config fromlocalhost to ${env:K8S_HOST_IP}.
config.yaml: |
receivers:
kubeletstats:
collection_interval: 20s
auth_type: "serviceAccount"
endpoint: "https://${env:K8S_HOST_IP}:10250"
insecure_skip_verify: true
otlp:
protocols:
grpc:
http:
processors:
batch:
send_batch_size: 10000
timeout: 10s
exporters:
otlp/host:
endpoint: ${env:K8S_HOST_IP}:54317
tls:
insecure: true
insecure_skip_verify: true
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [otlp/host]
metrics:
receivers: [otlp, kubeletstats]
processors: [batch]
exporters: [otlp/host]
logs:
receivers: [otlp]
processors: [batch]
exporters: [otlp/host]
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: opentelemetry-gateway
namespace: observability
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: otel-apiserver
rules:
- apiGroups: ['']
resources: ['nodes/stats']
verbs: ['get', 'watch', 'list']
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: otel-collector
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: otel-apiserver
subjects:
- kind: ServiceAccount
name: opentelemetry-gateway
namespace: observability
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: opentelemetry-gateway
namespace: observability
labels:
app: opentelemetry-gateway
spec:
selector:
matchLabels:
app: opentelemetry-gateway
template:
metadata:
labels:
app: opentelemetry-gateway
spec:
serviceAccountName: opentelemetry-gateway
nodeSelector:
kubernetes.io/os: linux
containers:
- name: opentelemetry-collector
image: ghcr.io/os-observability/redhat-opentelemetry-collector/redhat-opentelemetry-collector:main
command: ["/otelcol", "--config=/etc/opentelemetry/config.yaml"]
# TODO: enable after 3.1 release
# image: registry.redhat.io/rhosdt/opentelemetry-collector-rhel8:0.93.0
# command: ["/go/bin/otelcol-linux", "--config=/etc/opentelemetry/config.yaml"]
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumeMounts:
- name: config-volume
mountPath: /etc/opentelemetry
env:
- name: K8S_HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
volumes:
- name: config-volume
configMap:
name: opentelemetry-gateway-config
---
apiVersion: v1
kind: Service
metadata:
name: gateway
namespace: observability
spec:
ports:
- name: http-otlp
port: 4318
targetPort: 54318
protocol: TCP
- name: grpc-otlp
port: 4317
targetPort: 54317
protocol: TCP
selector:
app: opentelemetry-gateway