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

feat(DMVP-2816): Added new variable for drop namespace logs #77

Merged
merged 20 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,14 @@ worker_groups = {
| <a name="input_adot_version"></a> [adot\_version](#input\_adot\_version) | The version of the AWS Distro for OpenTelemetry addon to use. | `string` | `"v0.78.0-eksbuild.1"` | no |
| <a name="input_alb_log_bucket_name"></a> [alb\_log\_bucket\_name](#input\_alb\_log\_bucket\_name) | n/a | `string` | `""` | no |
| <a name="input_alb_log_bucket_path"></a> [alb\_log\_bucket\_path](#input\_alb\_log\_bucket\_path) | ALB-INGRESS-CONTROLLER | `string` | `""` | no |
| <a name="input_api_gateway_resources"></a> [api\_gateway\_resources](#input\_api\_gateway\_resources) | Nested map containing API, Stage, and VPC Link resources | <pre>list(object({<br> namespace = string<br> api = object({<br> name = string<br> protocolType = string<br> })<br> stages = optional(list(object({<br> name = string<br> namespace = string<br> apiRef_name = string<br> stageName = string<br> autoDeploy = bool<br> description = string<br> })))<br> vpc_links = optional(list(object({<br> name = string<br> namespace = string<br> })))<br> }))</pre> | n/a | yes |
| <a name="input_api_gateway_resources"></a> [api\_gateway\_resources](#input\_api\_gateway\_resources) | Nested map containing API, Stage, and VPC Link resources | <pre>list(object({<br> namespace = string<br> api = object({<br> name = string<br> protocolType = string<br> })<br> stages = optional(list(object({<br> name = string<br> namespace = string<br> apiRef_name = string<br> stageName = string<br> autoDeploy = bool<br> description = string<br> })))<br> vpc_links = optional(list(object({<br> name = string<br> namespace = string<br> })))<br> }))</pre> | `[]` | no |
| <a name="input_api_gw_deploy_region"></a> [api\_gw\_deploy\_region](#input\_api\_gw\_deploy\_region) | Region in which API gatewat will be configured | `string` | `""` | no |
| <a name="input_autoscaler_image_patch"></a> [autoscaler\_image\_patch](#input\_autoscaler\_image\_patch) | The patch number of autoscaler image | `number` | `0` | no |
| <a name="input_autoscaler_limits"></a> [autoscaler\_limits](#input\_autoscaler\_limits) | n/a | <pre>object({<br> cpu = string<br> memory = string<br> })</pre> | <pre>{<br> "cpu": "100m",<br> "memory": "600Mi"<br>}</pre> | no |
| <a name="input_autoscaler_requests"></a> [autoscaler\_requests](#input\_autoscaler\_requests) | n/a | <pre>object({<br> cpu = string<br> memory = string<br> })</pre> | <pre>{<br> "cpu": "100m",<br> "memory": "600Mi"<br>}</pre> | no |
| <a name="input_autoscaling"></a> [autoscaling](#input\_autoscaling) | Weather enable autoscaling or not in EKS | `bool` | `false` | no |
| <a name="input_bindings"></a> [bindings](#input\_bindings) | Variable which describes group and role binding | <pre>list(object({<br> group = string<br> namespace = string<br> roles = list(string)<br><br> }))</pre> | `[]` | no |
| <a name="input_cluster_enabled_log_types"></a> [cluster\_enabled\_log\_types](#input\_cluster\_enabled\_log\_types) | A list of the desired control plane logs to enable. For more information, see Amazon EKS Control Plane Logging documentation (https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html) | `list(string)` | <pre>[<br> "audit"<br>]</pre> | no |
| <a name="input_cluster_enabled_log_types"></a> [cluster\_enabled\_log\_types](#input\_cluster\_enabled\_log\_types) | A list of the desired control plane logs to enable. For more information, see Amazon EKS Control Plane Logging documentation (https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html) | `list(string)` | `[]` | no |
| <a name="input_cluster_endpoint_public_access"></a> [cluster\_endpoint\_public\_access](#input\_cluster\_endpoint\_public\_access) | n/a | `bool` | `true` | no |
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Creating eks cluster name. | `string` | n/a | yes |
| <a name="input_cluster_version"></a> [cluster\_version](#input\_cluster\_version) | Allows to set/change kubernetes cluster version, kubernetes version needs to be updated at leas once a year. Please check here for available versions https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html | `string` | `"1.27"` | no |
Expand Down
2 changes: 1 addition & 1 deletion examples/spot-instance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.41 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.67.0 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion modules/adot/tests/template_file/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

| Name | Version |
|------|---------|
| <a name="provider_helm"></a> [helm](#provider\_helm) | n/a |
| <a name="provider_helm"></a> [helm](#provider\_helm) | 2.9.0 |
| <a name="provider_test"></a> [test](#provider\_test) | n/a |

## Modules
Expand Down
1 change: 1 addition & 0 deletions modules/fluent-bit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ No modules.
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | AWS EKS Cluster name. | `string` | n/a | yes |
| <a name="input_create_log_group"></a> [create\_log\_group](#input\_create\_log\_group) | Wether or no to create log group. | `bool` | `true` | no |
| <a name="input_create_namespace"></a> [create\_namespace](#input\_create\_namespace) | Wether or no to create namespace. | `bool` | `false` | no |
| <a name="input_drop_namespaces"></a> [drop\_namespaces](#input\_drop\_namespaces) | Flunt bit doesn't send logs for this namespace | `string` | `"(kube-system|opentelemetry-operator-system|adot|cert-manager)"` | no |
| <a name="input_eks_oidc_root_ca_thumbprint"></a> [eks\_oidc\_root\_ca\_thumbprint](#input\_eks\_oidc\_root\_ca\_thumbprint) | n/a | `string` | n/a | yes |
| <a name="input_fluent_bit_name"></a> [fluent\_bit\_name](#input\_fluent\_bit\_name) | Container resource name. | `string` | `"fluent-bit"` | no |
| <a name="input_log_group_name"></a> [log\_group\_name](#input\_log\_group\_name) | Log group name fluent-bit will be streaming logs into. | `string` | `"fluentbit-default-log-group"` | no |
Expand Down
1 change: 1 addition & 0 deletions modules/fluent-bit/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ locals {
region = local.region,
log_retention_days = var.log_retention_days
auto_create_group = var.create_log_group ? "On" : "Off"
drop_namespaces = var.drop_namespaces
}
values = var.values_yaml == null ? templatefile("${path.module}/values.yaml", local.config_settings) : var.values_yaml
}
20 changes: 20 additions & 0 deletions modules/fluent-bit/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,26 @@ config:
Systemd_Filter _SYSTEMD_UNIT=kubelet.service
Read_From_Tail On

## https://docs.fluentbit.io/manual/pipeline/filters
filters: |
[FILTER]
Name kubernetes
Match kube.*
Merge_Log On
Keep_Log Off
K8S-Logging.Parser On
K8S-Logging.Exclude On

[FILTER]
Name grep
Match *
Exclude $log (ELB-HealthChecker|Amazon-Route53-Health-Check-Service|Health)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also have additional values supplied here to filter out some extra logs?
Also we should here filter prometheus and health with smaller H as seems this is case sensitive.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please have this as a list.


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

outputs: |
[OUTPUT]
Name cloudwatch_logs
Expand Down
6 changes: 6 additions & 0 deletions modules/fluent-bit/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,9 @@ variable "s3_permission" {
default = false
type = bool
}

variable "drop_namespaces" {
type = string
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we convert this to the list?

default = "(kube-system|opentelemetry-operator-system|adot|cert-manager)"
description = "Flunt bit doesn't send logs for this namespace"
}
3 changes: 2 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ variable "external_secrets_namespace" {
variable "cluster_enabled_log_types" {
description = "A list of the desired control plane logs to enable. For more information, see Amazon EKS Control Plane Logging documentation (https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html)"
type = list(string)
default = ["audit"]
default = []
}

variable "cluster_version" {
Expand Down Expand Up @@ -370,6 +370,7 @@ variable "api_gw_deploy_region" {

variable "api_gateway_resources" {
description = "Nested map containing API, Stage, and VPC Link resources"
default = []
type = list(object({
namespace = string
api = object({
Expand Down
Loading