Skip to content

Commit 14ea657

Browse files
authored
Merge branch 'master' into metrics-logic
2 parents 79e0024 + fd05a0f commit 14ea657

File tree

69 files changed

+2225
-83
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2225
-83
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
version: "3"
2+
services:
3+
# Jaeger
4+
jaeger:
5+
image: jaegertracing/all-in-one:latest
6+
ports:
7+
- "16686:16686"
8+
- "14268"
9+
- "14250"
10+
11+
#Zipkin
12+
zipkin:
13+
image: openzipkin/zipkin
14+
container_name: zipkin
15+
ports:
16+
- 9411:9411
17+
18+
otel-collector:
19+
image: otel/opentelemetry-collector-contrib:latest
20+
container_name: otel-logzio
21+
command: ["--config=/etc/otel-collector-config.yml"]
22+
volumes:
23+
- ./config.yaml:/etc/otel-collector-config.yml
24+
ports:
25+
- "1888:1888" # pprof extension
26+
- "8888:8888" # Prometheus metrics exposed by the collector
27+
- "8889:8889" # Prometheus exporter metrics
28+
- "13133:13133" # health_check extension
29+
- "9411" # Zipkin receiver
30+
- "55680:55679" # zpages extension
31+
depends_on:
32+
- jaeger
33+
- zipkin
34+
35+
# Expose the frontend on http://localhost:8081
36+
hotrod:
37+
image: jaegertracing/example-hotrod:latest
38+
ports:
39+
- "8080:8080"
40+
- "8081:8081"
41+
- "8082:8082"
42+
- "8083:8083"
43+
environment:
44+
JAEGER_ENDPOINT: http://otel-collector:14268/api/traces
45+
depends_on:
46+
- otel-collector
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# configmap
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: filebeat-config
6+
namespace: kube-system
7+
labels:
8+
k8s-app: filebeat
9+
data:
10+
filebeat.yml: |-
11+
filebeat.autodiscover:
12+
providers:
13+
- type: kubernetes
14+
node: ${NODE_NAME}
15+
hints.enabled: true
16+
hints.default_config:
17+
type: container
18+
paths:
19+
- /var/log/containers/*-${data.kubernetes.container.id}.log
20+
include_annotations: '*'
21+
22+
processors:
23+
- add_cloud_metadata: ~
24+
fields:
25+
logzio_codec: ${LOGZIO_CODEC}
26+
token: ${LOGZIO_LOGS_SHIPPING_TOKEN}
27+
cluster: ${CLUSTER_NAME}
28+
type: ${LOGZIO_TYPE}
29+
fields_under_root: true
30+
ignore_older: ${IGNORE_OLDER}
31+
output:
32+
logstash:
33+
hosts: ["${LOGZIO_LOGS_LISTENER_HOST}:5015"]
34+
ssl:
35+
certificate_authorities: ['/etc/pki/tls/certs/AAACertificateServices.crt']
36+
---
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# configmap
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: filebeat-config
6+
namespace: kube-system
7+
labels:
8+
k8s-app: filebeat
9+
data:
10+
filebeat.yml: |-
11+
filebeat.inputs:
12+
- type: container
13+
paths:
14+
- /var/log/containers/*.log
15+
processors:
16+
- add_kubernetes_metadata:
17+
host: ${NODE_NAME}
18+
matchers:
19+
- logs_path:
20+
logs_path: "/var/log/containers/"
21+
22+
processors:
23+
- add_cloud_metadata: ~
24+
fields:
25+
logzio_codec: ${LOGZIO_CODEC}
26+
token: ${LOGZIO_LOGS_SHIPPING_TOKEN}
27+
cluster: ${CLUSTER_NAME}
28+
type: ${LOGZIO_TYPE}
29+
fields_under_root: true
30+
ignore_older: ${IGNORE_OLDER}
31+
output:
32+
logstash:
33+
hosts: ["${LOGZIO_LOGS_LISTENER_HOST}:5015"]
34+
ssl:
35+
certificate_authorities: ['/etc/pki/tls/certs/AAACertificateServices.crt']
36+
---
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
namespace: monitoring
6+
name: event-exporter
7+
---
8+
apiVersion: rbac.authorization.k8s.io/v1
9+
kind: ClusterRoleBinding
10+
metadata:
11+
name: event-exporter
12+
roleRef:
13+
apiGroup: rbac.authorization.k8s.io
14+
kind: ClusterRole
15+
name: view
16+
subjects:
17+
- kind: ServiceAccount
18+
namespace: monitoring
19+
name: event-exporter
20+
---
21+
apiVersion: v1
22+
kind: ConfigMap
23+
metadata:
24+
name: event-exporter-cfg
25+
namespace: monitoring
26+
data:
27+
config.yaml: |
28+
logLevel: ${EXPORTER_LOG_LEVEL}
29+
logFormat: json
30+
route:
31+
routes:
32+
- match:
33+
- receiver: "logzio"
34+
receivers:
35+
- name: "logzio"
36+
webhook:
37+
endpoint: https://${LOGZIO_LOGS_LISTENER_HOST}:8071/?token=${LOGZIO_LOGS_SHIPPING_TOKEN}&type=k8s-events
38+
---
39+
apiVersion: apps/v1
40+
kind: Deployment
41+
metadata:
42+
name: event-exporter
43+
namespace: monitoring
44+
spec:
45+
replicas: 1
46+
template:
47+
metadata:
48+
labels:
49+
app: event-exporter
50+
version: v1
51+
spec:
52+
serviceAccountName: event-exporter
53+
containers:
54+
- name: event-exporter
55+
image: ghcr.io/opsgenie/kubernetes-event-exporter:v0.10
56+
imagePullPolicy: IfNotPresent
57+
args:
58+
- -conf=/data/config.yaml
59+
volumeMounts:
60+
- mountPath: /data
61+
name: cfg
62+
env:
63+
- name: LOGZIO_LOGS_SHIPPING_TOKEN
64+
valueFrom:
65+
secretKeyRef:
66+
name: logzio-events-secret
67+
key: logzio-log-shipping-token
68+
- name: LOGZIO_LOGS_LISTENER_HOST
69+
valueFrom:
70+
secretKeyRef:
71+
name: logzio-events-secret
72+
key: logzio-log-listener
73+
- name: EXPORTER_LOG_LEVEL
74+
value: info
75+
volumes:
76+
- name: cfg
77+
configMap:
78+
name: event-exporter-cfg
79+
selector:
80+
matchLabels:
81+
app: event-exporter
82+
version: v1
83+
---
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: filebeat
5+
namespace: kube-system
6+
labels:
7+
k8s-app: filebeat
8+
---
9+
apiVersion: v1
10+
kind: ConfigMap
11+
metadata:
12+
name: logzio-logs-cert
13+
namespace: kube-system
14+
labels:
15+
k8s-app: filebeat
16+
data:
17+
AAACertificateServices.crt: |-
18+
-----BEGIN CERTIFICATE-----
19+
MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb
20+
MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow
21+
GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj
22+
YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL
23+
MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE
24+
BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM
25+
GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP
26+
ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua
27+
BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe
28+
3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4
29+
YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR
30+
rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm
31+
ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU
32+
oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF
33+
MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v
34+
QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t
35+
b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF
36+
AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q
37+
GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz
38+
Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2
39+
G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi
40+
l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3
41+
smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg==
42+
-----END CERTIFICATE-----
43+
---
44+
apiVersion: rbac.authorization.k8s.io/v1
45+
kind: ClusterRole
46+
metadata:
47+
name: filebeat
48+
labels:
49+
k8s-app: filebeat
50+
rules:
51+
- apiGroups:
52+
- ""
53+
resources:
54+
- namespaces
55+
- pods
56+
verbs:
57+
- get
58+
- watch
59+
- list
60+
---
61+
apiVersion: rbac.authorization.k8s.io/v1
62+
kind: ClusterRoleBinding
63+
metadata:
64+
name: filebeat
65+
subjects:
66+
- kind: ServiceAccount
67+
name: filebeat
68+
namespace: kube-system
69+
roleRef:
70+
kind: ClusterRole
71+
name: filebeat
72+
apiGroup: rbac.authorization.k8s.io
73+
---
74+
apiVersion: apps/v1
75+
kind: DaemonSet
76+
metadata:
77+
name: filebeat
78+
namespace: kube-system
79+
labels:
80+
k8s-app: filebeat
81+
spec:
82+
selector:
83+
matchLabels:
84+
k8s-app: filebeat
85+
template:
86+
metadata:
87+
labels:
88+
k8s-app: filebeat
89+
spec:
90+
serviceAccountName: filebeat
91+
terminationGracePeriodSeconds: 30
92+
hostNetwork: true
93+
dnsPolicy: ClusterFirstWithHostNet
94+
containers:
95+
- name: filebeat
96+
image: "docker.elastic.co/beats/filebeat:7.8.1"
97+
args: [
98+
"-c", "/etc/filebeat.yml",
99+
"-e",
100+
]
101+
env:
102+
- name: NODE_NAME
103+
valueFrom:
104+
fieldRef:
105+
fieldPath: spec.nodeName
106+
- name: LOGZIO_LOGS_SHIPPING_TOKEN
107+
valueFrom:
108+
secretKeyRef:
109+
name: logzio-logs-secret
110+
key: logzio-logs-shipping-token
111+
- name: LOGZIO_LOGS_LISTENER_HOST
112+
valueFrom:
113+
secretKeyRef:
114+
name: logzio-logs-secret
115+
key: logzio-logs-listener
116+
- name: CLUSTER_NAME
117+
valueFrom:
118+
secretKeyRef:
119+
name: logzio-logs-secret
120+
key: cluster-name
121+
- name: IGNORE_OLDER
122+
value: 3h
123+
- name: LOGZIO_CODEC
124+
value: json
125+
- name: LOGZIO_TYPE
126+
value: filebeat-oke
127+
securityContext:
128+
runAsUser: 0
129+
resources:
130+
limits:
131+
memory: 200Mi
132+
requests:
133+
cpu: 100m
134+
memory: 100Mi
135+
volumeMounts:
136+
- name: data
137+
mountPath: /usr/share/filebeat/data
138+
- name: runlog
139+
mountPath: /run/log/
140+
- name: u01data
141+
mountPath: /u01/data/docker/containers/
142+
readOnly: true
143+
- name: varlog
144+
mountPath: /var/log
145+
readOnly: true
146+
- name: config
147+
mountPath: /etc/filebeat.yml
148+
readOnly: true
149+
subPath: filebeat.yml
150+
- name: cert
151+
mountPath: /etc/pki/tls/certs/AAACertificateServices.crt
152+
readOnly: true
153+
subPath: AAACertificateServices.crt
154+
volumes:
155+
- name: runlog
156+
hostPath:
157+
path: /run/log/
158+
- name: u01data
159+
hostPath:
160+
path: /u01/data/docker/containers/
161+
- name: varlog
162+
hostPath:
163+
path: /var/log
164+
- name: data
165+
hostPath:
166+
path: /var/lib/filebeat-data
167+
type: DirectoryOrCreate
168+
- name: cert
169+
configMap:
170+
defaultMode: 384
171+
name: logzio-logs-cert
172+
- name: config
173+
configMap:
174+
defaultMode: 416
175+
name: filebeat-config

0 commit comments

Comments
 (0)