Skip to content

Commit 8cab439

Browse files
author
Milan Rafaj
committed
add fluentbit
1 parent 44b7e54 commit 8cab439

6 files changed

Lines changed: 137 additions & 1 deletion

File tree

charts/repman/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [1.0.4]
2+
### Changed
3+
- Add fluentbit
4+
15
## [1.0.3]
26
### Changed
37
- Add shared session,

charts/repman/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ maintainers:
88
- email: mrafaj@pixelfederation.com
99
name: Milan Rafaj
1010
name: repman
11-
version: 1.0.3
11+
version: 1.0.4

charts/repman/templates/NOTES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
_ _ _
2+
|_)|_|_)|\/| /\ |\ |
3+
| \|_| | |/--\| \|
4+
15
Application pods for {{ .Values.labels.project | default "Missing labels.project value" }} were deployed in version {{ .Values.appVersion }}.
26

37
You can see application pods by using command

charts/repman/templates/deployment.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ spec:
5151
appVersion: "{{ .Values.appVersion }}"
5252
{{ include "toYamlQuote" .Values.labels | indent 8 }}
5353
annotations:
54+
checksum/config: {{ include (print .Template.BasePath "/fluentbit-config.yaml") . | sha256sum }}
5455
{{- with .Values.podAnnotations }}
5556
{{- include "toYamlQuote" . | indent 8 }}
5657
{{- end }}
@@ -128,9 +129,37 @@ spec:
128129
- name: {{ template "fullname" . }}-conf
129130
mountPath: /etc/nginx/nginx.conf
130131
subPath: nginx.conf
132+
- name: fluentbit
133+
image: "{{ required "Fluentbit repository address is required" .Values.containers.fluentbit.repository }}:{{ .Values.containers.fluentbit.repositoryTag }}"
134+
imagePullPolicy: {{ .Values.containers.fluentbit.pullPolicy }}
135+
env:
136+
{{- with .Values.containers.fluentbit.env }}
137+
{{- include "envToList" . | indent 12 }}
138+
{{- end}}
139+
resources:
140+
{{- include "toYamlQuote" .Values.containers.fluentbit.resources | indent 12 }}
141+
volumeMounts:
142+
- name: nginx-log
143+
mountPath: /mnt/nginx
144+
- name: php-log
145+
mountPath: /mnt/php
146+
- name: fluentbit-config-volume
147+
mountPath: /fluent-bit/etc/fluent-bit.conf
148+
subPath: fluent-bit.conf
149+
- name: fluentbit-config-volume
150+
mountPath: /fluent-bit/etc/custom_parsers.conf
151+
subPath: custom_parsers.conf
131152
volumes:
132153
- name: app-dir
133154
emptyDir: {}
155+
- name: fluentbit-config-volume
156+
configMap:
157+
name: fluentbit-config-{{ template "fullname" . }}
158+
items:
159+
- key: fluent-bit.conf
160+
path: fluent-bit.conf
161+
- key: custom_parsers.conf
162+
path: custom_parsers.conf
134163
- name: {{ template "fullname" . }}-conf
135164
configMap:
136165
name: {{ template "fullname" . }}-conf
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: fluentbit-config-{{ template "fullname" . }}
6+
labels:
7+
app: {{ template "name" . }}
8+
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
9+
release: {{ .Release.Name }}
10+
heritage: {{ .Release.Service }}
11+
data:
12+
fluent-bit.conf: |-
13+
[SERVICE]
14+
# Flush
15+
# =====
16+
# Set an interval of seconds before to flush records to a destination
17+
Flush 5
18+
19+
# Grace
20+
# =====
21+
# Wait time (seconds) on exit
22+
Grace 5
23+
24+
# Daemon
25+
# ======
26+
# Instruct Fluent Bit to run in foreground or background mode.
27+
Daemon Off
28+
29+
# Log_Level
30+
# =========
31+
# Set the verbosity level of the service, values can be:
32+
#
33+
# - error
34+
# - warning
35+
# - info
36+
# - debug
37+
# - trace
38+
#
39+
# By default 'info' is set, that means it includes 'error' and 'warning'.
40+
Log_Level info
41+
42+
# Storage options for backpressure
43+
storage.path /var/log/fluentbit/
44+
storage.sync normal
45+
storage.checksum off
46+
storage.backlog.mem_limit 5M
47+
48+
# Parsers_File
49+
# ============
50+
# Specify an optional 'Parsers' configuration file
51+
Parsers_File parsers.conf
52+
Parsers_File custom_parsers.conf
53+
Plugins_File plugins.conf
54+
55+
# HTTP Server
56+
# ===========
57+
# Enable/Disable the built-in HTTP Server for metrics
58+
HTTP_Server Off
59+
HTTP_Listen 0.0.0.0
60+
HTTP_Port 2020
61+
62+
{{- .Values.containers.fluentbit.filters | nindent 4}}
63+
64+
{{- .Values.containers.fluentbit.inputs | nindent 4}}
65+
66+
#[FILTER]
67+
# Name lua
68+
# Match zmq
69+
# script fluentbit.lua
70+
# call set_index
71+
72+
[OUTPUT]
73+
Name es
74+
Match *
75+
Host {{ .Values.containers.fluentbit.config.elasticsearch_host }}
76+
Port {{ .Values.containers.fluentbit.config.elasticsearch_port }}
77+
Logstash_Prefix_Key es_index
78+
Logstash_DateFormat writer
79+
logstash_format on
80+
Type _doc
81+
Retry_Limit 1
82+
83+
custom_parsers.conf: |-
84+
{{- .Values.containers.fluentbit.parsers | nindent 4}}

charts/repman/values.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,21 @@ containers:
8989
requests:
9090
memory: "16Mi"
9191
cpu: "40m"
92+
fluentbit:
93+
repository: fluent/fluent-bit
94+
repositoryTag: 1.8.11
95+
pullPolicy: Always
96+
env: {}
97+
resources:
98+
requests:
99+
memory: "25Mi"
100+
cpu: "100m"
101+
config:
102+
elasticsearch_host: elasticsearch
103+
elasticsearch_port: 9200
104+
parsers: |-
105+
inputs: |-
106+
filters: |-
92107
93108
jobs: []
94109

0 commit comments

Comments
 (0)