Skip to content
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

[logshipper] Debug helm chart test #421

Closed
wants to merge 11 commits into from
2 changes: 2 additions & 0 deletions .github/configs/helm-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ chart-dirs:
- plutono
- thanos
- opentelemetry
- logshipper
chart-repos:
- cert-manager=https://charts.jetstack.io
- alerts=https://prometheus-community.github.io/helm-charts
- kube-monitoring=https://prometheus-community.github.io/helm-charts
- opentelemetry=https://open-telemetry.github.io/opentelemetry-helm-charts
- logshipper=https://fluent.github.io/helm-charts
2 changes: 1 addition & 1 deletion logshipper/chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: logshipper
description: A Helm chart for deploying fluent-bit with custom config

type: application
version: 0.2.3
version: 0.2.4
appVersion: 3.0.4

dependencies:
Expand Down
18 changes: 14 additions & 4 deletions logshipper/chart/ci/test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ fluent-bit:
http_user: top-secret-audit
http_password: top-secret-audit
host: "audit.test"
port: 9200
logstash_prefix: "audit"
tls:
enabled: true
verify: true
Expand Down Expand Up @@ -44,15 +46,14 @@ fluent-bit:
secretKeyRef:
name: fluent-bit-secrets
key: AUDIT_PWD

filter:
additionalValues:
- key: region
name: qa
value: qa
customConfig:
inputs: |
[INPUT]
Name tail-audit
Name tail
Path /var/log/containers/greenhouse-controller*.log
Parser cri
Tag audit.*
Expand All @@ -65,7 +66,7 @@ fluent-bit:
[FILTER]
Name grep
Match audit.*
Regex MyAuditLogTag
Regex log_message MyAuditLogTag
outputs: |
[OUTPUT]
Name audit
Expand All @@ -82,4 +83,13 @@ fluent-bit:
tls {{ index .Values "fluent-bit" "backend" "audit" "tls" "enabled"}}
tls.verify {{ index .Values "fluent-bit" "backend" "audit" "tls" "verify"}}
tls.debug {{ index .Values "fluent-bit" "backend" "audit" "tls" "debug"}}
extraVolumes:
- name: journal
hostPath:
path: /var/log/journal
type: DirectoryOrCreate # Ensure the directory is created if it doesn't exist
extraVolumeMounts:
- name: journal
mountPath: /var/log/journal
readOnly: true
prometheusName: foo-bar
57 changes: 0 additions & 57 deletions logshipper/chart/templates/fluent-bit-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ data:
Daemon Off
Log_Level info
Parsers_File parsers.conf
Parsers_File parsers_custom.conf
HTTP_Server On
HTTP_Listen 0.0.0.0
HTTP_Port {{ index .Values "fluent-bit" "metricsPort" }}
Expand All @@ -44,51 +43,6 @@ data:
Strip_Underscores On
Lowercase On

{{ if (( index .Values "fluent-bit" "customConfig").inputs) }}
@INCLUDE custom-inputs.conf
{{- end }}

[FILTER]
Name record_modifier
Match default_systemd.*
Whitelist_key _SYSTEMD_UNIT
Whitelist_key MESSAGE
Whitelist_key _PID
Whitelist_key _PRIORITY
Whitelist_key _COMM
Whitelist_key _HOSTNAME

[FILTER]
Name modify
Match default_systemd.*
Rename _SYSTEMD_UNIT unit
Rename MESSAGE log
Rename _PID pid
Rename _PRIORITY priority
Rename _COMM cmd
Rename _HOSTNAME hostname

[FILTER]
Name record_modifier
Match default_kube.*
Remove_key time
Remove_key ts

[FILTER]
Name modify
Match default_kube.*
Rename message log

[FILTER]
Name kubernetes
Match default_kube.*
Kube_Tag_Prefix kube.var.log.containers.
Kube_URL https://kubernetes.default.svc:443
Kube_CA_File /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
Kube_Token_File /var/run/secrets/kubernetes.io/serviceaccount/token
Merge_Log On
Merge_Log_Trim On

Comment on lines -47 to -91
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change. What is the reason for removing this?

{{ if (( index .Values "fluent-bit" "customConfig").filters) }}
@INCLUDE custom-filters.conf
{{- end }}
Expand Down Expand Up @@ -120,17 +74,6 @@ data:
tls.debug {{ index .Values "fluent-bit" "backend" "opensearch" "tls" "debug"}}
{{ end }}

{{ if ((index .Values "fluent-bit" "customConfig").outputs) }}
@INCLUDE custom-outputs.conf
{{- end }}

[OUTPUT]
Name prometheus_exporter
Match internal_metrics
Host 0.0.0.0
Port 2021
Add_label app {{ include "fluent-bit.name" . }}

Comment on lines -123 to -133
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change. What is the reason for removing this?

{{ if ((index .Values "fluent-bit" "customConfig").inputs) }}
custom-inputs.conf: |-
{{- tpl (index .Values "fluent-bit" "customConfig" "inputs") . | nindent 6 }}
Expand Down
2 changes: 2 additions & 0 deletions logshipper/chart/templates/fluent-bit-pod-monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ SPDX-License-Identifier: Apache-2.0
*/}}

{{- if .Values.prometheusName -}}
{{ if .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor

Expand Down Expand Up @@ -32,3 +33,4 @@ spec:
- targetLabel: job
replacement: fluent-bit-exporter
{{- end -}}
{{- end -}}
4 changes: 2 additions & 2 deletions logshipper/plugindefinition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ kind: PluginDefinition
metadata:
name: logshipper
spec:
version: 0.2.3
version: 0.2.4
displayName: Fluent-bit Logshipper
description: Logshipping of container logs and systemd with fluent-bit
icon: https://raw.githubusercontent.com/fluent/fluent-bit/master/fluentbit_logo.png
helmChart:
name: logshipper
repository: oci://ghcr.io/cloudoperators/greenhouse-extensions/charts
version: 0.2.3
version: 0.2.4
options:
- name: fluent-bit.parser
description: Parser used for container logs. [docker|cri]
Expand Down
Loading