-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from dasmeta/DMVP-2816
feat(DMVP-2816): Added new variable for drop namespace logs
- Loading branch information
Showing
25 changed files
with
548 additions
and
70 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
module "fluent-bit" { | ||
source = "./modules/fluent-bit" | ||
|
||
count = var.create ? 1 : 0 | ||
|
||
account_id = local.account_id | ||
region = local.region | ||
|
||
cluster_name = module.eks-cluster[0].cluster_id | ||
eks_oidc_root_ca_thumbprint = module.eks-cluster[0].eks_oidc_root_ca_thumbprint | ||
oidc_provider_arn = module.eks-cluster[0].oidc_provider_arn | ||
|
||
fluent_bit_name = try(var.fluent_bit_configs.fluent_bit_name, "") != "" ? var.fluent_bit_configs.fluent_bit_name : "${module.eks-cluster[0].cluster_id}-fluent-bit" | ||
log_group_name = try(var.fluent_bit_configs.log_group_name, "") != "" ? var.fluent_bit_configs.log_group_name : "fluent-bit-cloudwatch-${module.eks-cluster[0].cluster_id}" | ||
system_log_group_name = try(var.fluent_bit_configs.system_log_group_name, "") | ||
log_retention_days = try(var.fluent_bit_configs.log_retention_days, 90) | ||
|
||
values_yaml = try(var.fluent_bit_configs.values_yaml, "") | ||
|
||
drop_namespaces = try(var.fluent_bit_configs.drop_namespaces, [ | ||
"kube-system", | ||
"opentelemetry-operator-system", | ||
"adot", | ||
"cert-manager" | ||
]) | ||
log_filters = try(var.fluent_bit_configs.log_filters, [ | ||
"kube-probe", | ||
"health", | ||
"prometheus", | ||
"liveness" | ||
]) | ||
|
||
additional_log_filters = try(var.fluent_bit_configs.additional_log_filters, [ | ||
"ELB-HealthChecker", | ||
"Amazon-Route53-Health-Check-Service", | ||
]) | ||
|
||
fluent_bit_config = try(var.fluent_bit_configs.configs, { | ||
inputs = "" | ||
outputs = "" | ||
filters = "" | ||
}) | ||
} |
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
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,21 @@ | ||
terraform { | ||
required_providers { | ||
test = { | ||
source = "terraform.io/builtin/test" | ||
} | ||
|
||
aws = { | ||
source = "hashicorp/aws" | ||
version = "~> 4.37" | ||
} | ||
kubernetes = { | ||
source = "hashicorp/kubernetes" | ||
version = "~>2.23" | ||
} | ||
helm = ">= 2.0" | ||
} | ||
} | ||
|
||
provider "aws" {} | ||
provider "helm" {} | ||
provider "kubernetes" {} |
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,52 @@ | ||
locals { | ||
oidc_provider_arn = "arn:aws:iam::000000000000:oidc-provider/oidc.eks.eu-central-1.amazonaws.com/id/6F40EA94327Dh8956DDB9S0AE7907CFD" | ||
} | ||
|
||
module "fluent-bit" { | ||
source = "../../" | ||
|
||
account_id = 000000000000 | ||
region = "eu-central-1" | ||
|
||
cluster_name = "Test" | ||
oidc_provider_arn = local.oidc_provider_arn | ||
eks_oidc_root_ca_thumbprint = replace(local.oidc_provider_arn, "/.*id//", "") | ||
|
||
|
||
log_group_name = "fluent-bit" | ||
system_log_group_name = "fluent-bit-kube" | ||
create_log_group = true | ||
log_retention_days = 7 | ||
|
||
drop_namespaces = [ | ||
"kube-system", | ||
"opentelemetry-operator-system", | ||
"adot", | ||
"cert-manager" | ||
] | ||
|
||
additional_log_filters = [ | ||
"ELB-HealthChecker", | ||
"Amazon-Route53-Health-Check-Service", | ||
] | ||
|
||
log_filters = [ | ||
"ELB-HealthChecker", | ||
"Amazon-Route53-Health-Check-Service", | ||
"kube-probe", | ||
"health", | ||
"prometheus", | ||
"liveness" | ||
] | ||
|
||
fluent_bit_config = { | ||
inputs = templatefile("${path.module}/templates/inputs.yaml.tpl", {}) | ||
outputs = templatefile("${path.module}/templates/outputs.yaml.tpl", {}) | ||
filters = templatefile("${path.module}/templates/filters.yaml.tpl", {}) | ||
} | ||
|
||
} | ||
|
||
output "merged_inputs" { | ||
value = module.fluent-bit | ||
} |
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,9 @@ | ||
resource "test_assertions" "api_url" { | ||
component = "Basic-Setup" | ||
|
||
equal "scheme" { | ||
description = "As module does not have any output and data just make sure the case runs. Probably can be thrown away." | ||
got = "all good" | ||
want = "all good" | ||
} | ||
} |
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,39 @@ | ||
# basic | ||
|
||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 4.37 | | ||
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >= 2.0 | | ||
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | ~>2.23 | | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_test"></a> [test](#provider\_test) | n/a | | ||
|
||
## Modules | ||
|
||
| Name | Source | Version | | ||
|------|--------|---------| | ||
| <a name="module_fluent-bit"></a> [fluent-bit](#module\_fluent-bit) | ../../ | n/a | | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| test_assertions.api_url | resource | | ||
|
||
## Inputs | ||
|
||
No inputs. | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| <a name="output_merged_inputs"></a> [merged\_inputs](#output\_merged\_inputs) | n/a | | ||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
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,9 @@ | ||
[FILTER] | ||
Name grep | ||
Match kube.* | ||
Exclude $log (test) | ||
|
||
[FILTER] | ||
Name grep | ||
Match audit.* | ||
regex $log (test) |
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,9 @@ | ||
[INPUT] | ||
Name tail | ||
Tag test.* | ||
Path /var/log/containers/*.log | ||
Read_from_head true | ||
multiline.parser docker, cri | ||
Docker_Mode On | ||
Parser docker | ||
Mem_Buf_Limit 50MB |
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 @@ | ||
[OUTPUT] | ||
Name s3 | ||
Match test.* | ||
bucket s3-bucket | ||
region eu-central-1 | ||
total_file_size 250M | ||
s3_key_format /%Y/%m/%d/%H_%M_%S.gz |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.