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

fix: Fargate-serverless pattern #2021

Merged
merged 5 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
61 changes: 36 additions & 25 deletions patterns/fargate-serverless/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,42 @@ See [here](https://aws-ia.github.io/terraform-aws-eks-blueprints/getting-started
apiVersion: v1
data:
filters.conf: |
[FILTER]
Name parser
Match *
Key_Name log
Parser regex
Preserve_Key True
Reserve_Data True
flb_log_cw: "true"
output.conf: |
[OUTPUT]
Name cloudwatch_logs
Match *
region us-west-2
log_group_name /fargate-serverless/fargate-fluentbit-logs20230509014113352200000006
log_stream_prefix fargate-logs-
auto_create_group true
parsers.conf: |
[PARSER]
Name regex
Format regex
Regex ^(?<time>[^ ]+) (?<stream>[^ ]+) (?<logtag>[^ ]+) (?<message>.+)$
Time_Key time
Time_Format %Y-%m-%dT%H:%M:%S.%L%z
Time_Keep On
Decode_Field_As json message
[FILTER]
rodrigobersa marked this conversation as resolved.
Show resolved Hide resolved
Name parser
Match *
Key_name log
Parser crio
[FILTER]
Name kubernetes
Match kube.*
Merge_Log On
Keep_Log Off
Buffer_Size 0
Kube_Meta_Cache_TTL 300s
flb_log_cw: "true"
output.conf: |
[OUTPUT]
Name cloudwatch
Match kube.*
region us-west-2
log_group_name /fargate-serverless/fargate-fluentbit-logs2024091817475518540000000a
log_stream_prefix fargate-logs-
auto_create_group true
[OUTPUT]
Name cloudwatch_logs
Match *
region us-west-2
log_group_name /fargate-serverless/fargate-fluentbit-logs2024091817475518540000000a
log_stream_prefix fluent-bit-logs-
auto_create_group true
parsers.conf: |
[PARSER]
Name crio
Format Regex
Regex ^(?<time>[^ ]+) (?<stream>stdout|stderr) (?<logtag>P|F) (?<log>.*)$
Time_Key time
Time_Format %Y-%m-%dT%H:%M:%S.%L%z
Time_Keep On
immutable: false
kind: ConfigMap
metadata:
Expand Down
12 changes: 9 additions & 3 deletions patterns/fargate-serverless/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ module "eks" {
################################################################################

module "eks_blueprints_addons" {
source = "aws-ia/eks-blueprints-addons/aws"
version = "~> 1.16"
source = "/Users/bersr/Documents/Code/Terraform/aws-ia/Blueprints/terraform-aws-eks-blueprints-addons"
# source = "aws-ia/eks-blueprints-addons/aws"
# version = "~> 1.16"

cluster_name = module.eks.cluster_name
cluster_endpoint = module.eks.cluster_endpoint
Expand Down Expand Up @@ -143,7 +144,7 @@ module "eks_blueprints_addons" {
kube-proxy = {}
}

# Enable Fargate logging
# Enable Fargate logging this may generate a large ammount of logs, disable it if not explicitly required
enable_fargate_fluentbit = true
fargate_fluentbit = {
flb_log_cw = true
Expand Down Expand Up @@ -237,6 +238,11 @@ resource "kubernetes_deployment_v1" "this" {
container_port = 80
}
}
toleration {
effect = "NoSchedule"
key = "eks.amazonaws.com/compute-type"
value = "fargate"
}
}
}
}
Expand Down
Loading