Skip to content

Commit e1dea35

Browse files
Simon Emmsroboquat
Simon Emms
authored andcommitted
[kots]: add fluent-bit as log collector
1 parent a365a2a commit e1dea35

File tree

4 files changed

+106
-0
lines changed

4 files changed

+106
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2+
# Licensed under the MIT License. See License-MIT.txt in the project root for license information.
3+
4+
apiVersion: v2
5+
description: Gitpod fluent-bit
6+
name: fluent-bit
7+
version: 0.20.2
8+
dependencies:
9+
- name: fluent-bit
10+
version: 0.20.2
11+
repository: https://fluent.github.io/helm-charts
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2+
# Licensed under the MIT License. See License-MIT.txt in the project root for license information.
3+
4+
apiVersion: kots.io/v1beta1
5+
kind: HelmChart
6+
metadata:
7+
name: fluent-bit
8+
spec:
9+
chart:
10+
name: fluent-bit
11+
chartVersion: 0.20.2
12+
helmVersion: v3
13+
useHelmInstall: true
14+
weight: 10
15+
values:
16+
fluent-bit:
17+
extraVolumes:
18+
- name: collector
19+
hostPath:
20+
path: /gitpod
21+
type: DirectoryOrCreate
22+
23+
extraVolumeMounts:
24+
- name: collector
25+
mountPath: /gitpod
26+
27+
extraContainers:
28+
- name: kots
29+
image: busybox:1
30+
command:
31+
- sh
32+
- -c
33+
args:
34+
- while true; do echo "waiting" && sleep 60; done
35+
volumeMounts:
36+
- name: collector
37+
mountPath: /gitpod
38+
readOnly: true
39+
40+
labels:
41+
app: gitpod
42+
component: gitpod-log-collector
43+
44+
podLabels:
45+
app: gitpod
46+
component: gitpod-log-collector
47+
48+
# Config requires four space indentations
49+
config:
50+
inputs: |
51+
[INPUT]
52+
Name tail
53+
Path /var/log/containers/*.log
54+
Parser docker
55+
Tag <pod_name>.<container_name>
56+
Tag_Regex (?<pod_name>[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_(?<namespace_name>[^_]+)_(?<container_name>.+)-
57+
Skip_Long_Lines On
58+
59+
filters: |
60+
[FILTER]
61+
Name stdout
62+
63+
outputs: |
64+
[OUTPUT]
65+
Name file
66+
Match imagebuild*
67+
Mkdir true
68+
Path /gitpod/log-collector
69+
Format plain
70+
71+
[OUTPUT]
72+
Name file
73+
Match installer*
74+
Mkdir true
75+
Path /gitpod/log-collector
76+
Format plain
77+
78+
# Workspaces
79+
[OUTPUT]
80+
Name file
81+
Match ws*.workspace
82+
Mkdir true
83+
Path /gitpod/log-collector
84+
Format plain

install/kots/manifests/kots-app.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ spec:
2424
- deployment/ws-manager-bridge
2525
- deployment/ws-proxy
2626
- service/proxy
27+
additionalImages:
28+
- cr.fluentbit.io/fluent/fluent-bit:1.9.4 # Defined by Fluent Bit Helm chart
29+
- busybox:1 # Used to pull log files to pull from Fluent Bit, which doesn't container tar binary

install/kots/manifests/kots-support-bundle.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,20 @@ spec:
3838
- clusterInfo: {}
3939
- clusterResources: {}
4040
- logs:
41+
name: logs
4142
selector:
4243
- app=gitpod
4344
namespace: '{{repl Namespace }}'
4445
limits:
4546
maxAge: 720h
4647
maxLines: 10000
48+
- copy:
49+
name: log-collector
50+
selector:
51+
- component=gitpod-log-collector
52+
namespace: '{{repl Namespace }}'
53+
containerPath: /gitpod/log-collector
54+
containerName: kots
4755
- configMap:
4856
selector:
4957
- app=gitpod

0 commit comments

Comments
 (0)