Skip to content

Commit

Permalink
feat(DMVP-eks-update): Fix fluent-bit
Browse files Browse the repository at this point in the history
  • Loading branch information
aramkarapetian committed Oct 12, 2023
1 parent 1b08c2a commit 1329c2a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ worker_groups = {
| <a name="module_eks-cluster"></a> [eks-cluster](#module\_eks-cluster) | ./modules/eks | n/a |
| <a name="module_external-secrets"></a> [external-secrets](#module\_external-secrets) | ./modules/external-secrets | n/a |
| <a name="module_fluent-bit"></a> [fluent-bit](#module\_fluent-bit) | ./modules/fluent-bit | n/a |
| <a name="module_loki"></a> [loki](#module\_loki) | ./modules/loki | n/a |
| <a name="module_metrics-server"></a> [metrics-server](#module\_metrics-server) | ./modules/metrics-server | n/a |
| <a name="module_node-problem-detector"></a> [node-problem-detector](#module\_node-problem-detector) | ./modules/node-problem-detector | n/a |
| <a name="module_olm"></a> [olm](#module\_olm) | ./modules/olm | n/a |
Expand Down
2 changes: 1 addition & 1 deletion modules/fluent-bit/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ locals {
inputs = try(var.fluent_bit_config.inputs, "")
outputs = try(var.fluent_bit_config.outputs, "")
filters = try(var.fluent_bit_config.filters, "")
kube_namespaces = "^(${join("|", var.kube_namespaces)})"
kube_namespaces = var.kube_namespaces
}
values = var.values_yaml == "" ? templatefile("${path.module}/values.yaml.tpl", local.config_settings) : var.values_yaml
Expand Down
28 changes: 15 additions & 13 deletions modules/fluent-bit/values.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ config:
inputs: |
[INPUT]
Name tail
Tag *
Tag kube.*
Path /var/log/containers/*.log
Read_from_head true
multiline.parser docker, cri
Expand All @@ -23,37 +23,39 @@ config:
filters: |
[FILTER]
Name kubernetes
Match *
Match kube.*
Merge_Log On
Keep_Log Off
K8S-Logging.Parser On
K8S-Logging.Exclude On

[FILTER]
Name grep
Match *
Exclude $message ${log_filters}
Match kube.*
Exclude $log ${log_filters}

[FILTER]
Name grep
Match *
Exclude $message ${additional_log_filters}
Match kube.*
Exclude $log ${additional_log_filters}

%{ for value in kube_namespaces }
[FILTER]
Name rewrite_tag
Match kube.*
Rule $kubernetes['namespace_name'] ^${value}$ system.$TAG false
%{ endfor ~}

[FILTER]
Name grep
Match *
Exclude $kubernetes['namespace_name'] ${drop_namespaces}

[FILTER]
Name rewrite_tag
Match kube.*
Rule $kubernetes['namespace_name'] ${kube_namespaces} kube.$TAG false

${indent(4, filters)}
outputs: |
[OUTPUT]
Name cloudwatch_logs
Match *
Match kube.*
region ${region}
log_group_name ${log_group_name}
log_stream_prefix from-fluent-bit-
Expand All @@ -71,7 +73,7 @@ config:

[OUTPUT]
Name cloudwatch_logs
Match kube.*
Match system.*
region ${region}
log_group_name ${system_log_group_name}
log_stream_prefix from-fluent-bit-
Expand Down

0 comments on commit 1329c2a

Please sign in to comment.