-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fluent-bit and VictoriaLogs #305
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
packages/extra/monitoring/templates/vlogs/grafana-datasource.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{- range .Values.logsStorages }} | ||
apiVersion: grafana.integreatly.org/v1beta1 | ||
kind: GrafanaDatasource | ||
metadata: | ||
name: vlog-{{ .name }} | ||
spec: | ||
datasource: | ||
access: proxy | ||
type: victorialogs-datasource | ||
name: vlog-{{ .name }} | ||
url: http://vlog-{{ .name }}-0.vlog-{{ .name }}.{{ $.Release.Namespace }}.svc:9428 | ||
instanceSelector: | ||
matchLabels: | ||
dashboards: grafana | ||
{{- end }} |
31 changes: 31 additions & 0 deletions
31
packages/extra/monitoring/templates/vlogs/vlogs-release.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{{- range .Values.logsStorages }} | ||
apiVersion: helm.toolkit.fluxcd.io/v2 | ||
kind: HelmRelease | ||
metadata: | ||
name: vlog-{{ .name }}-system | ||
labels: | ||
app.kubernetes.io/instance: {{ $.Release.Name }} | ||
app.kubernetes.io/managed-by: {{ $.Release.Service }} | ||
spec: | ||
chart: | ||
spec: | ||
chart: cozy-victoria-logs | ||
reconcileStrategy: Revision | ||
sourceRef: | ||
kind: HelmRepository | ||
name: cozystack-system | ||
namespace: cozy-system | ||
version: '*' | ||
interval: 1m0s | ||
timeout: 5m0s | ||
values: | ||
global: | ||
victoriaLogs: | ||
server: | ||
fullnameOverride: vlog-{{ .name }} | ||
kvaps marked this conversation as resolved.
Show resolved
Hide resolved
|
||
victoria-logs-single: | ||
server: | ||
persistentVolume: | ||
kvaps marked this conversation as resolved.
Show resolved
Hide resolved
|
||
enabled: true | ||
size: 10Gi | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,14 @@ metricsStorages: | |
storage: 10Gi | ||
storageClassName: "" | ||
|
||
## @param metricsStorages [array] Configuration of logs storage instances | ||
## | ||
logsStorages: | ||
- name: generic | ||
retentionPeriod: "1m" | ||
storage: 10Gi | ||
storageClassName: replicated | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By default it uses |
||
|
||
## @param oncall.enabled Enable Grafana OnCall | ||
## | ||
oncall: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
annotations: | ||
artifacthub.io/changes: | | ||
- kind: changed | ||
description: "Updated Fluent Bit OCI image to v3.1.6." | ||
apiVersion: v1 | ||
appVersion: 3.1.6 | ||
description: Fast and lightweight log processor and forwarder or Linux, OSX and BSD | ||
family operating systems. | ||
home: https://fluentbit.io/ | ||
icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/fluentd/fluentbit/icon/fluentbit-icon-color.svg | ||
keywords: | ||
- logging | ||
- fluent-bit | ||
- fluentd | ||
maintainers: | ||
- email: [email protected] | ||
name: edsiper | ||
- email: [email protected] | ||
name: naseemkullah | ||
- email: [email protected] | ||
name: Towmeykaw | ||
- email: [email protected] | ||
name: stevehipwell | ||
name: fluent-bit | ||
sources: | ||
- https://github.com/fluent/fluent-bit/ | ||
version: 0.47.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Fluent Bit Helm chart | ||
|
||
[Fluent Bit](https://fluentbit.io) is a fast and lightweight log processor and forwarder or Linux, OSX and BSD family operating systems. | ||
|
||
## Installation | ||
|
||
To add the `fluent` helm repo, run: | ||
|
||
```sh | ||
helm repo add fluent https://fluent.github.io/helm-charts | ||
``` | ||
|
||
To install a release named `fluent-bit`, run: | ||
|
||
```sh | ||
helm install fluent-bit fluent/fluent-bit | ||
``` | ||
|
||
## Chart values | ||
|
||
```sh | ||
helm show values fluent/fluent-bit | ||
``` | ||
|
||
## Using Lua scripts | ||
Fluent Bit allows us to build filter to modify the incoming records using custom [Lua scripts.](https://docs.fluentbit.io/manual/pipeline/filters/lua) | ||
|
||
### How to use Lua scripts with this Chart | ||
|
||
First, you should add your Lua scripts to `luaScripts` in values.yaml, for example: | ||
|
||
```yaml | ||
luaScripts: | ||
filter_example.lua: | | ||
function filter_name(tag, timestamp, record) | ||
-- put your lua code here. | ||
end | ||
``` | ||
|
||
After that, the Lua scripts will be ready to be used as filters. So next step is to add your Fluent bit [filter](https://docs.fluentbit.io/manual/concepts/data-pipeline/filter) to `config.filters` in values.yaml, for example: | ||
|
||
```yaml | ||
config: | ||
filters: | | ||
[FILTER] | ||
Name lua | ||
Match <your-tag> | ||
script /fluent-bit/scripts/filter_example.lua | ||
call filter_name | ||
``` | ||
Under the hood, the chart will: | ||
- Create a configmap using `luaScripts`. | ||
- Add a volumeMounts for each Lua scripts using the path `/fluent-bit/scripts/<script>`. | ||
- Add the Lua script's configmap as volume to the pod. | ||
|
||
### Note | ||
Remember to set the `script` attribute in the filter using `/fluent-bit/scripts/`, otherwise the file will not be found by fluent bit. |
7 changes: 7 additions & 0 deletions
7
packages/system/monitoring/charts/fluent-bit/ci/ci-values.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
testFramework: | ||
enabled: true | ||
|
||
logLevel: debug | ||
|
||
dashboards: | ||
enabled: true |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to build custom image as there could be no internet access (prepare for airgap)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or just use a VolumeSource from the latest kubernetes and use the power of OCI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, I'll add an issue for this #306